Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project/subscription and historical alerts #163

Merged
merged 35 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ba28d86
Add login page
roshni73 Oct 18, 2024
4f99961
Add Forget password page
roshni73 Nov 11, 2024
427ee3a
Add my subscription page
barshathakuri Oct 23, 2024
a404b50
Add resource page
roshni73 Oct 29, 2024
7306393
Add Validation Email page
roshni73 Nov 12, 2024
86369d1
Add Cookie Policy Page
roshni73 Nov 13, 2024
a0dbb26
Add historical alerts table
barshathakuri Nov 7, 2024
d251c31
Login integration
barshathakuri Nov 20, 2024
d08c2af
Add subscription alert detail page
barshathakuri Nov 14, 2024
396f9e1
Add register page
AdityaKhatri Nov 12, 2024
0512287
Add mutation for register
roshni73 Nov 20, 2024
f538441
Subscription Integration
barshathakuri Nov 21, 2024
af4f069
RecoverAccount Integration
roshni73 Nov 21, 2024
baba908
Add RecoverAccountComfirm page
roshni73 Nov 12, 2024
2d97886
Add mutation for recover account confrom page
roshni73 Nov 22, 2024
c5354c5
Subscription page integration
barshathakuri Nov 22, 2024
714552b
Add activation redirect
roshni73 Nov 25, 2024
a7c2db9
Fix issue with typings
tnagorra Nov 28, 2024
4491d79
Add HCAPTCHA configs to docker-compose
thenav56 Dec 3, 2024
eee48e0
Add cards for subscription and use api
roshni73 Nov 29, 2024
f9b12d5
Fix Historical alert filter ,table filter
roshni73 Dec 3, 2024
626aaf5
feat: use hcaptcha environment variable during build
roshni73 Nov 29, 2024
c97eb36
Fix subscriptions bugs
barshathakuri Dec 3, 2024
7cfdddd
Merge pull request #181 from IFRCGo/fix/subscription-modal
roshni73 Dec 4, 2024
9bb3e12
Merge pull request #179 from IFRCGo/project/hcaptcha
barshathakuri Dec 4, 2024
edbca20
Add env to docker compose file
barshathakuri Aug 1, 2024
4eb0c96
Merge pull request #182 from IFRCGo/feat/update-docker-compose
barshathakuri Dec 5, 2024
02ecb40
fix register link
roshni73 Dec 4, 2024
86b45b9
Fix subscription styling
barshathakuri Dec 5, 2024
8f03ef6
Copy patches folder in Dockerfile
barshathakuri Dec 6, 2024
6aad3dd
Fix subscription styling
barshathakuri Dec 6, 2024
6f08d0e
Merge pull request #188 from IFRCGo/fix/subscription-detail
roshni73 Dec 6, 2024
7166d54
Error message fixes
barshathakuri Dec 6, 2024
a8234bf
Fix subscription limit
barshathakuri Dec 6, 2024
d3864a3
Merge pull request #190 from IFRCGo/fix/subscription-limit
roshni73 Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .unimportedrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ignoreUnimported": ["**/*.d.ts", "**/*.test.*", "**/generated/**"],
"ignoreUnused": [
"@apollo/client",
"@types/geojson",
"@graphql-codegen/introspection",
"@graphql-codegen/typescript-operations",
"patch-package",
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
FROM dev AS builder

COPY ./package.json ./pnpm-lock.yaml /code/
COPY ./patches /code/patches/

# TODO: patches are not working with this?
RUN pnpm install
Expand All @@ -30,9 +31,10 @@
# Dynamic configs. Can be changed with containers. (Placeholder values)
ENV APP_TITLE=APP_TITLE_PLACEHOLDER
ENV APP_ENVIRONMENT=APP_ENVIRONMENT_PLACEHOLDER
ENV APP_MAPBOX_ACCESS_TOKEN=APP_MAPBOX_ACCESS_TOKEN_PLACEHOLDER

Check warning on line 34 in Dockerfile

View workflow job for this annotation

GitHub Actions / Publish Docker Image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "APP_MAPBOX_ACCESS_TOKEN") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV APP_GOOGLE_ANALYTICS_ID=APP_GOOGLE_ANALYTICS_ID_PLACEHOLDER
ENV APP_GRAPHQL_API_ENDPOINT=https://APP-GRAPHQL-API-ENDPOINT-PLACEHOLDER.COM/
ENV APP_HCAPTCHA_SITEKEY=APP_HCAPTCHA_SITEKEY_PLACEHOLDER

# Build variables (Requires backend pulled)
ENV APP_GRAPHQL_CODEGEN_ENDPOINT=./backend/schema.graphql
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@ docker-compose up
└── index.tsx (Defines root layout and requests fetched for DomainContext)
```

## IFRC Alert Hub backend
The backend that serves the frontend application is maintained in a separate [repository](https://github.com/IFRCGo/alert-hub-backend).

## External facing API
Here is the documentation for [Alert Hub GraphQL Client Usage Guide](./APIDOCS.md)
2 changes: 1 addition & 1 deletion backend
Submodule backend updated 139 files
5 changes: 5 additions & 0 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ x-server: &base_server_setup
# Static, Media configs
DJANGO_STATIC_URL: ${DJANGO_STATIC_URL:-/dj-static/}
DJANGO_MEDIA_URL: ${DJANGO_MEDIA_URL-/dj-media/}
# Misc
HCAPTCHA_SECRET: ${HCAPTCHA_SECRET?error}
HCAPTCHA_SITEKEY: ${HCAPTCHA_SITEKEY?error}
volumes:
- ./geographical_data/:/code/apps/cap_feed/geographical/ifrc-go-admin1-geojson/
- backend_data:/data/
Expand Down Expand Up @@ -98,6 +101,8 @@ services:
APP_GRAPHQL_API_ENDPOINT: ${FRONTEND_APP_GRAPHQL_API_ENDPOINT?error}
APP_MAPBOX_ACCESS_TOKEN: ${FRONTEND_APP_MAPBOX_ACCESS_TOKEN?error}
APP_GRAPHQL_CODEGEN_ENDPOINT: ${FRONTEND_APP_GRAPHQL_CODEGEN_ENDPOINT?error}
env_file:
- .env
command: |
sh -c 'pnpm generate && pnpm build && rm -rf /client-build/* ; cp -r build/* /client-build/'
volumes:
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ x-server: &base_server_setup
# Redis config
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
CACHE_REDIS_URL: ${CACHE_REDIS_URL:-redis://redis:6379/1}
TEST_CACHE_REDIS_URL: ${TEST_CACHE_REDIS_URL:-redis://redis:6379/11}
# Email config
EMAIL_HOST: ${EMAIL_HOST:-mailpit}
EMAIL_PORT: ${EMAIL_PORT:-1025}
EMAIL_HOST_USER: ${EMAIL_HOST_USER:-mailpit}
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD:-mailpit}
DEFAULT_FROM_EMAIL: ${DEFAULT_FROM_EMAIL:-alert-hub-dev <[email protected]>}
# Misc
HCAPTCHA_SECRET: ${HCAPTCHA_SECRET:-0x0000000000000000000000000000000000000000}
HCAPTCHA_SITEKEY: ${HCAPTCHA_SITEKEY:-10000000-ffff-ffff-ffff-000000000001}
volumes:
- ./backend/:/code
- backend_data:/data/
Expand Down
3 changes: 2 additions & 1 deletion env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig, Schema } from '@julr/vite-plugin-validate-env';

// TODO: Integrate .env for CI and remove optional() call on required fields
export default defineConfig({
// Used in vite
APP_GOOGLE_ANALYTICS_ID: Schema.string.optional(),
Expand All @@ -23,6 +22,8 @@ export default defineConfig({
APP_GRAPHQL_API_ENDPOINT: Schema.string({ format: 'url', protocol: true, tld: false }),
APP_MAPBOX_ACCESS_TOKEN: Schema.string(),

APP_HCAPTCHA_SITEKEY: Schema.string.optional(),

// Used in codegen
APP_GRAPHQL_CODEGEN_ENDPOINT: Schema.string(), // NOTE: this is both url and file path

Expand Down
2 changes: 2 additions & 0 deletions nginx-serve/apply-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ find "$DESTINATION_DIRECTORY" -type f -exec sed -i "s|\<APP_ENVIRONMENT_PLACEHOL
find "$DESTINATION_DIRECTORY" -type f -exec sed -i "s|\<APP_MAPBOX_ACCESS_TOKEN_PLACEHOLDER\>|$APP_MAPBOX_ACCESS_TOKEN|g" {} +
find "$DESTINATION_DIRECTORY" -type f -exec sed -i "s|\<APP_GOOGLE_ANALYTICS_ID_PLACEHOLDER\>|$APP_GOOGLE_ANALYTICS_ID|g" {} +
find "$DESTINATION_DIRECTORY" -type f -exec sed -i "s|\<https://APP-GRAPHQL-API-ENDPOINT-PLACEHOLDER.COM/|$APP_GRAPHQL_API_ENDPOINT|g" {} +
find "$DESTINATION_DIRECTORY" -type f -exec sed -i "s|\<APP_HCAPTCHA_SITEKEY_PLACEHOLDER|$APP_HCAPTCHA_SITEKEY|g" {} +


# Show diffs (Useful to debug issues)
set +xe
Expand Down
1 change: 1 addition & 0 deletions nginx-serve/helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ data:
APP_MAPBOX_ACCESS_TOKEN: {{ required "env.APP_MAPBOX_ACCESS_TOKEN" .Values.env.APP_MAPBOX_ACCESS_TOKEN | quote }}
APP_GOOGLE_ANALYTICS_ID: {{ .Values.env.APP_GOOGLE_ANALYTICS_ID | quote }}
APP_GRAPHQL_API_ENDPOINT: {{ required "env.APP_GRAPHQL_API_ENDPOINT" .Values.env.APP_GRAPHQL_API_ENDPOINT | quote }}
APP_HCAPTCHA_SITEKEY: {{ required "env.APP_HCAPTCHA_SITEKEY" .Values.env.APP_HCAPTCHA_SITEKEY | quote }}
4 changes: 2 additions & 2 deletions nginx-serve/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ spec:
replicas: 1
selector:
matchLabels:
app: {{ template "ifrcgo-web-app.name" . }}
app: {{ template "ifrcgo-web-app.fullname" . }}
release: {{ .Release.Name }}
run: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "ifrcgo-web-app.name" . }}
app: {{ template "ifrcgo-web-app.fullname" . }}
release: {{ .Release.Name }}
run: {{ .Release.Name }}
spec:
Expand Down
4 changes: 2 additions & 2 deletions nginx-serve/helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ kind: Service
metadata:
name: {{ template "ifrcgo-web-app.fullname" . }}-svc
labels:
app: {{ template "ifrcgo-web-app.name" . }}
app: {{ template "ifrcgo-web-app.fullname" . }}
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
spec:
type: ClusterIP
selector:
app: {{ template "ifrcgo-web-app.name" . }}
app: {{ template "ifrcgo-web-app.fullname" . }}
release: {{ .Release.Name }}
run: {{ .Release.Name }}
ports:
Expand Down
1 change: 1 addition & 0 deletions nginx-serve/helm/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ env:
APP_ENVIRONMENT: ALPHA-1
APP_MAPBOX_ACCESS_TOKEN: pk.ab.xy
APP_GRAPHQL_API_ENDPOINT: https://alert-hub-1.ifrc-go.org/graphql/
APP_HCAPTCHA_SITEKEY:
1 change: 1 addition & 0 deletions nginx-serve/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ env:
APP_MAPBOX_ACCESS_TOKEN:
APP_GOOGLE_ANALYTICS_ID:
APP_GRAPHQL_API_ENDPOINT: https://alerthub-api.ifrc.org/graphql/
APP_HCAPTCHA_SITEKEY:
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,19 @@
},
"dependencies": {
"@apollo/client": "^3.9.9",
"@graphql-codegen/introspection": "^4.0.3",
"@graphql-codegen/typescript-operations": "^4.2.0",
"@hcaptcha/react-hcaptcha": "^1.11.0",
"@ifrc-go/icons": "^1.3.3",
"@ifrc-go/ui": "^1.1.2",
"@ifrc-go/ui": "^1.2.1",
"@mapbox/mapbox-gl-draw": "^1.4.3",
"@placemarkio/geo-viewport": "^1.0.2",
"@sentry/react": "^7.81.1",
"@togglecorp/fujs": "^2.1.1",
"@togglecorp/re-map": "^0.2.0-beta-6",
"@togglecorp/toggle-form": "^2.0.4",
"@turf/bbox": "^7.1.0",
"@turf/circle": "^7.1.0",
"graphql": "^16.8.1",
"mapbox-gl": "^1.13.0",
"patch-package": "^8.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3"
Expand All @@ -42,6 +41,8 @@
"@eslint/eslintrc": "^3.0.2",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^4.2.5",
"@graphql-codegen/introspection": "^4.0.3",
"@graphql-codegen/typescript-operations": "^4.2.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@julr/vite-plugin-validate-env": "^1.0.1",
"@parcel/watcher": "^2.4.1",
Expand Down Expand Up @@ -69,6 +70,7 @@
"eslint-plugin-simple-import-sort": "^12.0.0",
"fast-glob": "^3.3.0",
"happy-dom": "^14.3.8",
"patch-package": "^8.0.0",
"postcss": "^8.4.38",
"postcss-nested": "^6.0.1",
"postcss-normalize": "^10.0.1",
Expand All @@ -92,5 +94,10 @@
"vite-tsconfig-paths": "^4.2.2",
"vitest": "^1.1.0"
},
"packageManager": "[email protected]+sha1.71f9126a20cd3d00fa47c188f956918858180e54"
"packageManager": "[email protected]+sha1.71f9126a20cd3d00fa47c188f956918858180e54",
"pnpm": {
"patchedDependencies": {
"@ifrc-go/[email protected]": "patches/@[email protected]"
}
}
}
47 changes: 47 additions & 0 deletions patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/dist/components/Chip/index.d.ts b/dist/components/Chip/index.d.ts
index 7345249eaad9a8fb959fe0330639292354032909..ceba3ed438c7fa0b687d07f7591bab624aff06bc 100644
--- a/dist/components/Chip/index.d.ts
+++ b/dist/components/Chip/index.d.ts
@@ -2,7 +2,7 @@ export type ChipVariant = 'primary' | 'secondary' | 'tertiary';
export interface Props<N> {
className?: string;
name: N;
- label: string;
+ label: React.ReactNode;
variant?: ChipVariant;
onDelete?: (name: N, e: React.MouseEvent<HTMLButtonElement>) => void;
}
diff --git a/package.json b/package.json
index 999e201527e87de45a377344ca40f13212549f61..8ce9c9c085e950405fb0d0f888d5c57876b5e080 100644
--- a/package.json
+++ b/package.json
@@ -97,5 +97,10 @@
"vite-plugin-lib-inject-css": "^1.3.0",
"vite-tsconfig-paths": "^4.2.3",
"vitest": "^1.1.1"
+ },
+ "pnpm": {
+ "patchedDependencies": {
+ "@ifrc-go/[email protected]": "patches/@[email protected]"
+ }
}
}
diff --git a/patches/@[email protected] b/patches/@[email protected]
new file mode 100644
index 0000000000000000000000000000000000000000..31603365255a6e1aa30c140c96b27fa3e93cd7fa
--- /dev/null
+++ b/patches/@[email protected]
@@ -0,0 +1,13 @@
+diff --git a/dist/components/Chip/index.d.ts b/dist/components/Chip/index.d.ts
+index 7345249eaad9a8fb959fe0330639292354032909..ceba3ed438c7fa0b687d07f7591bab624aff06bc 100644
+--- a/dist/components/Chip/index.d.ts
++++ b/dist/components/Chip/index.d.ts
+@@ -2,7 +2,7 @@ export type ChipVariant = 'primary' | 'secondary' | 'tertiary';
+ export interface Props<N> {
+ className?: string;
+ name: N;
+- label: string;
++ label: React.ReactNode;
+ variant?: ChipVariant;
+ onDelete?: (name: N, e: React.MouseEvent<HTMLButtonElement>) => void;
+ }
Loading
Loading