- Issue created by @recrit
- Merge request !9Issue #3335950: Move Access Tokens UI to an entity Local Task / Tab β (Open) created by recrit
- Status changed to Needs review
about 2 years ago 9:34pm 23 January 2023 - πΊπΈUnited States recrit
Attached is a static patch of MR 9 that can be used for builds.
The changes made:- Adds an entity local task / tab for the access tokens UI.
- Adds a config setting to enable the new local task. This config setting was added to be less obtrusive for existing sites using access_unpublished. Ideally, this config setting should be removed and then the entity edit form's access tokens fieldset should be removed - this would leave the only UI to be on the new local task.
- πΊπΈUnited States recrit
Updated static patch of MR 9 to manage access tokens on a local task or the entity edit form, but not both.
- πΊπΈUnited States dwisnousky
#6 worked for us! Going to create a patch off of the MR diff to be safe. Nice work! Thank you!
- last update
over 1 year ago 11 pass - π¬π§United Kingdom smaz England, UK
I've been using patch #9 in production for around 2 months now on a very active site & had no issues.
Having a look at the code in more detail, just a couple of minor nitpicks:
+/** + * Implements hook_entity_type_alter(). + */ +function access_unpublished_entity_type_alter(array &$entity_types) { + // Provide link templates for the access-tokens route on all applicable + // entity types. + /** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */ + foreach ($entity_types as $entity_type) { + if (AccessUnpublished::applicableEntityType($entity_type) && + $entity_type->hasLinkTemplate('canonical')) { + if (!$entity_type->hasLinkTemplate('access-tokens')) { + $entity_type->setLinkTemplate('access-tokens', $entity_type->getLinkTemplate('canonical') . '/access-tokens'); + } + } + } +}
AccessUnpublished::applicableEntityType already checks for the entity type having the canonical link template, so we probably don't need to check that here too?
+ * Build the access token overview form for the provied entity.
Typo in provided* Subscriber for entity access_unpublish routes.
I think this should be access_unpublishedApart from that, all seems ok - will try to update the merge request with the above.
- last update
over 1 year ago 11 pass - last update
over 1 year ago 11 pass - πΊπΈUnited States recrit
adding a static patch of MR9 for builds to use.
- Status changed to RTBC
over 1 year ago 2:51pm 21 July 2023 - πΊπΈUnited States DamienMcKenna NH, USA
While this works well, I think it might be better to rename the tab to something more meaningful than "Access tokens".
- πΊπΈUnited States generalredneck Texas, USA πΊπΈ
@DamienMcKenna,
You have any thoughts? I noodled on a name for a while. Access Tokens is about as concise/meaningful as we can get without making that tab take up half the page.
Thinking of moving this into the new version and opening a new ticket for "moar better name" :D
- πΊπΈUnited States DamienMcKenna NH, USA
"Unpublished access"? I think the word "token" won't be clear for non-technical users and shouldn't be used.
- πΊπΈUnited States generalredneck Texas, USA πΊπΈ
I could get behind that. Not much longer. I was hung up on having "token" in there somewhere to describe what the list would contain.
- Status changed to Needs work
8 months ago 12:02pm 30 June 2024 - πΊπΈUnited States generalredneck Texas, USA πΊπΈ
It might be good to have a task to rename the feature in other places, such as the tab on the content overview page. Going to put this in needs work for the tab name so i can at least remember we need to do this. Got this listed out in π± 2.0.x Road Map Active
- πΊπΈUnited States recrit
Adding static patch the MR9 for composer builds.