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

FileUpload.Item: 💥 Endret API og støtte for å sette ID på knappen #2824

Merged
merged 4 commits into from
Apr 8, 2024

Conversation

torkjels
Copy link
Contributor

@torkjels torkjels commented Apr 2, 2024

Slik at man kan lenke til knappen med en -tag.

Slik at man kan lenke til knappen med en <a>-tag.
@torkjels torkjels requested review from KenAJoh and HalvorHaugan April 2, 2024 15:42
Copy link

changeset-bot bot commented Apr 2, 2024

🦋 Changeset detected

Latest commit: e3806c7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@navikt/ds-react Minor
@navikt/ds-css Minor
@navikt/ds-tokens Minor
@navikt/ds-tailwind Minor
@navikt/aksel-icons Minor
@navikt/aksel Minor
@navikt/aksel-stylelint Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Apr 2, 2024

Storybook demo

Endringer til review: 1

29c6907bd | 60 komponenter | 209 stories

@KenAJoh
Copy link
Collaborator

KenAJoh commented Apr 3, 2024

I hvilke tilfeller vil man trenge å flytte fokus til knapp her? Tenker f.eks bare hva forskjellen på å slette filen for brukeren ved en action vs å flytte fokuset til filen og la brukeren slette den manuelt er 🤔

@HalvorHaugan
Copy link
Contributor

Nå har vi diskutert dette, og kommet fram til at vi ønsker å samle alle props som har med knappen å gjøre til et objekt. Noe sånt som dette:

action={{
  type: "delete",
  onClick: () => onDelete(file),
  id: "min-id",
  title: "Slett filen 'filnavn'",   // eventuelt
}}

@HalvorHaugan HalvorHaugan changed the title actionButtonId på FileUpload.item FileUpload.Item: 💥 Endret API og støtte for å sette ID på knappen Apr 5, 2024
KenAJoh
KenAJoh previously approved these changes Apr 5, 2024
Copy link
Collaborator

@KenAJoh KenAJoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Ser bra ut. Mangler bare å oppdatere JSDOC

   * @example
   * Status & actions
   * ```jsx
   * <FileUpload.Item file={file} status="uploading" />
   * <FileUpload.Item file={file} status="downloading" />
   * <FileUpload.Item file={file} itemAction="retry" onRetry={...} />
   * <FileUpload.Item file={file} itemAction="delete" onDelete={...} />
   * ```
   */

@HalvorHaugan
Copy link
Contributor

Bra spottet!

@HalvorHaugan
Copy link
Contributor

Ser det greit ut slik?

   * <FileUpload.Item file={file} button={{ action:"retry", onClick:... }} />
   * <FileUpload.Item file={file} button={{ action:"delete", onClick:... }} />

Eller bør det formateres slik prettier ville gjort det?

@KenAJoh
Copy link
Collaborator

KenAJoh commented Apr 5, 2024

Ser det greit ut slik?

   * <FileUpload.Item file={file} button={{ action:"retry", onClick:... }} />
   * <FileUpload.Item file={file} button={{ action:"delete", onClick:... }} />

Eller bør det formateres slik prettier ville gjort det?

Funker slik det er nå 👍

@HalvorHaugan HalvorHaugan merged commit 8f9ed7a into main Apr 8, 2024
3 checks passed
@HalvorHaugan HalvorHaugan deleted the actionButtonId branch April 8, 2024 07:16
@github-actions github-actions bot mentioned this pull request Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants