Skip to content

Commit 0210fb2

Browse files
fagundesjghelenapaixaoluccas-spechtMatheusDubindanmqs
authored and
marcodmc
committed
Release/0.0.3 (SOS-RS#187)
* [fix] Config readme * wip: loading * Delete yarn.lock * refact: created shelter list view component in home page * Fix: mobile UI has broken for mobile devices (SOS-RS#22) *Fix: mobile UI has broken for mobile devices * fix: remove chip as fixed as no wrap property * chore: add shelter card clickable * chore: remove Fragment component * build: add set sm as max mobile dimension sm: 425px * style: add responsive layout * refactor: filter page * fix: priority * fix: filter parameters * fix: fixed volunteer supply that had been fulfilled displaying on shelter page * fix: improve readability * feat: hidden filter button if filter is empty * feat: cache in axios request * fix: cache search params * feat: cache clean on searchs * wip: donation tags * fix: clean search params * Update README.md [fix] Retirando a seção Funcionalidades e Backlog * fix: donation tags / componentized the urgent supplies section * fix: removed empty shelter tags empty row * feat: full edit shelter and improved interface of pet friendly in shelter page * refact: add live link and tech stack to readme * Fix/develop bugs (SOS-RS#90) * fix: cache bug (invalite cache on create/update operation) * feat: added update many shelter supplies and admin rule * Add license (SOS-RS#81) Closes SOS-RS#65. * fix: app port (SOS-RS#80) * docs: added shadcn/ui reference * fix for volunteer shelter title (SOS-RS#95) * treat contact link as a proper link * simplified href * docs: add discord link on readme * Normalizes search string in supply filter so it ignores accents (SOS-RS#125) * normalized search string to ignore accents * revert removed button * add a copy to clipboard button to PIX and contact info (SOS-RS#124) * add a copy to clipboard button to PIX and contact info * use && operator instead of ternary * Substitui onClick e useNavigate por <Link> para melhorar acessibilidade (SOS-RS#128) * replaced navigate in favour of html link and added card hover * fixed lint warnings * fix: change shelter title style (SOS-RS#106) Prevents badge misalignment on very large titles * Add new feature and creating LoadingSkeleton (SOS-RS#115) * Add new feature and creating LoadingSkeleton * fix/add: add favicon and canonical metatag (SOS-RS#136) * fix/add: add favicon and canonical metatag * fix: fixed the path * refactor: changed order of shelters to updated at instead priority sum (SOS-RS#137) * Remove zod dependency (SOS-RS#143) * replaced zod validation with yup * removed zod dependency from package.json * sort dependencies * fixed validation schema variable name * removed .shape() and added .strict() * deleted unused file * Added burger menu to home page (SOS-RS#149) * Implemented Burger menu * commented unused components * feat: Update BurgerMenu to display user's name when logged in * removed comments * implemented login and logout button * Feat/partners (SOS-RS#155) * fix: menu bar with api partners * fix: menu bar with api partners * fix: remove unused session in burguer menu / removed import all icons from lucide and use link icon instead custom icons * [BUG] Botão de Limpar Filtro sumindo após remover input de busca (SOS-RS#147) * fix: clean filter button disappearing after removing search input manually * fix: removing log * Modificação nas telas de abrigos para adicionar cidades (SOS-RS#110) * feat: filter shlters by cities * feat: city on shelter forms, info and list * feat: shelter city quantities on filter * fix: wrong conditional * fix: bug that removing city filter on home doesnt affect the filter * feat: new address fields on shelter forms * feat: useDebouncedValue, useViaCep * feat: adapt useFetch for conditional paths and different response * feat: address fields required and zipCode triggering viaCep * feat: address fields required on update shelter * feat: address fields on shelter details when theres no address field * fix: suggestions(shorthand, optional chaining, separated zipCode, formatted city on list) * feat: sticky footer on filter dialog * fix: reset errors on zipcode search; copy filter change * fix: timeoutId not assigned value; InfoRow copy can copy undefined * Campo de quantidade adicionado quando adicionar suprimento a um abrigo (SOS-RS#46) * feat(shelter-supply): input to add quantity supply * feat(shelter-supply): show quantity supply at Shelter page and EditShelter page * resolve conflict --------- Co-authored-by: Lipe <[email protected]> * feat: google analytics * feat: edit shelter supply item quantity (SOS-RS#170) * fix: send address field formatted (SOS-RS#171) * feat: add a template to log bugs/defects (SOS-RS#168) * feat: add a template to log bugs/defects * Feat/privacy terms about us (SOS-RS#169) * feat: privacy policy page * feat: done about us page * fix: removed redundant value check in info row component * fix: ordering the list of items on the shelter edit page (SOS-RS#166) * feat: Melhoria no esquema de cores dos chip's e ajuste de acessibilidade (SOS-RS#162) * feat: new text colors with adjusted light var colors * feat: change chip element tag to span and improve a11y * feat: added update date information to shelter page (SOS-RS#159) * Adding update date to shelter page * (Aditional) Informing when no update date for shelter in main page * feat: ajuste de textos de voluntários e doações (SOS-RS#129) * hotfix: shelter list item broken div tag * Feat/back navigation to home (SOS-RS#177) * feat: added back navigation to home when click in header label * Hotfix/merge bugs (SOS-RS#183) * fix: shelter list item duplicate code after merge * fix: order in filter select menu, filter supplies by category and useSupplies interface * fix: update shelter validation schema and created useAuthRoles hook to reduce complexity of code * fix: conflicts with master branch --------- Co-authored-by: helenapaixao <[email protected]> Co-authored-by: Luccas Specht <[email protected]> Co-authored-by: MatheusDubin <[email protected]> Co-authored-by: danmqs <[email protected]> Co-authored-by: Giovanni Bassi <[email protected]> Co-authored-by: Felipe Monteiro <[email protected]> Co-authored-by: André Ferraz <[email protected]> Co-authored-by: Sombrio <[email protected]> Co-authored-by: Filipe Pacheco de Fraga <[email protected]> Co-authored-by: Daniel Marques <[email protected]> Co-authored-by: Matheus Dubin Da Silveira <[email protected]> Co-authored-by: Miguel Dalberto <[email protected]> Co-authored-by: Pablo A. Maximo <[email protected]> Co-authored-by: Marcos Nascimento <[email protected]> Co-authored-by: Gilmar José <[email protected]> Co-authored-by: Kelvin <[email protected]> Co-authored-by: Jhonatan David <[email protected]> Co-authored-by: Alexander Scheibler <[email protected]> Co-authored-by: Giovani Andrino Carnaval <[email protected]> Co-authored-by: Thiago Oliveira <[email protected]> Co-authored-by: Henrique Uhlmann Gobbi <[email protected]> Co-authored-by: Janderson Soares <[email protected]>
1 parent 9b7f0e3 commit 0210fb2

File tree

18 files changed

+1015
-463
lines changed

18 files changed

+1015
-463
lines changed

package-lock.json

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

package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,46 @@
1919
"@radix-ui/react-select": "^2.0.0",
2020
"@radix-ui/react-separator": "^1.0.3",
2121
"@radix-ui/react-slot": "^1.0.2",
22+
"@radix-ui/react-tabs": "^1.0.4",
2223
"@radix-ui/react-toast": "^1.1.5",
2324
"@radix-ui/react-tooltip": "^1.0.7",
2425
"axios": "^1.6.8",
2526
"class-variance-authority": "^0.7.0",
2627
"clsx": "^2.1.1",
28+
"crypto-js": "^4.2.0",
2729
"date-fns": "^3.6.0",
2830
"formik": "^2.4.6",
2931
"lucide-react": "^0.378.0",
3032
"qs": "^6.12.1",
31-
<<<<<<< HEAD
32-
=======
3333
"react": "^18.2.0",
34-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
3534
"react-dom": "^18.2.0",
3635
"react-hook-form": "^7.51.4",
3736
"react-input-mask": "^2.0.4",
3837
"react-router-dom": "^6.23.0",
3938
"react-select": "^5.8.0",
40-
"react": "^18.2.0",
39+
"react-to-print": "^2.15.1",
4140
"tailwind-merge": "^2.3.0",
4241
"tailwindcss-animate": "^1.0.7",
4342
"yup": "^1.4.0"
4443
},
4544
"devDependencies": {
45+
"@types/crypto-js": "^4.2.2",
4646
"@types/node": "^20.12.8",
4747
"@types/qs": "^6.9.15",
48-
<<<<<<< HEAD
49-
=======
5048
"@types/react": "^18.2.66",
51-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
5249
"@types/react-dom": "^18.2.22",
5350
"@types/react-input-mask": "^3.0.5",
54-
"@types/react": "^18.2.66",
5551
"@typescript-eslint/eslint-plugin": "^7.2.0",
5652
"@typescript-eslint/parser": "^7.2.0",
5753
"@vitejs/plugin-react": "^4.2.1",
5854
"autoprefixer": "^10.4.19",
55+
"eslint": "^8.57.0",
5956
"eslint-plugin-react-hooks": "^4.6.0",
6057
"eslint-plugin-react-refresh": "^0.4.6",
61-
"eslint": "^8.57.0",
58+
"javascript-obfuscator": "^4.1.0",
6259
"postcss": "^8.4.38",
6360
"tailwindcss": "^3.4.3",
6461
"typescript": "^5.2.2",
6562
"vite": "^5.2.0"
6663
}
67-
}
64+
}
Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
1-
<<<<<<< HEAD
21
import { Fragment } from 'react';
32

