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: add action menu extension #576

Closed
wants to merge 3 commits into from

Conversation

ashutosh16
Copy link

@ashutosh16 ashutosh16 commented Aug 21, 2024

Ref: argoproj/argo-cd#19620

Screenshot:
Screenshot 2024-08-20 at 22 24 00

Copy link

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

Please update the UI extensions documentation explaining the new type

Copy link
Member

@rbreeze rbreeze left a comment

Choose a reason for hiding this comment

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

LGTM once documentation is added

@ashutosh16 ashutosh16 requested a review from leoluz August 21, 2024 20:07
@ashutosh16 ashutosh16 changed the title add toolbar extension feat: add toolbar extension Aug 21, 2024
@ashutosh16 ashutosh16 changed the title feat: add toolbar extension feat: add action menu extension Aug 21, 2024
Copy link

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

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

What is this extension adding? In the screenshot is it the new button? That wouldn't need a change in argo-ui.

I would also strongly advise against CD UI extensions reaching into argo-ui given the deprecated state of this repo per pinned issue #453 . Giving a deprecated repo a new feature that user-facing extensions hook into sounds like exposing far too much, especially for a not very reliable repo.
I would also advise against that as this repo is not supposed to be specific to CD. "extensions" are not a term in this repo either

stories/top-bar.stories.tsx Outdated Show resolved Hide resolved
<div>
{actionMenu.items.map((item, i) => (
<button disabled={!!item.disabled} qe-id={item.qeId} className='argo-button argo-button--base' onClick={() => item.action()} style={{marginRight: 2}} key={i}>
{item.iconClassName && (<i className={item.iconClassName} style={{marginLeft: '-5px', marginRight: '5px'}}/>)}
{item.title}
</button>
))}
{actionMenuExtensions && actionMenuExtensions.map((ext, index) => (
Copy link

@agilgur5 agilgur5 Aug 22, 2024

Choose a reason for hiding this comment

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

Adding another button does not require an argo-ui change, you can just add another item to the list in CD.

EDIT: I left a comment downstream in CD as well: argoproj/argo-cd#19620 (comment)

Copy link
Author

Choose a reason for hiding this comment

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

I still want to pursue these changes, and I think this is an easy solution that does not require any extensions or argo. If we have a better solution in the future, I will be happy to review it.

Copy link

@agilgur5 agilgur5 Aug 22, 2024

Choose a reason for hiding this comment

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

I think this is an easy solution that does not require any extensions or argo

It's definitely not "easy" given how invasive it is, and it adds the entire concept of extensions to argo-ui (which should not be exposed from an internal repo), which does in fact add logic to Argo

Copy link

@agilgur5 agilgur5 Aug 22, 2024

Choose a reason for hiding this comment

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

See the concrete guidance I left downstream for how to avoid a change in argo-ui: argoproj/argo-cd#19620 (comment)

ashutosh16 added 3 commits August 22, 2024 13:17
add toolbar ext

add toolbar ext

Signed-off-by: ashutosh16 <[email protected]>
Signed-off-by: ashutosh16 <[email protected]>

add actionmenut ext

Signed-off-by: ashutosh16 <[email protected]>

add actionmenut ext

Signed-off-by: ashutosh16 <[email protected]>
Signed-off-by: ashutosh16 <[email protected]>
@agilgur5
Copy link

agilgur5 commented Aug 25, 2024

I think this can be closed given the latest changes in argoproj/argo-cd#19620 that obviate the need for this per my suggestions.

CD folks should probably double-check my review there since I'm not a regular contributor there (nor have approver permissions there). Docs have also been added there now

@agilgur5 agilgur5 closed this Aug 25, 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.

4 participants