Skip to content

Commit

Permalink
fix(ui): consistent resource menu across views (#18060) (#18069)
Browse files Browse the repository at this point in the history
* add icon in app table view

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use defaut menu in tree-grouped

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use default menu in pod views

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix custom delete actions

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* menu item in list

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix pod wrongly identified as root in network graph

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* update docs error

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* call delete pod action if kind is pod

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* add logs action to pods

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* delete in app details

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* use managed instead of root for menu items

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* lint fix

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* fix lint again

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
  • Loading branch information
agaudreault committed May 9, 2024
1 parent ebb92d8 commit a89e358
Show file tree
Hide file tree
Showing 10 changed files with 291 additions and 334 deletions.
4 changes: 2 additions & 2 deletions cmd/argocd/commands/app_resources.go
Expand Up @@ -108,8 +108,8 @@ func NewApplicationDeleteResourceCommand(clientOpts *argocdclient.ClientOptions)
errors.CheckError(err)
command.Flags().StringVar(&group, "group", "", "Group")
command.Flags().StringVar(&namespace, "namespace", "", "Namespace")
command.Flags().BoolVar(&force, "force", false, "Indicates whether to orphan the dependents of the deleted resource")
command.Flags().BoolVar(&orphan, "orphan", false, "Indicates whether to force delete the resource")
command.Flags().BoolVar(&force, "force", false, "Indicates whether to force delete the resource")
command.Flags().BoolVar(&orphan, "orphan", false, "Indicates whether to orphan the dependents of the deleted resource")
command.Flags().BoolVar(&all, "all", false, "Indicates whether to patch multiple matching of resources")
command.Flags().StringVar(&project, "project", "", `The name of the application's project - specifying this allows the command to report "not found" instead of "permission denied" if the app does not exist`)
command.Run = func(c *cobra.Command, args []string) {
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/commands/argocd_app_delete-resource.md
Expand Up @@ -12,12 +12,12 @@ argocd app delete-resource APPNAME [flags]

```
--all Indicates whether to patch multiple matching of resources
--force Indicates whether to orphan the dependents of the deleted resource
--force Indicates whether to force delete the resource
--group string Group
-h, --help help for delete-resource
--kind string Kind
--namespace string Namespace
--orphan Indicates whether to force delete the resource
--orphan Indicates whether to orphan the dependents of the deleted resource
--project string The name of the application's project - specifying this allows the command to report "not found" instead of "permission denied" if the app does not exist
--resource-name string Name of resource
```
Expand Down
Expand Up @@ -573,16 +573,12 @@ export class ApplicationDetails extends React.Component<RouteComponentProps<{app
preferencesKey='application-details'>
{data => (
<ApplicationResourceList
pref={pref}
onNodeClick={fullName => this.selectNode(fullName)}
resources={data}
nodeMenu={node =>
AppUtils.renderResourceMenu(
{...node, root: node},
application,
tree,
this.appContext.apis,
this.appChanged,
() => this.getApplicationActionMenu(application, false)
AppUtils.renderResourceMenu(node, application, tree, this.appContext.apis, this.appChanged, () =>
this.getApplicationActionMenu(application, false)
)
}
tree={tree}
Expand All @@ -608,10 +604,11 @@ export class ApplicationDetails extends React.Component<RouteComponentProps<{app
preferencesKey='grouped-nodes-details'>
{data => (
<ApplicationResourceList
pref={pref}
onNodeClick={fullName => this.selectNode(fullName)}
resources={data}
nodeMenu={node =>
AppUtils.renderResourceMenu({...node, root: node}, application, tree, this.appContext.apis, this.appChanged, () =>
AppUtils.renderResourceMenu(node, application, tree, this.appContext.apis, this.appChanged, () =>
this.getApplicationActionMenu(application, false)
)
}
Expand Down

0 comments on commit a89e358

Please sign in to comment.