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

fix(exchange): remove the restore exchange button #1939

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ jobs:
matrix:
e2e_test:
- auth
- exchange_inbox
- exchanges
- forum
- opportunity
- status
- studient
- studient_inbox

system:
name: System testing
Expand Down
2 changes: 2 additions & 0 deletions apps/e2e/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export default defineConfig({
},

video: true,
viewportHeight: 860,
viewportWidth: 1280,
});

//
Expand Down
18 changes: 18 additions & 0 deletions apps/e2e/features/exchange_inbox/archive.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#language: fr
Fonctionnalité: Archiver un échange

Contexte:
Soit une base de données nourrie au grain
* je navigue sur la page
* je me connecte en tant que "[email protected]"
* je clique sur le champ "Recherche"
* je tape "café"
* je clique sur "Voir mes échanges"

Scénario: Jackie archive son échange
Quand je clique sur la légende "Menu"
Et je clique sur "Supprimer"

# Alors je vois dans le titre "Inbox :: Exchanges :: Serkels"
# * je vois "P'tit pause café avec l'ami Jackie"
# * je vois "Aucune discussion disponible pour le moment"
25 changes: 25 additions & 0 deletions apps/e2e/features/exchange_inbox/consult.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#language: fr
Fonctionnalité: Consulter la boîte de réception d'un échange

Contexte:
Soit une base de données nourrie au grain
* je navigue sur la page
* je me connecte en tant que "[email protected]"

Scénario: Jackie consult son échange pour un café à partir de son inbox
Quand je clique sur la légende "Link to my exchanges inbox"

Alors je vois dans le titre "Inbox :: Exchanges :: Serkels"
* je vois "Aucun échange"
# * je vois "J'aime le café"

Scénario: Jackie consult son échange pour un café à partir de la liste des échanges
* je clique sur le champ "Recherche"
* je tape "café"
* je vois "P'tit pause café avec l'ami Jackie"

Quand je clique sur "Voir mes échanges"

Alors je vois dans le titre "Inbox :: Exchanges :: Serkels"
* je vois "P'tit pause café avec l'ami Jackie"
* je vois "Aucune discussion disponible pour le moment"
2 changes: 1 addition & 1 deletion apps/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"start": "cd ../.. && pnpm run start",
"studio": "cypress open --browser electron --e2e ",
"studio": "cypress open --browser firefox --e2e ",
"test": "cypress run --env filterSpecs=true",
"type-check": "tsc --build"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { TRPC_React } from ":trpc/client";
import type { ID_Schema } from "@1.modules/core/domain";
import { Plus, Trash } from "@1.ui/react/icons";
import { Trash } from "@1.ui/react/icons";
import { ActionItem } from "@1.ui/react/menu";
import { useCallback } from "react";
import ContentLoader from "react-content-loader";
Expand All @@ -27,12 +27,13 @@ export function DeleteExchange_ActionItem({
);

return (
<ActionItem className="text-left" onAction={toggle_add_to_archive}>
<ActionItem
className="text-left"
onAction={toggle_add_to_archive}
isDisabled={is_archived}
>
{is_archived ? (
<>
<Plus className="w-4" />
<span className="w-full">Restorer l'échange</span>
</>
<>Cette échange est archivée.</>
) : (
<>
<Trash className="w-4" />
Expand All @@ -58,7 +59,8 @@ export function useToggleArchiveExchange(exchange_id: ID_Schema) {

const toggle_add_to_archive = useCallback(async () => {
if (is_archived) {
await unarchive_exchange.mutateAsync({ exchange_id });
// FUTURE(douglasduteil): uncomment when ready the archive feature is finished
// await unarchive_exchange.mutateAsync({ exchange_id });
} else {
await archive_exchange.mutateAsync({ exchange_id });
}
Expand Down
4 changes: 3 additions & 1 deletion apps/www/app/(main)/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ async function UserNavGroup({ className }: ComponentPropsWithoutRef<"nav">) {
<Messenger className={icon()} />
<MessageNews_DotIndicator />
</Link>
<Link href={`/@~/exchanges/inbox`} className="relative flex">
<Link href={`/@~/exchanges/inbox`} className="relative flex"
aria-label="Link to my exchanges inbox"
>
<VisuallyHidden>Mes échanges</VisuallyHidden>
<Exchange className={icon()} />
<ExchangeNews_DotIndicator />
Expand Down
Loading