Skip to content

Commit

Permalink
Add tabs and refactor alert table component
Browse files Browse the repository at this point in the history
  • Loading branch information
puranban committed Apr 11, 2024
1 parent de06f31 commit 2f2ec4d
Show file tree
Hide file tree
Showing 11 changed files with 1,155 additions and 1,629 deletions.
167 changes: 83 additions & 84 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,85 @@
{
"name": "alert-hub",
"version": "0.0.0",
"type": "module",
"private": true,
"scripts": {
"start": "vite",
"build": "vite build",
"generate": "graphql-codegen --config codegen.yml && eslint --fix generated/types.ts",
"lint:js": "eslint src",
"lint:css": "stylelint \"./src/**/*.css\"",
"lint:unused": "unimported",
"lint": "yarn lint:js && yarn lint:css && yarn lint:unused",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc"
},
"dependencies": {
"@apollo/client": "^3.9.9",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/introspection": "^4.0.3",
"@graphql-codegen/typescript": "^4.0.6",
"@graphql-codegen/typescript-operations": "^4.2.0",
"@ifrc-go/icons": "^1.3.3",
"@ifrc-go/ui": "^1.0.0",
"@sentry/react": "^7.81.1",
"@togglecorp/fujs": "^2.1.1",
"@togglecorp/re-map": "^0.2.0-beta-6",
"@togglecorp/toggle-form": "^2.0.4",
"graphql": "^16.8.1",
"mapbox-gl": "^1.13.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3"
},
"devDependencies": {
"@eslint/eslintrc": "^2.0.3",
"@julr/vite-plugin-validate-env": "^1.0.1",
"@types/mapbox-gl": "^1.13.0",
"@types/node": "^20.1.3",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.2.22",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.14",
"cross-var": "^1.1.0",
"dotenv-cli": "^7.2.1",
"eslint": "^8.40.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import-exports-imports-resolver": "^1.0.1",
"eslint-plugin-import-newlines": "^1.3.4",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"eslint-plugin-simple-import-sort": "^10.0.0",
"fast-glob": "^3.3.0",
"happy-dom": "^9.18.3",
"postcss": "^8.3.0",
"postcss-nested": "^6.0.1",
"postcss-normalize": "^10.0.1",
"postcss-preset-env": "^8.3.2",
"postinstall-postinstall": "^2.1.0",
"rollup-plugin-visualizer": "^5.9.0",
"stylelint": "^15.6.1",
"stylelint-config-concentric": "^2.0.2",
"stylelint-config-recommended": "^12.0.0",
"stylelint-no-unused-selectors": "git+https://github.com/toggle-corp/stylelint-no-unused-selectors#e0831e1",
"stylelint-value-no-unknown-custom-properties": "^4.0.0",
"surge": "^0.23.1",
"typescript": "^5.0.4",
"unimported": "1.28.0",
"vite": "^5.0.10",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-compression2": "^0.11.0",
"vite-plugin-radar": "^0.9.2",
"vite-plugin-svgr": "^4.2.0",
"vite-plugin-webfont-dl": "^3.9.1",
"vite-tsconfig-paths": "^4.2.2",
"vitest": "^1.1.0"
}
"name": "ifrc-alert-hub",
"version": "0.0.0",
"type": "module",
"private": true,
"scripts": {
"start": "vite",
"build": "vite build",
"generate": "graphql-codegen --config codegen.yml && eslint --fix generated/types.ts",
"lint:js": "eslint src",
"lint:css": "stylelint \"./src/**/*.css\"",
"lint:unused": "unimported",
"lint": "yarn lint:js && yarn lint:css && yarn lint:unused",
"lint:fix": "yarn lint:js --fix && yarn lint:css --fix",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc"
},
"dependencies": {
"@apollo/client": "^3.9.9",
"@graphql-codegen/introspection": "^4.0.3",
"@graphql-codegen/typescript-operations": "^4.2.0",
"@ifrc-go/icons": "^1.3.3",
"@ifrc-go/ui": "^1.0.0",
"@mapbox/mapbox-gl-draw": "^1.4.3",
"@sentry/react": "^7.81.1",
"@togglecorp/fujs": "^2.1.1",
"@togglecorp/re-map": "^0.2.0-beta-6",
"graphql": "^16.8.1",
"mapbox-gl": "^1.13.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3"
},
"devDependencies": {
"@eslint/eslintrc": "^3.0.2",
"@julr/vite-plugin-validate-env": "^1.0.1",
"@types/mapbox-gl": "^1.13.0",
"@types/node": "^20.1.3",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.2.22",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.19",
"cross-var": "^1.1.0",
"dotenv-cli": "^7.2.1",
"eslint": "^8.40.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import-exports-imports-resolver": "^1.0.1",
"eslint-plugin-import-newlines": "^1.3.4",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"eslint-plugin-simple-import-sort": "^12.0.0",
"fast-glob": "^3.3.0",
"happy-dom": "^14.3.8",
"postcss": "^8.4.38",
"postcss-nested": "^6.0.1",
"postcss-normalize": "^10.0.1",
"postcss-preset-env": "^9.5.2",
"postinstall-postinstall": "^2.1.0",
"rollup-plugin-visualizer": "^5.9.0",
"stylelint": "^15.11.0",
"stylelint-config-concentric-order": "^5.2.0",
"stylelint-config-recommended": "^14.0.0",
"stylelint-no-unused-selectors": "git+https://github.com/toggle-corp/stylelint-no-unused-selectors#e0831e1",
"stylelint-value-no-unknown-custom-properties": "^5.0.0",
"surge": "^0.23.1",
"typescript": "^5.4.3",
"unimported": "1.31.1",
"vite": "^5.2.6",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-compression2": "^1.0.0",
"vite-plugin-radar": "^0.9.2",
"vite-plugin-svgr": "^4.2.0",
"vite-plugin-webfont-dl": "^3.9.1",
"vite-tsconfig-paths": "^4.2.2",
"vitest": "^1.1.0"
}
}
3 changes: 2 additions & 1 deletion src/hooks/useFilterState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import {
} from 'react';
import { hasSomeDefinedValue } from '@ifrc-go/ui/utils';
import { isNotDefined } from '@togglecorp/fujs';
import { EntriesAsList } from '@togglecorp/toggle-form';

