Skip to content
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

feat(organization): change action wording #548

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion e2e/cypress/support/step_definitions/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Given, Then, When } from "@badeball/cypress-cucumber-preprocessor";
//

let target: JQuery<HTMLElement>;
let scope: string;
let table_scope: string;
let row_scope: string;

Expand Down Expand Up @@ -58,6 +57,10 @@ Then("je vois {string} dans le tableau", function (text: string) {
cy.get(table_scope).contains(text);
});

Then("je ne vois pas {string} dans le tableau", function (text: string) {
cy.get(table_scope).contains(text).should("not.exist");
});

Then(
"je vois {string} dans le tableau {string}",
function (text: string, context: string) {
Expand Down
19 changes: 6 additions & 13 deletions e2e/features/moderations/jean_bon_join_abracadabra.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,15 @@ Fonctionnalité: Moderation blockante à accepter
* je vois la ligne "yopmail.com" dans le tableau
* sur la même ligne je vois "❓"
* sur la même ligne je vois "Menu"
Quand j'ouvre le menu déroulant sur la même ligne
* je vois "🗑️ Supprimer"
* je vois "🔄 Domain vérifié"

Quand je clique sur "🔄 Domain vérifié"
Alors je vois la ligne "yopmail.com" dans le tableau
Alors sur la même ligne je vois "✅"

Quand j'ouvre le menu déroulant sur la même ligne
Et je clique sur "🔄 Domain autorisé"
Et je clique sur " Domain autorisé"
Alors je vois la ligne "yopmail.com" dans le tableau
Alors sur la même ligne je vois ""
Alors sur la même ligne je vois ""

Quand j'ouvre le menu déroulant sur la même ligne
Et je clique sur le bouton "🗑️ Supprimer"
Alors je ne vois pas "🔄 Domain vérifié"
Et je clique sur le bouton "🚫 Domain refusé"
Alors je ne vois pas " Domain autorisé"

Quand je clique sur le champs dans le tableau
* je tape "poymail.com"
Expand All @@ -49,8 +42,8 @@ Fonctionnalité: Moderation blockante à accepter
Soit le tableau sous le title "Domaines de l'organisation"
* je vois la ligne "yopmail.com" dans le tableau
Quand j'ouvre le menu déroulant sur la même ligne
* je clique sur le bouton "🔄 Domain externe"
Alors sur la même ligne je vois ""
* je clique sur le bouton " Domain externe"
Alors sur la même ligne je vois ""

Scénario: Envoyer l'email « Votre demande a été traitée »
Quand je clique sur "Je valide ce membre ✅"
Expand Down
2 changes: 1 addition & 1 deletion e2e/features/organizations/dinum.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Fonctionnalité: Page organisation
* sur la même ligne je vois "✅"
* sur la même ligne je vois "verified"
* je vois la ligne "prestataire.modernisation.gouv.fr" dans le tableau
* sur la même ligne je vois ""
* sur la même ligne je vois ""
* sur la même ligne je vois "external"

# Scénario: Membres de DINUM
Expand Down
59 changes: 18 additions & 41 deletions packages/~/organizations/api/src/:id/domains/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//

import { button } from "@~/app.ui/button";
import { CopyButton } from "@~/app.ui/button/components/copy";
import { GoogleSearchButton } from "@~/app.ui/button/components/search";
import { menu_item } from "@~/app.ui/menu";
import { Horizontal_Menu } from "@~/app.ui/menu/components/Horizontal_Menu";
Expand Down Expand Up @@ -79,37 +78,37 @@ async function Add_Domain() {
function TypeToEmoji({ type }: { type: MCP_EmailDomain_Type }) {
return match(type)
.with("verified", () => (
<span role="img" aria-label="vérifié">
<span role="img" aria-label="vérifié" title="vérifié">
</span>
))
.with("authorized", () => (
<span role="img" aria-label="autorisé">
<span role="img" aria-label="autorisé" title="autorisé">
🔓
</span>
))
.with("external", () => (
<span role="img" aria-label="externe">
<span role="img" aria-label="externe" title="externe">
</span>
))
.with("blacklisted", () => (
<span role="img" aria-label="blacklisté">
🚫
<span role="img" aria-label="blacklisté" title="blacklisté">
☠️
</span>
))
.with("official_contact", () => (
<span role="img" aria-label="contact officiel">
📞
<span role="img" aria-label="contact officiel" title="contact officiel">
</span>
))
.with("trackdechets_postal_mail", () => (
<span role="img" aria-label="postal mail">
📬
<span role="img" aria-label="postal mail" title="postal mail">
</span>
))
.otherwise(() => (
<span role="img" aria-label="inconnu">
<span role="img" aria-label="inconnu" title="inconnu">
</span>
));
Expand All @@ -130,7 +129,7 @@ function Row({
</td>
<td>{domain}</td>
<td>{type}</td>
<td class="!text-end">
<td class="space-x-2 !text-end">
<GoogleSearchButton
class={button({ class: "align-bottom", size: "sm" })}
query={domain}
Expand All @@ -154,7 +153,7 @@ async function Row_Actions({
}: {
organization_domain: get_orginization_domains_dto[number];
}) {
const { domain, id, organization_id, organization } = organization_domain;
const { id, organization_id } = organization_domain;

const hx_delete_domain_props = await hx_urls.organizations[":id"].domains[
":domain_id"
Expand All @@ -171,56 +170,34 @@ async function Row_Actions({
return (
<Horizontal_Menu>
<ul class="list-none p-0">
<li>
<CopyButton
text={domain}
variant={{
type: "tertiary",
class: menu_item({ class: "shadow-none" }),
}}
>
Copier le domaine
</CopyButton>
</li>
<li>
<button
{...hx_delete_domain_props}
class={menu_item()}
hx-confirm={`Êtes-vous sûr de vouloir supprimer le domaine « ${domain} » de l'organisation « ${organization.cached_libelle} » ?`}
hx-swap="none"
role="menuitem"
>
🗑️ Supprimer
</button>
</li>
<li>
<button
{...await hx_change_type_props("verified")}
class={menu_item()}
hx-swap="none"
role="menuitem"
>
🔄 Domain vérifié
Domain autorisé
</button>
</li>
<li>
<button
{...await hx_change_type_props(null)}
{...await hx_change_type_props("external")}
class={menu_item()}
hx-swap="none"
role="menuitem"
>
🔄 Domain autorisé
Domain externe
</button>
</li>
<li>
<button
{...await hx_change_type_props("external")}
{...await hx_delete_domain_props}
class={menu_item()}
hx-swap="none"
role="menuitem"
>
🔄 Domain externe
🚫 Domain refusé
</button>
</li>
</ul>
Expand Down