Skip to content

mgr/dashboard: Add table actions component - #23779

Merged
ricardoasmarques merged 10 commits into
ceph:masterfrom
Devp00l:wip-table-actions-component
Sep 19, 2018
Merged

ricardoasmarques merged 10 commits into
ceph:masterfrom
Devp00l:wip-table-actions-component

Conversation

@Devp00l

@Devp00l Devp00l commented Aug 28, 2018

Copy link
Copy Markdown

With the help of this component it is easy to create all actions for a
table with the right permission for each table action with a simple
configuration.

Per default action button and action drop down list are shown. All
actions will be filtered depending on the permissions on
initialization. Per default all actions that have the permission
'update' or 'delete' are only enabled if an item is selected which
holds no running task.

You can use change the default behavior, to show actions only in a
named drop down.
For each item you can change it's default behaviors by using custom
functions to enable/disable an action or show/hide it
as action button.

Please look at the tests to understand how to use it in practice.

Signed-off-by: Stephan Müller [email protected]

@LenzGr

LenzGr commented Aug 29, 2018 •

Copy link
Copy Markdown
Contributor

With that PR merged on my test system, I observed the following issue:

https://tracker.ceph.com/issues/34314

(I initially thought this is a general problem with the RBD management, that's why I filed a bug about it - feel free to resolve it once you've fixed this in this PR)

@tspmelo tspmelo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice to have the other buttons also included in the TableActionsComponent, but it can be added in another PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add action should not be disabled in the dropdown when a row is selected.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be import { BehaviorSubject } from 'rxjs';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please move this line to the top import group

@tspmelo

tspmelo commented Aug 30, 2018

Copy link
Copy Markdown
Contributor

Missing updating this files:

  • rbd-snapshot-list.component.html
  • user-list.component.html

@Devp00l
Devp00l force-pushed the wip-table-actions-component branch from fa7ac85 to b3fbe3e Compare August 31, 2018 15:25
@Devp00l Devp00l changed the title mgr/dashboard: Add table actions component [WIP] mgr/dashboard: Add table actions component Aug 31, 2018
@Devp00l

Devp00l commented Aug 31, 2018

Copy link
Copy Markdown
Author

I've added the use in RBD snapshots, but it's still missing in users. I'm on vacation for one week after that I will add the missing part.

@Devp00l
Devp00l force-pushed the wip-table-actions-component branch from b3fbe3e to f9ced6c Compare September 11, 2018 09:09
@Devp00l

Devp00l commented Sep 11, 2018

Copy link
Copy Markdown
Author

Added usage of table component in users and roles.

@Devp00l Devp00l changed the title [WIP] mgr/dashboard: Add table actions component mgr/dashboard: Add table actions component Sep 11, 2018
@Devp00l

Devp00l commented Sep 11, 2018

Copy link
Copy Markdown
Author

jenkins retest this please

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would like to see some documentation here. Especially i'm interested in a description of the routerLink attribute and why it is a function.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggest to rename attribute call to callFn and use readableExpect(task: string, callFn: Function, expected: any) to prevent confusion with the JS call function.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What are the types of call and expected?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing attribute types.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • s/call/callFn/
  • Add types to attributes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/call/callFn/

@Devp00l
Devp00l force-pushed the wip-table-actions-component branch from f9ced6c to 19f70dc Compare September 13, 2018 15:03
@Devp00l

Devp00l commented Sep 13, 2018

Copy link
Copy Markdown
Author

Addressed all comments :)

@LenzGr

LenzGr commented Sep 15, 2018

Copy link
Copy Markdown
Contributor

@tspmelo - could you please re-check this PR and update your review?

@ricardoasmarques ricardoasmarques left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Stephan Müller added 3 commits September 19, 2018 15:00
With the help of this component it is easy to create all actions for a
table with the right permission for each table action with a simple
configuration.

Per default action button and action drop down list are shown. All
actions will be filtered depending on the permissions on
initialization. Per default all actions that have the permission
'update' or 'delete' are only enabled if an item is selected which
holds no running task.

You can use change the default behavior, to show actions only in a
named drop down.
For each item you can change it's default behaviors by using custom
functions to enable/disable an action or show/hide it
as action button or drop down item.

Please look at the tests to understand how to use it in practice.

Signed-off-by: Stephan Müller <[email protected]>
Stephan Müller added 7 commits September 19, 2018 15:00
Typescript has thrown an warning because a private method is called in the
RBD snapshot unit tests.

Signed-off-by: Stephan Müller <[email protected]>
@Devp00l
Devp00l force-pushed the wip-table-actions-component branch from 19f70dc to 62b85cc Compare September 19, 2018 15:17
@tspmelo

tspmelo commented Sep 19, 2018

Copy link
Copy Markdown
Contributor

jenkins retest this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants