Skip to content

Commit

Permalink
Merge branch 'master' into feature/fs-isolation
Browse files Browse the repository at this point in the history
  • Loading branch information
niladic committed Feb 10, 2025
2 parents c597369 + 1ecb3b7 commit 3878d23
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 61 deletions.
Empty file added .heroku/ensure-directory
Empty file.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.5"
version = "3.8.6"
runner.dialect = scala3
maxColumn = 100
spaces.afterKeywordBeforeParen = true
Expand Down
58 changes: 14 additions & 44 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,30 @@
{
"name": "aplus",
"stack": "scalingo-20",
"env": {
"STAGING_DATABASE_URL": {
"required": true
},
"APP_DOMAIN": {
"required": true
},
"APP_HTTPS": {
"required": true
"APP_HOST": {
"generator": "template",
"template": "%APP%.osc-fr1.scalingo.io"
},
"APPLICATION_SECRET": {
"required": true
},
"EVOLUTIONS_AUTOAPPLY": {
"required": true
},
"MAIL_HOST": {
"required": true
},
"MAIL_PASSWORD": {
"required": true
},
"MAIL_PORT": {
"required": true
},
"MAIL_USER": {
"required": true
"generator": "secret"
},
"SENTRY_DSN": {
"required": true
},
"AREAS_WITH_LOGIN_BY_KEY": {
"required": true
},
"AREAS_WITH_ATTACHEMENTS": {
"required": true
},
"FILES_PATH": {
"required": true
"IS_REVIEW_APP": {
"value": "true"
}
},
"formation": {
"web": {
"quantity": 1
"amount": 1,
"size": "S"
}
},
"addons": [
"heroku-postgresql"
],
"buildpacks": [
{
"url": "heroku/nodejs"
},
{
"url": "heroku/scala"
"plan": "postgresql:postgresql-sandbox"
}
]
],
"scripts": {
"postdeploy": "bash scripts/copy-scalingo-review-app-db.sh"
}
}
2 changes: 1 addition & 1 deletion app/models/Organisation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ object Organisation {
val msap: Organisation = Organisation("MSAP", "Maison de services au public")
val hopital: Organisation = Organisation("Hôpital", "Hôpital")
val poleEmploiId: Id = Organisation.Id("Pôle emploi")
val poleEmploi: Organisation = Organisation(poleEmploiId, "Pôle emploi", "Pôle emploi")
val poleEmploi: Organisation = Organisation(poleEmploiId, "France Travail", "France Travail")
val prefId: Id = Organisation.Id("Préf")
val pref: Organisation = Organisation(prefId, "Préf", "Préfecture")
val sousPrefId: Id = Organisation.Id("Sous-Préf")
Expand Down
7 changes: 3 additions & 4 deletions app/views/createApplication.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,15 @@ <h5 class="title--addline">

@helper.input(applicationForm("mandatDate"),
"class" -> " single--padding-top-8px") { (id, name, value, args) =>
@defining(if(value.isEmpty) { java.time.ZonedDateTime.now().format(_root_.helper.Time.dateWithHourFormatter) } else { value }) { nonEmptyValue =>
<input class="mdl-textfield__input"
type="text"
name="@name"
id="@id"
value="@value"
value="@nonEmptyValue"
@toHtmlArgs(args)>

<span class="mdl-color-text--grey-600 single--font-size-14px">
ex. : @{java.time.ZonedDateTime.now().format(_root_.helper.Time.dateWithHourFormatter)}
</span>
}
}

</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/welcome.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h4> Bonjour et bienvenue dans la communauté Administration+ </h4>
class="mdl-checkbox__input"
value="true">
<span class="mdl-checkbox__label">
J’accepte de recevoir la newsletter mensuelle d’Administration+ sur l’évolution
J’accepte de recevoir la newsletter d’Administration+ sur l’évolution
de l’outil et de l’élargissement de la communauté.
</span>
</label>
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ libraryDependencies ++= Seq(
"com.github.tototoshi" %% "scala-csv" % "2.0.0",
ws,
"com.lihaoyi" %% "scalatags" % "0.13.1",
"org.typelevel" %% "cats-core" % "2.12.0",
"org.typelevel" %% "cats-core" % "2.13.0",
"org.typelevel" %% "cats-effect" % "3.5.7",
"co.fs2" %% "fs2-core" % fs2Version,
"co.fs2" %% "fs2-io" % fs2Version,
Expand All @@ -107,7 +107,7 @@ libraryDependencies ++= Seq(
)

// Crash
libraryDependencies += "io.sentry" % "sentry-logback" % "7.20.0"
libraryDependencies += "io.sentry" % "sentry-logback" % "7.20.1"

// Sync with Play and scala-steward pin
// https://github.com/playframework/playframework/blob/4c2d76095c2f6a5cab7be3e8f6017c4a4dd2a99f/project/Dependencies.scala#L20
Expand Down
13 changes: 7 additions & 6 deletions conf/evolutions/default/80.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
-- !Ups
--- !Ups

ALTER TABLE user_group ADD is_in_france_services_network BOOLEAN NOT NULL DEFAULT true;
ALTER TABLE application ADD is_in_france_services_network BOOLEAN NOT NULL DEFAULT true;
UPDATE organisation SET short_name = 'France Travail' WHERE id = 'Pôle emploi';
UPDATE organisation SET name = 'France Travail' WHERE id = 'Pôle emploi';


-- !Downs

ALTER TABLE application DROP is_in_france_services_network;
ALTER TABLE user_group DROP is_in_france_services_network;
--- !Downs

UPDATE organisation SET name = 'Pôle emploi' WHERE id = 'Pôle emploi';
UPDATE organisation SET short_name = 'Pôle emploi' WHERE id = 'Pôle emploi';
10 changes: 10 additions & 0 deletions conf/evolutions/default/81.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- !Ups

ALTER TABLE user_group ADD is_in_france_services_network BOOLEAN NOT NULL DEFAULT true;
ALTER TABLE application ADD is_in_france_services_network BOOLEAN NOT NULL DEFAULT true;


-- !Downs

ALTER TABLE application DROP is_in_france_services_network;
ALTER TABLE user_group DROP is_in_france_services_network;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"css-loader": "7.1.2",
"mini-css-extract-plugin": "2.9.2",
"rimraf": "6.0.1",
"ts-loader": "9.5.1",
"ts-loader": "9.5.2",
"typescript": "5.0.4",
"webpack": "5.97.1",
"webpack-cli": "6.0.1",
Expand Down
25 changes: 25 additions & 0 deletions scripts/copy-scalingo-review-app-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

echo "Running Scalingo review app DB copy script"

if [ "$IS_REVIEW_APP" = "true" ]; then
dbclient-fetcher pgsql 15

echo "Copying review app db"

echo "Checking number of rows in 'user' table"

USER_COUNT=$(/app/bin/psql "${SCALINGO_POSTGRESQL_URL}" -A -t -c 'SELECT COUNT(*) FROM "user";')

if [ "$USER_COUNT" -gt 0 ] 2>/dev/null; then
echo "Table 'user' has $USER_COUNT rows. Doing nothing."
else
echo "Table 'user' has $USER_COUNT rows. Copying parent app db to review app db."

/app/bin/pg_dump --clean --if-exists --format c --dbname "${PARENT_APP_DATABASE_URL}" --no-owner --no-privileges --no-comments --exclude-schema 'information_schema' --exclude-schema '^pg_*' | /app/bin/pg_restore --clean --if-exists --no-owner --no-privileges --no-comments --dbname "${SCALINGO_POSTGRESQL_URL}"

fi

else
echo "Not a review app - skipping database copy"
fi
2 changes: 1 addition & 1 deletion typescript/src/franceServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ if (window.document.getElementById(tableId)) {
};

const addTableAreaCodeCol: ColumnDefinition = {
title: 'Code INSEE',
title: 'Code Département',
field: 'areaCode',
headerFilter: 'input',
editor: 'input',
Expand Down

0 comments on commit 3878d23

Please sign in to comment.