import useDebouncedValue from '#hooks/useDebouncedValue';

import { EntriesAsList } from '../types';

type SortDirection = 'asc' | 'dsc';
interface SortParameter {
name: string;
Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type SetValueArg<T> = T | ((value: T | undefined) => T);

export type EntriesAsList<T> = {
[K in keyof T]-?: [SetValueArg<T[K]>, K, ...unknown[]];
}[keyof T];
20 changes: 0 additions & 20 deletions src/utils/domain/CountryLink/index.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/utils/domain/RegionLink/index.tsx

This file was deleted.

11 changes: 9 additions & 2 deletions src/utils/domain/tableHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ import {
TableActionsProps,
} from '@ifrc-go/ui';

import type { Props as CountryLinkProps } from './CountryLink';
import type { Props as RegionLinkProps } from './RegionLink';
// FIXME: remove after completion of table
type CountryLinkProps = {
name: string;
};

// FIXME: remove after completion of table
type RegionLinkProps = {
name: string;
};

type Options<D, K, CompProps, HeaderProps> = {
sortable?: boolean,
Expand Down
16 changes: 8 additions & 8 deletions src/views/AlertTable/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"namespace": "allOngoingAlerts",
"strings": {
"allOngoingAlertTitle":"All Alerts ",
"alertTableEvent":"Event" ,
"alertTableCategory":"Event Categories",
"alertTableRegion":"Region",
"alertTablecounteries":"Country",
"alertTableviewDetailsTitle":"View Details",
"alertTableAdmins":"Admin1s",
"alertTableSent":"Sent"
"alertTableEventTitle":"Event" ,
"alertTableCategoryTitle":"Event Categories",
"alertTableRegionTitle":"Region",
"alertTableCountryTitle":"Country",
"alertTableViewDetailsTitle":"View Details",
"alertTableAdminsTitle":"Admin1s",
"alertTableSentLabel":"Sent"
}
}
}
Loading

0 comments on commit 2f2ec4d

Please sign in to comment.