43
import { IAuthenticatedProps } from './types';
54
import { useAuthRoles } from '@/hooks';
65

7-
const Authenticated = ({ children, role = 'User' }: IAuthenticatedProps) => {
6+
const Authenticated = ({
7+
children,
8+
bypass = false,
9+
role = 'User',
10+
}: IAuthenticatedProps) => {
811
const isAuthenticated = useAuthRoles(role);
912

10-
if (!isAuthenticated) return <Fragment />;
11-
=======
12-
import { Fragment, useContext } from 'react';
13-
14-
import { SessionContext } from '@/contexts';
15-
import { IAuthenticatedProps } from './types';
16-
import { AccessLevel } from '@/service/sessions/types';
17-
18-
const MappedRoles: Record<AccessLevel, AccessLevel[]> = {
19-
Admin: ['Admin'],
20-
DistributionCenter: ['Admin', 'DistributionCenter'],
21-
Staff: ['Admin', 'Staff'],
22-
User: ['Admin', 'Staff', 'DistributionCenter', 'User'],
23-
};
24-
25-
const Authenticated = ({ children, role = 'User' }: IAuthenticatedProps) => {
26-
const { session } = useContext(SessionContext);
27-
28-
if (!session || !MappedRoles[role].includes(session.accessLevel))
29-
return <Fragment />;
30-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
13+
if (!bypass && !isAuthenticated) return <Fragment />;
3114

3215
return <div className="contents">{children}</div>;
3316
};
3417

35-
export { Authenticated };
18+
export { Authenticated };

src/components/CardAboutShelter/components/InfoRow/InfoRow.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { IInfoRowProps } from './types';
44

55
const InfoRow = React.forwardRef<HTMLDivElement, IInfoRowProps>(
66
(props, ref) => {
7-
<<<<<<< HEAD
87
const {
98
icon,
109
label,
@@ -13,20 +12,12 @@ const InfoRow = React.forwardRef<HTMLDivElement, IInfoRowProps>(
1312
className = '',
1413
...rest
1514
} = props;
16-
=======
17-
const { icon, label, value, clipboardButton = false, className = '', ...rest } = props;
18-
>>>>>>> 4e0d9c0 (Release 0.0.1 (#135))
1915
const isLink = value?.startsWith('http');
2016
const ValueComp = !value ? (
2117
<Fragment />
2218
) : isLink ? (
23-
<<<<<<< HEAD
2419
<a
2520
href={value}
26-
target="_blank"
27-
=======
28-
<a href={value} target='_blank'
29-
>>>>>>> 4e0d9c0 (Release 0.0.1 (#135))
3021
className="text-blue-500 break-all cursor-pointer hover:underline"
3122
>
3223
{value}
@@ -63,14 +54,10 @@ const InfoRow = React.forwardRef<HTMLDivElement, IInfoRowProps>(
6354
</div>
6455
)}
6556
</span>
66-
<<<<<<< HEAD
67-
=======
68-
69-
>>>>>>> 4e0d9c0 (Release 0.0.1 (#135))
7057
</div>
7158
</div>
7259
);
7360
}
7461
);
7562

76-
export { InfoRow };
63+
export { InfoRow };

src/components/SearchInput/SearchInput.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,26 @@ import { cn } from '@/lib/utils';
77

88
const SearchInput = React.forwardRef<HTMLDivElement, ISearchInputProps>(
99
(props, ref) => {
10-
<<<<<<< HEAD
10+
const { inputProps, value, onChange, className, ...rest } = props;
1111
const {
12-
value,
13-
onChange,
14-
className,
1512
placeholder = 'Buscar por abrigo ou endereço',
16-
...rest
17-
} = props;
18-
=======
19-
const { value, onChange, className, ...rest } = props;
20-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
13+
className: inputClassName = '',
14+
...restInputProps
15+
} = inputProps ?? {};
2116

2217
return (
2318
<div ref={ref} className={cn(className, 'relative')} {...rest}>
2419
<Input
2520
value={value}
26-
<<<<<<< HEAD
2721
placeholder={placeholder}
28-
=======
29-
placeholder="Buscar por abrigo ou endereço"
30-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
31-
className="h-12 text-md font-medium text-zinc-600 pl-10 pr-4"
32-
onChange={onChange}
22+
className={cn(
23+
'h-12 text-md font-medium text-zinc-600 pl-10 pr-4',
24+
inputClassName
25+
)}
26+
onChange={(ev) =>
27+
onChange ? onChange(ev.target.value ?? '') : undefined
28+
}
29+
{...restInputProps}
3330
/>
3431
<div className="absolute inset-y-0 left-0 flex items-center pl-3">
3532
<Search name="search" size="20" className="stroke-zinc-300" />
@@ -39,4 +36,4 @@ const SearchInput = React.forwardRef<HTMLDivElement, ISearchInputProps>(
3936
}
4037
);
4138

42-
export { SearchInput };
39+
export { SearchInput };

src/components/index.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ import { SearchInput } from './SearchInput';
1313
import { VerifiedBadge } from './VerifiedBadge';
1414
import { SelectField } from './SelectField';
1515
import { Authenticated } from './Authenticated';
16-
<<<<<<< HEAD
1716
import { BurgerMenu } from './BurgerMenu';
18-
=======
19-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
17+
import { BackToTop } from './BackToTop';
18+
import { DonationCartIcon } from './DonationCartIcon';
19+
import { DonationCart } from './DonationCart';
20+
import { Loader } from './Loader';
2021

2122
export {
2223
LoadingScreen,
@@ -34,8 +35,9 @@ export {
3435
SearchInput,
3536
SelectField,
3637
Authenticated,
37-
<<<<<<< HEAD
3838
BurgerMenu,
39-
=======
40-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
41-
};
39+
BackToTop,
40+
DonationCartIcon,
41+
DonationCart,
42+
Loader,
43+
};

src/hooks/useFetch/useFetch.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@ import { api } from '@/api';
55
import { IServerResponse } from '@/types';
66
import { IUseFetchOptions } from './types';
77

8-
<<<<<<< HEAD
98
function useFetch<T = any>(path?: string, options: IUseFetchOptions<T> = {}) {
10-
=======
11-
function useFetch<T = any>(path: string, options: IUseFetchOptions<T> = {}) {
12-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
139
const { cache, initialValue } = options;
1410
const [loading, setLoading] = useState<boolean>(true);
1511
const [data, setData] = useState<T>(initialValue || ({} as T));
1612

1713
const refresh = useCallback(
1814
(config?: AxiosRequestConfig<any>) => {
1915
const headers = config?.headers ?? {};
20-
if (cache) headers['x-app-cache'] = 'true';
16+
if (cache && import.meta.env.VITE_REQUEST_CACHE !== 'false')
17+
headers['x-app-cache'] = 'true';
2118
setLoading(true);
22-
<<<<<<< HEAD
2319

2420
if (path) {
2521
api
@@ -29,12 +25,6 @@ function useFetch<T = any>(path: string, options: IUseFetchOptions<T> = {}) {
2925
} else {
3026
setLoading(false);
3127
}
32-
=======
33-
api
34-
.get<IServerResponse<T>>(path, { ...config, headers })
35-
.then(({ data }) => setData(data.data))
36-
.finally(() => setLoading(false));
37-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
3828
},
3929
[cache, path]
4030
);
@@ -46,4 +36,4 @@ function useFetch<T = any>(path: string, options: IUseFetchOptions<T> = {}) {
4636
return { data, loading, refresh };
4737
}
4838

49-
export { useFetch };
39+
export { useFetch }

src/hooks/useSupplies/useSupplies.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ import { PaginatedQueryPath } from '../usePaginatedQuery/paths';
33
import { IUseSuppliesData } from './types';
44

55
const useSupplies = () => {
6-
<<<<<<< HEAD
76
return useFetch<IUseSuppliesData[]>(PaginatedQueryPath.Supplies, {
8-
=======
9-
return useFetch<ISupply[]>(PaginatedQueryPath.Supplies, {
10-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
117
initialValue: [],
128
cache: true,
139
});
1410
};
1511

16-
export { useSupplies };
12+
export { useSupplies };

src/pages/CreateShelter/CreateShelter.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ import { toast } from '@/components/ui/use-toast';
2020
import { ShelterServices } from '@/service';
2121
import { withAuth } from '@/hocs';
2222
import { clearCache } from '@/api/cache';
23-
<<<<<<< HEAD
2423
import { hardCodedRsCities } from './hardcodedCities';
2524
import { useDebouncedValue, useViaCep } from '@/hooks';
2625
import { cn } from '@/lib/utils';
2726
import { checkAndFormatAddress } from '@/components/CardAboutShelter';
28-
import { IUseShelterData } from '@/hooks/useShelter/types';
29-
=======
30-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
3127

3228
const CreateShelterComponent = () => {
3329
const navigate = useNavigate();
@@ -79,12 +75,14 @@ const CreateShelterComponent = () => {
7975
}),
8076
onSubmit: async (values, { resetForm }) => {
8177
try {
82-
<<<<<<< HEAD
83-
const address = checkAndFormatAddress(values as IUseShelterData);
78+
const address = checkAndFormatAddress({
79+
address: values.address,
80+
city: values.city,
81+
neighbourhood: values.neighbourhood,
82+
street: values.street,
83+
streetNumber: values.streetNumber,
84+
});
8485
await ShelterServices.create({ ...values, address });
85-
=======
86-
await ShelterServices.create(values);
87-
>>>>>>> 3d3f437 (merge: develop -> master (#91))
8886
clearCache(false);
8987
toast({
9088
title: 'Cadastro feita com sucesso',
@@ -257,4 +255,4 @@ const CreateShelterComponent = () => {
257255

258256
const CreateShelter = withAuth(CreateShelterComponent);
259257

260-
export { CreateShelter };
258+
export { CreateShelter };

0 commit comments

Comments
 (0)