AS a user, I want to be able to sort the inventory command by card id, name, and type #278

Open
opened 2024-06-28 10:42:22 +01:00 by Vylpes · 1 comment
Owner

Epic:
Story Points: 2


SO THAT I can sort it in an order of the type I am looking for

Acceptance Criteria

GIVEN I am a user
WHEN I run `/inventory [sortBy=id|name|type]
THEN the cards will be sorted within the series by its id (default), name, or type, respectively

Subtasks

  • Update the command to accept this parameter
  • Update generation logic to sort by a custom field
  • Update the pagination
  • Add unit tests
  • Fix linter

Notes

  • The default (without a sort) will be "id"
Epic: \ Story Points: 2 --- SO THAT I can sort it in an order of the type I am looking for ## Acceptance Criteria GIVEN I am a user WHEN I run `/inventory [sortBy=id|name|type] THEN the cards will be sorted within the series by its id (default), name, or type, respectively ## Subtasks - [x] Update the command to accept this parameter - [x] Update generation logic to sort by a custom field - [x] Update the pagination - [x] Add unit tests - [x] Fix linter ## Notes - The default (without a sort) will be "id"
Vylpes changed title from Ability to sort the inventory command by card id, name and rarity to AS a user, I want to be able to sort the inventory command by card id, name, and type 2024-10-13 15:16:22 +01:00
Vylpes self-assigned this 2026-02-24 17:43:09 +00:00
Vylpes added this to the 0.11.0 milestone 2026-02-24 17:43:12 +00:00
Vylpes added this to the 0.10 Sprint 3 project 2026-02-24 17:43:14 +00:00
Vylpes stopped working 2026-03-03 19:03:24 +00:00
35 minutes 20 seconds
Vylpes stopped working 2026-03-06 20:28:41 +00:00
7 minutes 31 seconds
Member

QA testing complete on release/0.11.0 (commit as of this run). Result: PASS — moving to step/uat.

Pipeline (same steps as the Forgejo workflow)

Step Command Result
Install yarn install --frozen-lockfile pass
Build yarn build (tsc) pass
Test yarn test (jest) pass — 22/22 suites, 78 passed, 30 todo, 9 snapshots
Lint yarn lint (eslint .) pass — 0 problems

Acceptance criteria verification

GIVEN I am a user
WHEN I run /inventory [sortBy=id|name|type]
THEN the cards will be sorted within the series by its id (default), name, or type, respectively

Covered by the following passing tests:

  • tests/commands/inventory.test.ts
    • GIVEN sortby is provided, EXPECT helper called with selected sort
    • GIVEN sortby is omitted, EXPECT helper called with default id sort
  • tests/helpers/InventoryHelper.test.ts
    • GIVEN sortBy is id, EXPECT cards sorted by id and footer contains sort
    • GIVEN sortBy is name, EXPECT cards sorted by name and controls keep selected sort
    • GIVEN sortBy is type, EXPECT cards sorted by type
    • GIVEN sortBy is name/invalid, EXPECT name/id returned (ParseSortBy)
  • tests/buttonEvents/Inventory.test.ts and tests/stringDropdowns/Inventory.test.ts
    • pagination buttons and the page dropdown both round-trip the selected sort, and fall back to id when absent

Subtask checks against the code on release/0.11.0:

  • Command accepts the parameter — src/commands/inventory.ts registers a sortby string option with choices ID / Name / Type.
  • Generation logic sorts by a custom field — InventoryHelper.GetSortValue / GetClaimedSeries sort cards within each series.
  • Pagination preserved — sort is encoded into the button customId and dropdown values, and shown in the embed footer.
  • Default is idParseSortBy returns id for missing or unrecognised input.

No failures to report. Over to you for UAT.

QA testing complete on `release/0.11.0` (commit as of this run). **Result: PASS** — moving to `step/uat`. ## Pipeline (same steps as the Forgejo workflow) | Step | Command | Result | | --- | --- | --- | | Install | `yarn install --frozen-lockfile` | pass | | Build | `yarn build` (`tsc`) | pass | | Test | `yarn test` (`jest`) | pass — 22/22 suites, 78 passed, 30 todo, 9 snapshots | | Lint | `yarn lint` (`eslint .`) | pass — 0 problems | ## Acceptance criteria verification > GIVEN I am a user > WHEN I run `/inventory [sortBy=id|name|type]` > THEN the cards will be sorted within the series by its id (default), name, or type, respectively Covered by the following passing tests: - `tests/commands/inventory.test.ts` - GIVEN sortby is provided, EXPECT helper called with selected sort - GIVEN sortby is omitted, EXPECT helper called with default id sort - `tests/helpers/InventoryHelper.test.ts` - GIVEN sortBy is id, EXPECT cards sorted by id and footer contains sort - GIVEN sortBy is name, EXPECT cards sorted by name and controls keep selected sort - GIVEN sortBy is type, EXPECT cards sorted by type - GIVEN sortBy is name/invalid, EXPECT name/id returned (`ParseSortBy`) - `tests/buttonEvents/Inventory.test.ts` and `tests/stringDropdowns/Inventory.test.ts` - pagination buttons and the page dropdown both round-trip the selected sort, and fall back to `id` when absent Subtask checks against the code on `release/0.11.0`: - Command accepts the parameter — `src/commands/inventory.ts` registers a `sortby` string option with choices ID / Name / Type. - Generation logic sorts by a custom field — `InventoryHelper.GetSortValue` / `GetClaimedSeries` sort cards within each series. - Pagination preserved — sort is encoded into the button `customId` and dropdown values, and shown in the embed footer. - Default is `id` — `ParseSortBy` returns `id` for missing or unrecognised input. No failures to report. Over to you for UAT.
Sign in to join this conversation.
No milestone
No project
2 participants
Notifications
Total time spent: 42 minutes 51 seconds
Vylpes
42 minutes 51 seconds
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
External/card-drop#278
No description provided.