Skip to content
Snippets Groups Projects

#3514079: Added theme negociator to allow contextual links to be rendered in...

Open #3514079: Added theme negociator to allow contextual links to be rendered in...

#3514079: Added theme negociator to allow contextual links to be rendered in the current page theme.

Closes #3514079

Merge request reports

Members who can merge are allowed to add commits.
Approval is optional
Code Quality is loading
Test summary results are being parsed
Metrics reports are loading
Ready to merge by members who can write to the target branch.
  • The source branch is 248 commits behind the target branch.
  • 1 commit will be added to 11.x.
  • Source branch will not be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Lee Rowlands
  • Lee Rowlands
  • Lee Rowlands
  • Looking good - we need some tests here too

  • Lee Rowlands left review comments

    left review comments

  • nicoloye left review comments

    left review comments

  • nicoloye added 1 commit

    added 1 commit

    • 380bba60 - #3514079: Added services injection, cache context and updated controller path...

    Compare with previous version

  • nicoloye added 1 commit

    added 1 commit

    • f1053e87 - #3507031: Added test to check that the theme is correctly passed in the...

    Compare with previous version

  • nicoloye added 1 commit

    added 1 commit

    Compare with previous version

  • nicoloye added 2 commits

    added 2 commits

    Compare with previous version

  • nicoloye added 1 commit

    added 1 commit

    Compare with previous version

  • 180 180 // Perform an AJAX request to let the server render the contextual links
    181 181 // for each of the placeholders.
    182 182 if (uncachedIDs.length > 0) {
    183 const controllerUrl = `contextual/render?theme=${drupalSettings.contextual.theme}`;
    183 184 $.ajax({
    184 url: Drupal.url('contextual/render'),
    185 url: Drupal.url(controllerUrl),
    185 186 type: 'POST',
    186 187 data: { 'ids[]': uncachedIDs, 'tokens[]': uncachedTokens },
    187 188 dataType: 'json',
    188 189 success(results) {
    189 190 Object.entries(results).forEach(([contextualID, html]) => {
    190 191 // Store the metadata.
    191 192 storage.setItem(`Drupal.contextual.${contextualID}`, html);
  • added 1 commit

    • fde52d20 - Issue #3514079 by nicoloye, grimreaper, larowlan: Fix tests + default value.

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Lee Rowlands
  • Lee Rowlands
  • Lee Rowlands
  • Just some minor nits, otherwise looks good to me

  • Lee Rowlands left review comments

    left review comments

  • 180 180 // Perform an AJAX request to let the server render the contextual links
    181 181 // for each of the placeholders.
    182 182 if (uncachedIDs.length > 0) {
    183 const controllerUrl = `contextual/render?theme=${drupalSettings.contextual.theme}`;
    183 184 $.ajax({
    184 url: Drupal.url('contextual/render'),
    185 url: Drupal.url(controllerUrl),
    185 186 type: 'POST',
    186 187 data: { 'ids[]': uncachedIDs, 'tokens[]': uncachedTokens },
    187 188 dataType: 'json',
    188 189 success(results) {
    189 190 Object.entries(results).forEach(([contextualID, html]) => {
    190 191 // Store the metadata.
    191 192 storage.setItem(`Drupal.contextual.${contextualID}`, html);
  • added 1 commit

    • 55b847f3 - Issue #3514079 by nicoloye, grimreaper, larowlan, acbramley: Render contextual...

    Compare with previous version

  • added 1 commit

    • b36b20c7 - Issue #3514079 by nicoloye, grimreaper, larowlan, acbramley: Fix linters

    Compare with previous version

  • 128 133 $this->assertSame($links, _contextual_id_to_links($id));
    129 134 }
    130 135
    136 /**
    137 * Tests the placeholder of contextual links in a specific theme.
    138 *
    139 * @param array $links
    140 * The #contextual_links property value array.
    141 * @param string $id
    142 * The serialized representation of the passed links.
    143 * @param string $theme
    144 * The name of the theme the placeholder should pass to the controller.
    145 *
    146 * @covers \Drupal\contextual\Element\ContextualLinksPlaceholder::preRenderPlaceholder
  • 128 133 $this->assertSame($links, _contextual_id_to_links($id));
    129 134 }
    130 135
    136 /**
    137 * Tests the placeholder of contextual links in a specific theme.
    138 *
    139 * @param array $links
    140 * The #contextual_links property value array.
    141 * @param string $id
    142 * The serialized representation of the passed links.
    143 * @param string $theme
    144 * The name of the theme the placeholder should pass to the controller.
    145 *
    146 * @covers \Drupal\contextual\Element\ContextualLinksPlaceholder::preRenderPlaceholder
    147 *
    148 * @dataProvider contextualLinksDataProvider
  • Stephen Mustgrave left review comments

    left review comments

  • Please register or sign in to reply
    Loading