-
Notifications
You must be signed in to change notification settings - Fork 4
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
En tant qu'admin je peux supprimer une entreprise #425
En tant qu'admin je peux supprimer une entreprise #425
Conversation
b4fb026
to
a91e6f7
Compare
f45e4ac
to
24f526b
Compare
6fdc853
to
b140478
Compare
Co-authored-by: Jérôme Burkard <JeromeBu@users.noreply.github.com>
Co-authored-by: Jérôme Burkard <JeromeBu@users.noreply.github.com> Co-authored-by: Enguerran Weiss <enguerranws@users.noreply.github.com>
Co-authored-by: Enguerran Weiss <enguerranws@users.noreply.github.com>
c92500d
to
2159161
Compare
`⚠️ Etes-vous sûr de vouloir supprimer cette établissement ? ⚠️ | ||
(cette opération est irréversible 💀)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`⚠️ Etes-vous sûr de vouloir supprimer cette établissement ? ⚠️ | |
(cette opération est irréversible 💀)`, | |
`⚠️ Etes-vous sûr de vouloir supprimer cet établissement ? ⚠️ | |
(cette opération est irréversible 💀)`, |
public addFormEstablishment$( | ||
formEstablishment: FormEstablishmentDto, | ||
): Observable<void> { | ||
return from(this.addFormEstablishment(formEstablishment)); | ||
return from(this.#addFormEstablishment(formEstablishment)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pourquoi avoir créé une fonction privée ici ? (pareil dans deleteEstablishment, updateFormEstablishment et requestEstablishmentModification)
return from(this.#addFormEstablishment(formEstablishment)); | |
return from(this.httpClient.addFormEstablishment({ | |
body: formEstablishment, | |
})); |
export const formEstablishementUpdateFailedErrorMessage = ( | ||
dto: FormEstablishmentDto, | ||
): string => | ||
`Cannot update form establishlment DTO with siret ${dto.siret}, since it is not found.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`Cannot update form establishlment DTO with siret ${dto.siret}, since it is not found.`; | |
`Cannot update form establishment DTO with siret ${dto.siret}, since it is not found.`; |
formEstablishment.siret, | ||
); | ||
log("Cleared existing Aggregate"); | ||
const establishlment = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const establishlment = | |
const establishment = |
tags: ["suppression entreprise"], | ||
createEmailVariables: ({ businessAddress, businessName, siret }) => ({ | ||
subject: | ||
"Votre entreprise a été supprimée de la liste des entreprises accueillantes d'immersion facilitée d'Immersion Facilitée", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Votre entreprise a été supprimée de la liste des entreprises accueillantes d'immersion facilitée d'Immersion Facilitée", | |
"Votre entreprise a été supprimée de la liste des entreprises accueillantes d'Immersion Facilitée", |
shared/src/domElementIds.ts
Outdated
@@ -264,6 +264,7 @@ export const domElementIds = { | |||
errorSiretAlreadyExistButton: | |||
"im-form-add-establishment__edit-establishment-button", | |||
submitButton: "im-form-add-establishment__submit-button", | |||
deleteButton: "im-form-delete-establishment__onclick-button", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteButton: "im-form-delete-establishment__onclick-button", | |
deleteButton: "im-form-delete-establishment__delete-button", |
store.dispatch( | ||
establishmentSlice.actions.establishmentDeletionRequested({ | ||
siret: formEstablishment.siret, | ||
jwt: "backoffice-jwt", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jwt: "backoffice-jwt", | |
jwt: backOfficeJwt, |
>; | ||
|
||
export type EstablishmentUpdatePayload = { | ||
formEstablishment: FormEstablishmentDto; | ||
jwt: EstablishmentJwt; | ||
}; | ||
|
||
export type EstablishmentDeletePayload = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
à voir: homogénéiser front + back ?
const featureFlags = useFeatureFlags(); | ||
const { getFormFields } = useFormContents(formEstablishmentFieldsLabels); | ||
const formContents = getFormFields(); | ||
const { register, setValue } = useFormContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enlever le setValue
/> | ||
</div> | ||
<Button | ||
title="Piloter l'entreprise" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- supprimer
title
- mettre un
id
sub: "admin", | ||
}; | ||
|
||
it("throws an error if there is jwt", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it("throws an error if there is jwt", async () => { | |
it("throws an error if there is no jwt", async () => { |
await pool.end(); | ||
}); | ||
|
||
it("save", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
que se passe-t-il si sauvegarde d'un même établissement une seconde fois ?
|
||
describe("delete", () => { | ||
it("delete establishment", async () => { | ||
const formEstablishment = FormEstablishmentDtoBuilder.valid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
factoriser formEstablishment
car utilisé plusieurs fois
@@ -1,4 +1,9 @@ | |||
import { SearchImmersionResultDto } from "shared"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renommer le fichier avec une majuscule
} = await buildTestApp()); | ||
}); | ||
|
||
it("200 - Establishment Aggregate & Form deleted with back office JWT", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it("200 - Establishment Aggregate & Form deleted with back office JWT", async () => { | |
it("204 - Establishment Aggregate & Form deleted with back office JWT", async () => { |
76ab0e9
to
424f7ee
Compare
424f7ee
to
801ce6c
Compare
No description provided.