Skip to content

Commit

Permalink
Toub/fix tri fix label tri v2 (#1499)
Browse files Browse the repository at this point in the history
* fix(mail): ajout lien #1492 (#1496)

* fix(TRI): fix label tri v2
  • Loading branch information
Toub authored Jun 29, 2021
1 parent 2e7e3c7 commit 55791e8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<tbody>
<tr>
<td align="center" class="text-center" style="font-family: sans-serif; font-size: 14px; vertical-align: top; border-radius: 5px; text-align: center; background-color: #3e61ff;">
<a href="https://domifa.fabrique.social.gouv.fr" target="_blank" rel="noopener noreferrer" style="border: solid 1px #3e61ff; border-radius: 5px; box-sizing: border-box; cursor: pointer; display: inline-block; font-size: 14px; font-weight: bold; margin: 0; padding: 12px 25px; text-decoration: none; text-transform: uppercase; background-color: #3e61ff; border-color: #3e61ff; color: #ffffff;">Se connecter</a>
<a href="https://domifa.fabrique.social.gouv.fr/connexion" target="_blank" rel="noopener noreferrer" style="border: solid 1px #3e61ff; border-radius: 5px; box-sizing: border-box; cursor: pointer; display: inline-block; font-size: 14px; font-weight: bold; margin: 0; padding: 12px 25px; text-decoration: none; text-transform: uppercase; background-color: #3e61ff; border-color: #3e61ff; color: #ffffff;">Se connecter</a>
</td>
</tr>
</tbody>
Expand All @@ -190,7 +190,7 @@
<p class="my-1" style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px;">
<b class="text-primary">Note:</b> <span class="text-gray-600 italic" style="color: rgb(75, 85, 99); font-style: italic;">si le bouton ci-dessus ne fonctionne pas correctement, vous pouvez aussi copier/coller le lien suivant dans votre navigateur:</span>
</p>
<p class="my-1" style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px;"></p><pre>https://domifa.fabrique.social.gouv.fr</pre><p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px;"></p>
<p class="my-1" style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px;"></p><pre>https://domifa.fabrique.social.gouv.fr/connexion</pre><p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px;"></p>
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ describe("userAccountActivatedEmailRenderer", () => {
it("userAccountActivatedEmailRenderer render ", async () => {
const model = {
prenom: "Paul",
lien: "https://domifa.fabrique.social.gouv.fr",
lien: "https://domifa.fabrique.social.gouv.fr/connexion",
};
const {
subject,
text,
html,
} = await userAccountActivatedEmailRenderer.renderTemplate(model);
const { subject, text, html } =
await userAccountActivatedEmailRenderer.renderTemplate(model);

expect(subject).toEqual(`[DOMIFA] Votre compte Domifa a été activé`);
expect(text).toContain(model.prenom);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as path from "path";
import { domifaConfig } from "../../../../config";
import { MessageEmailContent } from "../../../../database";
import { AppUser } from "../../../../_common/model";
Expand All @@ -18,7 +17,7 @@ async function sendMail({
user: Pick<AppUser, "email" | "nom" | "prenom">;
}): Promise<void> {
const frontendUrl = domifaConfig().apps.frontendUrl;
const lien = path.join(frontendUrl, "/connexion");
const lien = frontendUrl + "connexion";

const to = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export class ManageUsagersComponent implements OnInit, OnDestroy {
private subscription = new Subscription();

public sortLabel = "échéance";
public echeanceSortLabel = "échéance";

constructor(
private usagerService: UsagerService,
Expand Down Expand Up @@ -228,11 +227,21 @@ export class ManageUsagersComponent implements OnInit, OnDestroy {
this.filters$.next(this.filters);
}

getEcheanceLabel() {
if (this.filters.statut === "RADIE") {
return "radiation";
} else if (this.filters.statut === "REFUS") {
return "refus";
} else {
return "échéance";
}
}

private updateSortLabel() {
const LABELS_SORT: { [key: string]: string } = {
NAME: "nom",
ATTENTE_DECISION: "demande effectuée le",
ECHEANCE: "échéance",
ECHEANCE: this.getEcheanceLabel(),
INSTRUCTION: "dossier débuté le",
RADIE: "radié le ",
REFUS: "date de refus",
Expand All @@ -242,16 +251,7 @@ export class ManageUsagersComponent implements OnInit, OnDestroy {
ID: "ID",
};

if (this.filters.statut === "RADIE") {
this.echeanceSortLabel = "radiation";
this.sortLabel = "radiation";
} else if (this.filters.statut === "REFUS") {
this.sortLabel = "refus";
this.echeanceSortLabel = "refus";
} else {
this.sortLabel = LABELS_SORT[this.filters.sortKey];
this.echeanceSortLabel = "échéance";
}
this.sortLabel = LABELS_SORT[this.filters.sortKey];
}

public updateFilters<T extends keyof UsagersFilterCriteria>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@
(click)="updateFilters({element: 'sortKey', value: 'ECHEANCE', sortValue:'ascending'})"
ngbDropdownItem
>
Trier par {{ echeanceSortLabel }}
Trier par {{ getEcheanceLabel() }}
<fa-icon icon="sort-amount-up"></fa-icon>
</button>
<button
(click)="updateFilters({element: 'sortKey', value: 'ECHEANCE', sortValue:'descending'})"
ngbDropdownItem
>
Trier par {{ echeanceSortLabel }}
Trier par {{ getEcheanceLabel() }}
<fa-icon icon="sort-amount-down"></fa-icon>
</button>
<button
Expand Down

0 comments on commit 55791e8

Please sign in to comment.