Problem/Motivation

The API provided by the Workspace module is very useful for various kinds of tasks, for example node and comment previews and even content moderation could be written on top of a "micro workspace" concept.

Proposed resolution

Given that not every Drupal site needs the full-blown UI for managing workspaces, let's split it into a separate module, just like Views does.

Remaining tasks

Review.

User interface changes

The workspaces UI will be provided in a separate module.

API changes

Nope.

Data model changes

Nope.

Release notes snippet

A new workspaces_ui module has been added which providess workspace module's routes and toolbar integration. This is to allow for alternative user interface implementations in core or contrib.

Sites already using workspaces will have workspaces_ui enabled in an update.

Issue fork drupal-2972622

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

amateescu created an issue. See original summary.

timmillwood’s picture

Instead of having two modules "Workspace" and "Workspace UI", how about moving the core workspace functionality into core, and leaving just the UI in Workspace module? Similar to how all the off canvas parts of Settings Tray module were moved from the module to core? This would make #2972623: Rewrite the node preview functionality on top of workspaces a lot easier to implement.

catch’s picture

Thanks for opening this. I've been wondering whether eventually content_moderation should essentially be an alternative UI using workspaces internally (since it would make issues like #2949412: Nested paragraphs automatically publish, even if the parent is a draft much easier to deal with).

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

amateescu’s picture

Component: workspace.module » workspaces.module

Fix component following module rename.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

amateescu’s picture

Title: Consider splitting the workspace UI into a separate module » Split the workspaces UI into a separate module
Parent issue: » #3486378: [Plan] Allow for / implement simplified content workflow with workspaces

While #2 is a desirable goal, I think the module needs to gain more real-world usage before we can consider moving it to be core API. For now, splitting the UI bits is an easier lift.

amateescu’s picture

Issue summary: View changes
amateescu’s picture

Status: Active » Needs review
catch’s picture

Issue tags: +11.1.0 release notes

We should open a follow-up to move more of the UI scaffolding code over but I like doing the absolute minimum here.

I added a change record. Tagging for release highlights too.

Looks like just the hook_help generic test coverage is the problem now?

catch’s picture

Issue summary: View changes

Added the release note.

amateescu’s picture

Looks like just the hook_help generic test coverage is the problem now?

Yep, and I've already spent way too many hours last night trying to figure out what the problem is. The hook is there, I can access the help page in the UI on my local, but inside the test this line from \Drupal\help\Controller\HelpController::helpPage() returns FALSE:

if ($this->moduleHandler()->hasImplementations('help', $name)) {
catch’s picture

Did you try using a procedural hook_help() implementation?

amateescu’s picture

Yup, I only moved it to an OO hook hoping it would fix stuff, but it didn't.

amateescu’s picture

catch’s picture

gábor hojtsy’s picture

As a core product manager I think this makes sense. It allows us more flexibility in the future to possibly remove the big UI for example from core if we think its not an 80% use case even if content moderation or node preview is still reliant on the API.

Only minor note is the description of the original module now does not reflect what it does? The module does not provide full site previews after this MR.

Allows users to stage content or preview a full site by using multiple workspaces on a single site.

This is minor IMHO but would be still useful to fix to make it easier to understand what's the relation between the two modules. But leaving needs review for more reviews as appropriate.

catch’s picture

Allows users to stage content or preview a full site by using multiple workspaces on a single site.

Change to maybe this?

Provides an API for staging and previewing content in a full site context.

amateescu’s picture

The suggestion from #27 sounds great, pushed it to the MR.

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

RTBC

The approach makes sense to me. It feels a little bit weird to have workspace tests need to enable workspaces_ui but for integration tests the UI is obviously needed.

But one curious observation:

Why don’t I see removals of the new Hooks added to workspaces_ui to support toolbar, etc.

I had expected a big removal from workspaces.module, but there is nothing.

Maybe that is related to the hook_help problem?

amateescu changed the visibility of the branch 2972622-split-workspaces_ui to hidden.

amateescu changed the visibility of the branch 2972622-split-workspaces_ui to active.

amateescu’s picture

Why don’t I see removals of the new Hooks added to workspaces_ui to support toolbar, etc.

That was because of #3483599: Convert all procedural hook implementations to Hook classes, fixed in https://git.drupalcode.org/project/drupal/-/merge_requests/10147/diffs?c...

  • catch committed e96d7a3a on 11.1.x
    Issue #2972622 by amateescu, catch, gábor hojtsy, fabianx, lauriii:...

catch credited lauriii.

  • catch committed 1f62c939 on 11.x
    Issue #2972622 by amateescu, catch, gábor hojtsy, fabianx, lauriii:...
catch’s picture

Version: 11.x-dev » 11.1.x-dev
Status: Reviewed & tested by the community » Fixed

Thanks this looks good, nice catch on the moved toolbar hook implementation.

Committed/pushed to 11.x and cherry-picked to 11.1.x, thanks!

  • catch committed f8e5acb7 on 11.x
    Issue #2972622 by amateescu, catch, gábor hojtsy, fabianx, lauriii:...

  • catch committed 0c2bd66d on 11.1.x
    Issue #2972622 by amateescu, catch, gábor hojtsy, fabianx, lauriii:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.