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: Make ui.command to support path and download props #2224 #2262

Merged
merged 10 commits into from
Feb 9, 2024

Conversation

marek-mihok
Copy link
Contributor

The PR fulfills these requirements: (check all the apply)

  • It's submitted to the main branch.
  • When resolving a specific issue, it's referenced in the PR's title (e.g. feat: Add a button #xxx, where "xxx" is the issue number).
  • When resolving a specific issue, the PR description includes Closes #xxx, where "xxx" is the issue number.
  • If changes were made to ui folder, unit tests (make test) still pass.
  • New/updated tests are included

Adds path and download attributes to ui.command to support the same behavior as ui.link():

export interface Command {
  /** An identifying name for this component. If the name is prefixed with a '#', the command sets the location hash to the name when executed. */
  name: Id
  /** The text displayed for this command. */
  label?: S
  /** The caption for this command (typically a tooltip). */
  caption?: S
  /** The icon to be displayed for this command. */
  icon?: S
  /** Sub-commands, if any */
  items?: Command[]
  /** Data associated with this command, if any. */
  value?: S
  /** The path or URL to link to. The 'items' and 'value' props are ignored when specified. */
  path?: S
  /** True if the link should prompt the user to save the linked URL instead of navigating to it. */
  download?: B
}

Closes #2224

@marek-mihok marek-mihok marked this pull request as ready for review February 8, 2024 10:49
mturoci
mturoci previously approved these changes Feb 9, 2024
Copy link
Collaborator

@mturoci mturoci left a comment

Choose a reason for hiding this comment

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

LGTM. Just one question.

ui/src/button.test.tsx Outdated Show resolved Hide resolved
ui/src/button.test.tsx Show resolved Hide resolved
@mturoci mturoci merged commit cd469fc into main Feb 9, 2024
2 checks passed
@mturoci mturoci deleted the feat/issue-2224 branch February 9, 2024 12:40
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.

Add Download ability to ui.command
2 participants