Skip to content
Snippets Groups Projects

Add compare selected button to top

Merged Amjad Khan requested to merge issue/diff-3183380:3183380-add-compare-revisions into 8.x-1.x
3 unresolved threads
  • Extracted the button into a variable
  • Refectored bottom button with extracted var

Closes #3183380

Merge request reports

Merge request pipeline passed with warnings for 11e804f4

Approval is optional
Code Quality is loading
Test summary results are being parsed

Merged by Adam BramleyAdam Bramley 11 months ago (May 9, 2024 10:52pm UTC)

Merge details

  • Changes merged into with a7919c4d.
  • Did not delete the source branch.

Pipeline #169209 passed with warnings

Pipeline passed with warnings for a7919c4d on 8.x-1.x

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
200 200
201 // Submit button for the form.
202 $compare_revision_submit = [
203 '#type' => 'submit',
204 '#button_type' => 'primary',
205 '#value' => t('Compare selected revisions'),
206 '#attributes' => [
207 'class' => [
208 'diff-button',
209 ],
210 ],
211 ];
212
213 // If the form is too long add a submit button on top of the screen.
214 if ($revision_count > 5) {
215 // This automatically satisfy if the revisions are greater then 1.
  • 299 317
    300 318 // Allow comparisons only if there are 2 or more revisions.
    301 319 if ($revision_count > 1) {
    302 $build['submit'] = [
    303 '#type' => 'submit',
    304 '#button_type' => 'primary',
    305 '#value' => t('Compare selected revisions'),
    306 '#attributes' => [
    307 'class' => [
    308 'diff-button',
    309 ],
    310 ],
    311 ];
    320 $build['submit_bottom'] = $compare_revision_submit;
  • 286 290 }
    287 291 }
    288 292
    293 /**
    294 * Tests pager on diff overview.
    295 */
    296 public function testRevisionOverviewLong() {
  • berliner added 1 commit

    added 1 commit

    • e2c2d5fc - Address feedback: Consolidate tests, rename submit button key, better comments

    Compare with previous version

  • berliner added 1 commit

    added 1 commit

    Compare with previous version

  • Liam Morland added 5 commits

    added 5 commits

    • 208a81a1 - Add compare selected button to top
    • 2b070690 - Add test from patch
    • 40ca3c80 - Set the submit button the same as before (no additional array wrapping)
    • 9ea9bacc - Address feedback: Consolidate tests, rename submit button key, better comments
    • 11e804f4 - Fix the test

    Compare with previous version

  • Please register or sign in to reply
    Loading