magento-lts icon indicating copy to clipboard operation
magento-lts copied to clipboard

Allow to copy ACL and config path

Open luigifab opened this issue 2 years ago • 17 comments

Description

A new feature!

Bellow click on the link, and paste the config path where you want! You can disable it from System > Configuration > Admin > Admin theme (admin/design/copy_path).

Tested with Firefox 108, Chrome 108, Opera 94. navigator.clipboard.writeText require Firefox 63+, Chrome 66+, Edge 79+, Opera 53+, Safari 13.1+ (mdn docs).

1/ Go to System / Configuration:

before/after image image

2/ Go to System / Web Services / SOAP Roles, add or edit any role:

before/after image image

3/ Go to System / Permissions / Roles, add or edit any role:

before/after image image

Warning

Not complete for System / Web Services / REST Roles, I'm not sure how them works.

Contribution checklist

  • [x] Pull request has a meaningful description of its purpose
  • [x] All commits are accompanied by meaningful commit messages
  • [x] All automated tests passed successfully (all builds are green)
  • [x] Add yourself to contributors list

luigifab avatar Dec 02 '22 17:12 luigifab

I like it, but do we need this in production mode?

Change

Mage::getIsDeveloperMode() || Mage::helper('admin/variable')->isPathAllowed($element->getPath())

to

Mage::getIsDeveloperMode() && Mage::helper('admin/variable')->isPathAllowed($element->getPath())

What do think?

sreichel avatar Dec 03 '22 23:12 sreichel

Do we have to adjust openmage-theme (SCSS, CSS) too?

sreichel avatar Dec 04 '22 21:12 sreichel

I didn't test with openmage theme.

For production mode, normal admin can use only isPathAllowed in cms blocks, cms pages, wysiwyg products and categories attributes, transactional emails. In dev mode, developers can use all path in PHP files.

luigifab avatar Dec 08 '22 08:12 luigifab

There was a module for Magento 1.4-9? that add a red icon image (for default configuration) when configuration is modified by store view. Is someone know where I can find it?

kyrena avatar Dec 23 '22 11:12 kyrena

There was a module for Magento 1.4-9? that add a red icon image image (for default configuration) when configuration is modified by store view. Is someone know where I can find it?

I know that extension, but cant find it (was it a hackathon project?) There is a similar one: https://github.com/ericthehacker/magento-configscopehints (and https://github.com/avstudnitz/AvS_ScopeHint).

sreichel avatar Dec 23 '22 17:12 sreichel

good idea. Can we put it behind a config value? Iam worried not everyone might like the potentially long extra text. also please change it to the branch for a later version (its a new feature) And I wonder if we should make it more flexible, but thats something for a later iteration

Flyingmana avatar Dec 25 '22 00:12 Flyingmana

good idea.

  • we could also use an icin instead of text
  • duplicated js code javascript:navigator.clipboard.writeText could move to core/js helper
  • replace inline style style="font-style:italic with css

sreichel avatar Dec 27 '22 06:12 sreichel

I think that I have added all comments to the PR (except the red icon). It's not necessary to update openmage theme. Do I need to change the branch to 20?

luigifab avatar Jan 05 '23 14:01 luigifab

Think v19 is correct. Will test it later.

sreichel avatar Jan 05 '23 20:01 sreichel

Yes? No? To know if I try to add the red mark or not.

luigifab avatar Nov 12 '23 17:11 luigifab

So I installed this PR:

But I don't see effects:

Any idea what I miss.

[edit] OOOPs, only for developer mode.

kiatng avatar Nov 13 '23 04:11 kiatng

why is this feature behind "developer mode"? I don't see why normal admin shouldn't be able to copy ACLs from a role to another no?

fballiano avatar Apr 01 '24 05:04 fballiano

When you are a normal admin user, you can use only allowed config path in email, cms and pages, so this PR display copy links only for allowed config paths.

But it's true that if you are a normal admin user with access to all admin features, you can add any config paths to allowed list.

This PR display all copy links only in dev mode because I supposed that there are useless when you are using the backend as a normal user, not as a dev user.

luigifab avatar Apr 09 '24 16:04 luigifab

I've checked out the PR, but the new feature doesn't show up in every section of system/config and in permissions. Also, when clicking, the path is not copied (Firefox)

demo if i click on config nothing is copied

Nothing appears here: demo2 roles

I've disabled all caches and also re-logged in to the backend

empiricompany avatar Apr 30 '24 09:04 empiricompany

I think https://github.com/OpenMage/magento-lts/pull/3960 will be merged before this one and this one will have to be slightly adjusted, for example using the copy icon and the js functions ;-)

fballiano avatar Apr 30 '24 20:04 fballiano

I agree with @fballiano, this PR needs to incorporate what was done in PR #3960.

kiatng avatar Jun 05 '24 05:06 kiatng

Yes, but I can't do it for now.

luigifab avatar Jun 05 '24 14:06 luigifab