Skip to content

Commit f68ba1e

Browse files
authored
Merge pull request #362 from Code-4-Community/347-dev---add-grant
347 dev add/edit grant
2 parents c79eaa0 + 4447834 commit f68ba1e

76 files changed

Lines changed: 1757 additions & 2863 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/src/grant/grant.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class GrantController {
6464
@ApiResponse({ status: 403, description: 'Forbidden - User does not have access to this resource' })
6565
@ApiResponse({ status: 500, description: 'Internal Server Error', example: 'Internal Server Error' })
6666
async addGrant(
67-
@Body(new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true }))
67+
@Body()
6868
grant: AddGrantBody
6969
): Promise<number> {
7070
this.logger.log(`POST /grant/new-grant - Creating new grant for organization: ${grant.organization}`);

backend/src/grant/grant.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ export class GrantService {
384384
amount: grant.amount,
385385
grant_start_date: grant.grant_start_date,
386386
application_deadline: grant.application_deadline,
387+
application_date: grant.application_date,
387388
report_deadlines: grant.report_deadlines,
388389
description: grant.description,
389390
timeline: grant.timeline,

backend/src/grant/types/grant.types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export class GrantResponseDto {
2222

2323
@ApiProperty({ description: 'When grant submission is due', example: '2024-06-01T00:00:00.000Z' })
2424
application_deadline!: string;
25+
26+
@ApiProperty({ description: 'When grant was submitted', example: '2024-06-01T00:00:00.000Z' })
27+
application_date?: string;
2528

2629
@ApiProperty({ description: 'Multiple report dates', type: [String], required: false })
2730
report_deadlines?: string[];
@@ -75,6 +78,9 @@ export class AddGrantBody {
7578

7679
@ApiProperty({ description: 'When grant submission is due', example: '2024-06-01T00:00:00.000Z' })
7780
application_deadline!: string;
81+
82+
@ApiProperty({ description: 'When grant was submitted', example: '2024-06-01T00:00:00.000Z' })
83+
application_date?: string;
7884

7985
@ApiProperty({ description: 'Multiple report dates', type: [String], required: false, example: ['2024-12-01T00:00:00.000Z'] })
8086
report_deadlines?: string[];
@@ -122,6 +128,9 @@ export class UpdateGrantBody {
122128

123129
@ApiProperty({ description: 'When grant submission is due', required: false })
124130
application_deadline?: string;
131+
132+
@ApiProperty({ description: 'When grant was submitted', required: false })
133+
application_date?: string;
125134

126135
@ApiProperty({ description: 'Multiple report dates', type: [String], required: false })
127136
report_deadlines?: string[];

frontend/package-lock.json

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"@types/react-transition-group": "^4.4.12",
4949
"@vitejs/plugin-react": "^4.3.1",
5050
"autoprefixer": "^10.4.20",
51-
"baseline-browser-mapping": "^2.8.29",
5251
"eslint": "^9.9.0",
5352
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
5453
"eslint-plugin-react-refresh": "^0.4.9",

frontend/src/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FooterText } from "./translations/general";
44

55
const Footer: React.FC = () => {
66
return (
7-
<div className="footer flex flex-col items-center justify-center py-10 px-4 text-base text-grey-700">
7+
<div className="footer flex flex-col items-center justify-center py-12 pt-16 px-4 text-base text-grey-700">
88
<Group className="flex flex-col p-2">
99
<Text>
1010
{FooterText.C4C_Motto}

frontend/src/custom/ActionConfirmation.tsx renamed to frontend/src/components/ActionConfirmation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { IoIosWarning } from "react-icons/io";
2727
onClick={onCloseDelete}
2828
>
2929
<div
30-
className=" bg-white border-2 rounded-md shadow-2xl p-8 max-w-xl w-full mx-4 transform transition-all duration-300"
30+
className=" bg-white rounded-md shadow-2xl p-8 max-w-xl w-full mx-4 transform transition-all duration-300"
3131
onClick={(e) => e.stopPropagation()}
3232
>
3333

@@ -53,7 +53,7 @@ import { IoIosWarning } from "react-icons/io";
5353
<IoIosWarning size={24} className="text-red"/>
5454
<p className="font-bold px-1 text-lg text-red"> Warning </p>
5555
</div>
56-
<p className=" text-left text-lg font-semibold text-red">
56+
<p className=" text-left font-semibold text-red">
5757
{warningMessage}
5858
</p>
5959

frontend/src/components/Button.tsx

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,58 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
22
import { IconProp } from "@fortawesome/fontawesome-svg-core";
33

44
type ButtonProps = {
5-
text: string;
6-
onClick: () => void;
7-
className?: string;
8-
logo?: IconProp;
9-
logoPosition?: 'left' | 'right';
10-
disabled?: boolean;
11-
type?: "button" | "submit" | "reset";
12-
}
13-
5+
text: string;
6+
onClick: () => void;
7+
className?: string;
8+
logo?: IconProp;
9+
logoPosition?: "left" | "right" | "center";
10+
disabled?: boolean;
11+
type?: "button" | "submit" | "reset";
12+
};
1413

1514
// Button component where you can pass in text, onClick handler, optional className
1615
// for styling, and an optional logo with its position.
1716
//Styling is default, but can be overridden by passing in a className prop
18-
export default function Button({ text, onClick, className, logo, logoPosition, disabled, type }: ButtonProps) {
17+
export default function Button({
18+
text,
19+
onClick,
20+
className,
21+
logo,
22+
logoPosition,
23+
disabled,
24+
type,
25+
}: ButtonProps) {
1926
return (
20-
<button onClick={onClick} disabled={disabled || false} type={type || "button"}
21-
className={`
22-
px-4 py-2 rounded-3xl font-medium text-black border-2 active:bg-primary-900 active:border-primary-900 active:text-white
23-
h-fit flex items-center justify-center transition-opacity
24-
${className} ${disabled
25-
? "cursor-not-allowed opacity-50"
26-
: "hover:opacity-90"}
27+
<button
28+
onClick={onClick}
29+
disabled={disabled || false}
30+
type={type || "button"}
31+
className={`
32+
px-4 py-2 rounded-3xl font-medium text-black border-2
33+
active:bg-primary-900 active:border-primary-900 active:text-white
34+
h-fit flex-grow-0 items-center justify-center
35+
transition-opacity flex whitespace-nowrap
36+
${className} ${
37+
disabled ? "cursor-not-allowed opacity-50" : "hover:opacity-90"
38+
}
2739
`}
2840
>
29-
{logo && logoPosition === 'left' &&
30-
<span className="mr-2">
31-
<FontAwesomeIcon icon={logo} className="text-lg w-4 h-4" />
32-
</span>}
41+
{logo && logoPosition === "left" && (
42+
<span className="mr-2">
43+
<FontAwesomeIcon icon={logo} className="" />
44+
</span>
45+
)}
3346
{text}
34-
{logo && logoPosition === 'right' &&
35-
<span className="ml-2">
36-
<FontAwesomeIcon icon={logo} className="text-lg w-4 h-4" />
37-
</span>}
47+
{logo && logoPosition === "right" && (
48+
<span className="ml-2">
49+
<FontAwesomeIcon icon={logo} className="" />
50+
</span>
51+
)}
52+
{logo && logoPosition === "center" && (
53+
<span className="">
54+
<FontAwesomeIcon icon={logo} className="" />
55+
</span>
56+
)}
3857
</button>
3958
);
40-
}
59+
}

frontend/src/components/InputField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ export default function InputField({
2121
}: InputFieldProps) {
2222
return (
2323
<div className="w-full">
24-
<label htmlFor={id} className="block text-left font-semibold">
24+
<label htmlFor={id} className="block text-left font-semibold text-sm lg:text-base">
2525
{label}
2626
{required && <span className="text-red">*</span>}
2727
</label>
2828
<div className="mt-2 flex items-center rounded-md">
2929
<input
3030
id={id}
3131
{...inputProps}
32-
className={`block w-full rounded-md py-2.5 pl-4 pr-3 text-base border-2 placeholder:text-grey-500 ${
32+
className={`block w-full rounded-md py-2.5 pl-4 pr-3 text-sm lg:text-base border-2 placeholder:text-grey-500 ${
3333
error ? "border-red bg-red-lightest" : "border-grey-500 bg-grey-100 "
3434
}`}
3535

frontend/src/components/SearchBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function SearchBar({
2727
/>
2828
<input
2929
placeholder={`Search for a ${text}...`}
30-
className="w-full px-4 py-2 rounded-3xl font-medium text-black border-2 flex items-center justify-center border-grey-500"
30+
className="w-full px-4 py-2 rounded-3xl font-medium text-sm lg:text-base text-black border-2 flex items-center justify-center border-grey-500"
3131
onChange={handleInputChange}
3232
value={userInput}
3333
style={{ paddingLeft: "2rem" }} // make room for the icon

0 commit comments

Comments
 (0)