Skip to content

Commit

Permalink
[Tech] Ajout de smallchat (#3045)
Browse files Browse the repository at this point in the history
## Linked issues

- Ajout de smallchat en dur

----

- [ ] Tests E2E (Cypress)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Chores**
- Removed configuration for chat feature flags from environment example
files.
- **Refactor**
	- Updated comments related to chat feature in test support files.
- Made chat feature available unconditionally by adjusting its
integration in the app.
- **Documentation**
- Updated environment interface documentation by removing the chat
feature flag declaration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
louptheron authored Mar 27, 2024
2 parents bcd9c8e + d0f7a8e commit 53a81d1
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 29 deletions.
5 changes: 0 additions & 5 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
################################################################################
# Chat

FRONTEND_SMALL_CHAT_SNIPPET=

################################################################################
# Feature flags

Expand Down
7 changes: 0 additions & 7 deletions frontend/.env.local.defaults
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
################################################################################
# Chat

# We need to use a VITE_ env var to replace the HTML index file
# see: https://vitejs.dev/guide/env-and-mode.html#html-env-replacement
FRONTEND_SMALL_CHAT_SNIPPET=

################################################################################
# Feature flags

Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ beforeEach(() => {
}
)

// PROD :: FRONTEND_SMALL_CHAT_SNIPPET
// PROD :: SMALL CHAT
cy.intercept(
{ url: /^https:\/\/embed\.small\.chat\/.*/ },
{
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ export function App({ auth }: AppProps) {
</FrontendErrorBoundary>
</RsuiteCustomProvider>
{/* This script is used to inject the chat */}
{import.meta.env.FRONTEND_SMALL_CHAT_SNIPPET && (
<script async src={import.meta.env.FRONTEND_SMALL_CHAT_SNIPPET} />
)}
<script async src="https://embed.small.chat/T0176BBUCEQC01SV3W4464.js" />
</ThemeProvider>
)
}
1 change: 0 additions & 1 deletion frontend/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface ImportMetaEnv {
readonly FRONTEND_OIDC_REDIRECT_URI: string
readonly FRONTEND_SENTRY_DSN?: string
readonly FRONTEND_SHOM_KEY: string
readonly FRONTEND_SMALL_CHAT_SNIPPET: string
}

interface ImportMeta {
Expand Down
1 change: 0 additions & 1 deletion infra/docker/docker-compose.cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ services:
- FRONTEND_SHOM_KEY=rg8ele7cft4ujkwjspsmtwas
- FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=true # Even if we inject this env var, the value is not used (see cypress.config.ts)
- FRONTEND_MISSION_FORM_AUTO_UPDATE_ENABLED=true
- FRONTEND_SMALL_CHAT_SNIPPET=
ports:
- 8880:8880
- 8000:8000
Expand Down
1 change: 0 additions & 1 deletion infra/docker/docker-compose.puppeteer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ services:
- FRONTEND_SHOM_KEY=rg8ele7cft4ujkwjspsmtwas
- FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=true
- FRONTEND_MISSION_FORM_AUTO_UPDATE_ENABLED=true
- FRONTEND_SMALL_CHAT_SNIPPET=
ports:
- 8880:8880
- 8000:8000
Expand Down
29 changes: 19 additions & 10 deletions infra/remote/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,30 @@ services:
container_name: monitorfish_backend
user: "monitorfish:${MONITORFISH_LOGS_AND_BACKUPS_GID}"
environment:
- ENV_DB_URL=jdbc:postgresql://db:5432/$POSTGRES_DB?user=$POSTGRES_USER&password=$POSTGRES_PASSWORD
- FRONTEND_GEOSERVER_REMOTE_URL=https://monitorfish.din.developpement-durable.gouv.fr
- FRONTEND_GEOSERVER_LOCAL_URL=https://10.56.205.25:8082
- FRONTEND_SENTRY_ENV=${SENTRY_ENV}
- SENTRY_DSN=${SENTRY_DSN}
- FRONTEND_SENTRY_TRACING_ORIGINS=${SENTRY_TRACING_ORIGINS}
- FRONTEND_MONITORFISH_VERSION=${MONITORFISH_VERSION}
- SPRING_PROFILES_ACTIVE=prod
- HOST_IP=127.0.0.1
- FRONTEND_MONITORENV_URL=${MONITORENV_URL}
- MONITORENV_URL=${MONITORENV_URL}
- ENV_DB_URL=jdbc:postgresql://db:5432/$POSTGRES_DB?user=$POSTGRES_USER&password=$POSTGRES_PASSWORD
- FRONTEND_GEOSERVER_REMOTE_URL=$MONITORFISH_GEOSERVER_REMOTE_URL
- FRONTEND_GEOSERVER_LOCAL_URL=$MONITORFISH_GEOSERVER_LOCAL_URL
- FRONTEND_MONITORENV_URL=$MONITORFISH_MONITORENV_PUBLIC_URL
- MONITORENV_URL=$MONITORFISH_MONITORENV_URL
- FRONTEND_MAPBOX_KEY=$MONITORFISH_MAPBOX_KEY
- FRONTEND_SHOM_KEY=$MONITORFISH_SHOM_KEY
- FRONTEND_OIDC_ENABLED=$MONITORFISH_OIDC_ENABLED
- MONITORFISH_OIDC_ENABLED=$MONITORFISH_OIDC_ENABLED
- FRONTEND_OIDC_REDIRECT_URI=$MONITORFISH_OIDC_REDIRECT_URI
- FRONTEND_OIDC_AUTHORITY=$MONITORFISH_OIDC_AUTHORITY
- FRONTEND_OIDC_CLIENT_ID=$MONITORFISH_OIDC_CLIENT
- MONITORFISH_API_PROTECTED_API_KEY=$MONITORFISH_API_PROTECTED_API_KEY
- FRONTEND_SMALL_CHAT_SNIPPET=
- MONITORFISH_API_PROTECTED_PATHS=$MONITORFISH_API_PROTECTED_PATHS
- MONITORFISH_API_PROTECTED_PUBLIC_PATHS=$MONITORFISH_API_PROTECTED_PUBLIC_PATHS
- FRONTEND_SENTRY_ENV=$MONITORFISH_SENTRY_ENV
- SENTRY_DSN=$MONITORFISH_SENTRY_DSN
- FRONTEND_SENTRY_DSN=$MONITORFISH_SENTRY_DSN
- FRONTEND_SENTRY_TRACING_ORIGINS=$MONITORFISH_SENTRY_TRACING_ORIGINS
- FRONTEND_MONITORFISH_VERSION=$MONITORFISH_VERSION
- FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=$MONITORFISH_MISSION_FORM_AUTO_SAVE_ENABLED
- FRONTEND_MISSION_FORM_AUTO_UPDATE_ENABLED=$MONITORFISH_MISSION_FORM_AUTO_UPDATE_ENABLED
ports:
- 8880:8880
- 8000:8000
Expand Down

0 comments on commit 53a81d1

Please sign in to comment.