Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
feat(address): show address additional infos (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineBda authored May 6, 2022
1 parent 82b49ef commit 4a040ce
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DB_LOGGING_ENABLE=false

DEMARCHES_SIMPLIFIEES_TOKEN=api-token
DEMARCHES_SIMPLIFIEES_ID=52209
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMjMyMzQyMg==", "secondAddress"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "public"], ["Q2hhbXAtMTYwMTE4Ng==", "email"], ["Q2hhbXAtMjI1MTk5Mw==", "displayEmail"], ["Q2hhbXAtMTYyNjk4Nw==", "adeliId"]]
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMjQyNTQxMA==", "addressAdditional"], ["Q2hhbXAtMjMyMzQyMg==", "secondAddress"], ["Q2hhbXAtMjQyNTQxMg==", "secondAddressAdditional"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "public"], ["Q2hhbXAtMTYwMTE4Ng==", "email"], ["Q2hhbXAtMjI1MTk5Mw==", "displayEmail"], ["Q2hhbXAtMTYyNjk4Nw==", "adeliId"]]
DEMARCHES_SIMPLIFIEES_WRITE_ACCESS=true
DEMARCHES_SIMPLIFIEES_CHAMP_VERIFICATIONS_AUTOMATIQUES="Q2hhbXAtMjMyMzUxNw=="
DEMARCHES_SIMPLIFIEES_INSTRUCTEUR_ID=
Expand Down
2 changes: 1 addition & 1 deletion .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NEXT_PUBLIC_SENTRY_ENV="development"

DEMARCHES_SIMPLIFIEES_TOKEN=api-tokens
DEMARCHES_SIMPLIFIEES_ID=52209
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMjMyMzQyMg==", "secondAddress"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "public"], ["Q2hhbXAtMTYwMTE4Ng==", "email"], ["Q2hhbXAtMjI1MTk5Mw==", "displayEmail"], ["Q2hhbXAtMTYyNjk4Nw==", "adeliId"]]
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMjQyNTQxMA==", "addressAdditional"], ["Q2hhbXAtMjMyMzQyMg==", "secondAddress"], ["Q2hhbXAtMjQyNTQxMg==", "secondAddressAdditional"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "public"], ["Q2hhbXAtMTYwMTE4Ng==", "email"], ["Q2hhbXAtMjI1MTk5Mw==", "displayEmail"], ["Q2hhbXAtMTYyNjk4Nw==", "adeliId"]]
DEMARCHES_SIMPLIFIEES_WRITE_ACCESS=false
DEMARCHES_SIMPLIFIEES_WRITABLE_ID="RG9zc2llci03NzgwODIy"
DEMARCHES_SIMPLIFIEES_CHAMP_VERIFICATIONS_AUTOMATIQUES="Q2hhbXAtMjMyMzUxNw=="
Expand Down
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DB_LOGGING_ENABLE=false

DEMARCHES_SIMPLIFIEES_TOKEN=api-token
DEMARCHES_SIMPLIFIEES_ID=52209
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMjMyMzQyMg==", "secondAddress"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "public"], ["Q2hhbXAtMTYwMTE4Ng==", "email"], ["Q2hhbXAtMjI1MTk5Mw==", "displayEmail"], ["Q2hhbXAtMTYyNjk4Nw==", "adeliId"]]
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMjQyNTQxMA==", "addressAdditional"], ["Q2hhbXAtMjMyMzQyMg==", "secondAddress"], ["Q2hhbXAtMjQyNTQxMg==", "secondAddressAdditional"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "public"], ["Q2hhbXAtMTYwMTE4Ng==", "email"], ["Q2hhbXAtMjI1MTk5Mw==", "displayEmail"], ["Q2hhbXAtMTYyNjk4Nw==", "adeliId"]]
DEMARCHES_SIMPLIFIEES_WRITE_ACCESS=false
DEMARCHES_SIMPLIFIEES_WRITABLE_ID="RG9zc2llci03NzgwODIy"
DEMARCHES_SIMPLIFIEES_CHAMP_VERIFICATIONS_AUTOMATIQUES="Q2hhbXAtMjMyMzUxNw=="
Expand Down
5 changes: 5 additions & 0 deletions src/components/Directory/Psychologist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ const Psychologist = ({
src="/images/icones/map-pin-fill.svg"
/>
{psychologist.address}
{psychologist.addressAdditional ?? (
<small className="d-block">
{psychologist.addressAdditional}
</small>
)}
</p>

{psychologist.visible ? (
Expand Down
31 changes: 31 additions & 0 deletions src/db/migrations/20220503133008-add-complement-address.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use strict";

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn("psychologist", "display_phone", {
type: Sequelize.BOOLEAN,
defaultValue: true,
});
await queryInterface.addColumn("psychologist", "address_additional", {
allowNull: true,
type: Sequelize.TEXT,
});
await queryInterface.addColumn(
"psychologist",
"second_address_additional",
{
allowNull: true,
type: Sequelize.TEXT,
}
);
},

async down(queryInterface) {
await queryInterface.removeColumn("psychologist", "display_phone");
await queryInterface.removeColumn("psychologist", "address_additional");
await queryInterface.removeColumn(
"psychologist",
"second_address_additional"
);
},
};
2 changes: 2 additions & 0 deletions src/db/models/psychologist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export default (sequelize) => {
Psychologist.init(
{
address: DataTypes.TEXT,
addressAdditional: DataTypes.TEXT,
secondAddress: DataTypes.TEXT,
secondAddressAdditional: DataTypes.TEXT,
archived: DataTypes.BOOLEAN,
cdsmsp: DataTypes.STRING,
coordinates: DataTypes.GEOMETRY("POINT", SRID),
Expand Down
2 changes: 2 additions & 0 deletions src/db/seeds/psychologist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ export const getOnePsychologist = (
address: `${faker.address.streetAddress()} ${faker.address.zipCode(
"#####"
)} ${faker.address.city()}`,
addressAdditional: faker.datatype.string(10),
secondAddress: `${faker.address.streetAddress()} ${faker.address.zipCode(
"#####"
)} ${faker.address.city()}`,
secondAddressAdditional: faker.datatype.string(10),
archived: false,
cdsmsp: faker.lorem.word(5),
coordinates: {
Expand Down
2 changes: 2 additions & 0 deletions src/types/psychologist.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export interface Psychologist {
archived: boolean;
phone: string;
address: string;
addressAdditional?: string;
secondAddress: string;
secondAddressAdditional?: string;
teleconsultation: boolean;
displayEmail: boolean;
visible: boolean;
Expand Down

0 comments on commit 4a040ce

Please sign in to comment.