[MGNLUI-3590] Make bulk actions configurable in the Pulse Created: 16/Sep/15  Updated: 09/Feb/17  Resolved: 21/Oct/15

Status: Closed
Project: Magnolia UI
Component/s: pulse
Affects Version/s: 5.3.10, 5.4.2
Fix Version/s: 5.5

Type: Bug Priority: Neutral
Reporter: Christian Ringele Assignee: Sang Ngo Huu
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: 0d
Time Spent: 6.5d
Original Estimate: 3d

Issue Links:
Relates
causality
is causing MGNLUI-3902 Task availability rule logs null warning Closed
is causing MGNLUI-3903 Task bulk-actions should only be arch... Closed
dependency
duplicate
relation
is related to MGNLUI-3638 Resurrect the DefaultAvailabilityChec... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Sprint: Saigon 43
Story Points: 8

 Description   

Tasks which are resolved can only be achieved by users with superuser role.
But this does not fit reality in projects...
The customer needs to be able to decide, who can archive successful pulse tasks.
It is a 'no go' to give somebody complete superuser rights just to be able to archive pulse tasks.

A valid situation would be:

  • Let also publishers archive their tasks.
  • Or, let an explicit role archive tasks.

In 5.4.x its line 143 in info.magnolia.ui.admincentral.shellapp.pulse.item.list.PulseListFooter:

User user = MgnlContext.getUser();
        // TODO ideally context menu action availability should use the same mechanism and rules defined in the messageView config
        // but as this is not straightforward, for the time being we hack it like this
        if (user.getAllRoles().contains("superuser")) {
            addRemoveMenuItem(i18n, itemsTable, contextMenu, "pages.publish.actions.archive");
        }

In 5.3.x its line 153 in info.magnolia.ui.admincentral.shellapp.pulse.item.list.PulseListFooter:

User user = MgnlContext.getUser();
        // TODO ideally context menu action availability should use the same mechanism and rules defined in the messageView config
        // but as this is not straightforward, for the time being we hack it like this
        if (user.getAllRoles().contains("superuser")) {
            addRemoveMenuItem(i18n, itemsTable, contextMenu, "pages.publish.actions.archive");
        }

In my opinion, an implementation like this is exactly what the comment says: "we hack it like this"...



 Comments   
Comment by Sang Ngo Huu [ 06/Oct/15 ]

For 5.4.x: All bulk actions is now configurable, user can specific roles for each actions. This is a big changes on code, please think about a major relase for it.

For 5.3.x: Current code does not support to configure pulse list, so there are more code changes than 5.4.x.

Please review my approach, I will port to 5.3.x later.

Comment by Sang Ngo Huu [ 06/Oct/15 ]

Hi had
By following 5.4.x for 5.3.x, configration of 5.3.x is a part of MGNLUI-3379. But make code more clear and don't have hard code.

Other idea is create configuration as below and inject it into PulseListFooter with name "messages"/"tasks" which hardcode in this class.

+ pulse
      + bulkActions
            + messages
            + tasks
                  + archive
                        + roles
                              + superuser: superuser        

Please give an advice. Thanks

Comment by Jan Haderka [ 07/Oct/15 ]

In order to not introduce changes that would not be backward compatible, this fix is available on 5.4.x branch only.

Comment by Ilgun Ilgun [ 09/Oct/15 ]

1) You are introducing new delta and this requires a test.
2) I wanted to point out to minor changes and since it is easier done than said, I pushed the changes to MGNLUI-3590-sq-ilgun.

Comment by Sang Ngo Huu [ 15/Oct/15 ]

Thanks for your review.

I rebased your changes to my branch (MGNLUI-3590) , I also added more testcases for this ticket.

Please help me check it again.

Comment by Mikaël Geljić [ 15/Oct/15 ]

Nice one! It's pretty big, but it's also well split as far as I saw

Just rephrased issue title, and let's make sure we have 2 reviewers.

Comment by Ilgun Ilgun [ 19/Oct/15 ]

Waiting for PR to be created.

Comment by Ilgun Ilgun [ 19/Oct/15 ]

Reopening the issue.

Since this issue contains some changes in bootstrap files and hence, it introduces a new delta in
AdmincentralModuleVersionHandler.
It is required and highly recommended to have some tests for that particular change although they are just partialBootstrapTasks.

Comment by Sang Ngo Huu [ 21/Oct/15 ]

I added testcase for version handler.

There is PR: https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/pull-requests/4/overview

Thanks,

Generated at Mon Feb 12 09:08:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.