Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timmillwood created an issue. See original summary.

timmillwood’s picture

Status: Active » Needs review
FileSize
1.08 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2939490-2.patch, failed testing. View results

jeqq’s picture

+++ b/src/Entity/Form/ReplicationForm.php
@@ -107,6 +107,12 @@ class ReplicationForm extends ContentEntityForm {
+      '#title' => $this->t('Archive workspace after deployment.'),

Let's change the title to "Archive workspace after successful deployment.", or even better will be to add a description that says the workspace will be archived if the deployment will finish with success. Also the description can say that the workspace will be unset from being a target for other workspaces.

jeqq’s picture

Issue summary: View changes
FileSize
32.96 KB

@timmillwood I think it would be better to make the form unchecked by default and change the weight, archive form first and conflicts last.

jeqq’s picture

Actually probably it's better to keep current weight.

jeqq’s picture

Some form and success message adjustments.

Form:

Message:

jeqq’s picture

Don't allow a deployment to be re-deployed if source or target has been archived and remove the edit entity form.

jeqq’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: 2939490-8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

timmillwood’s picture

  1. +++ b/deploy.links.task.yml
    @@ -8,11 +8,6 @@ entity.replication.canonical:
    -entity.replication.edit_form:
    
    +++ b/deploy.module
    @@ -59,12 +59,10 @@ function deploy_entity_type_alter(array &$entity_types) {
    -      'edit' => 'Drupal\deploy\Entity\Form\ReplicationForm',
    ...
    -    $replication->setLinkTemplate('edit-form', '/admin/structure/deployment/{replication}/edit');
    

    I was confused by this at first, but it doesn't make sense to be able to edit a replication!

    +1

  2. +++ b/src/Entity/Form/ReplicationForm.php
    @@ -107,6 +108,15 @@ class ReplicationForm extends ContentEntityForm {
    +        '#default_value' => FALSE,
    

    I'm undecided on the default, maybe worth checking with Dick, Jozef, and Luca?

  3. +++ b/src/Form/ReplicationActionForm.php
    @@ -125,10 +126,16 @@ class ReplicationActionForm extends FormBase {
    +      $form['message'] = $this->generateMessageRenderArray('warning', 'This deployment cannot be re-deployed because source or target workspace has been archived.');
    

    Might be nice if we can work out which workspace has been archived?

jeqq’s picture

1. Yes, it looked strange to me that we have that edit form.
2. I'm more for the unchecked default value, because archiving workspaces is not a common functionality people are looking for when using Deploy module. Many have just 2-3 workspaces and deploy content between them all the time. Also users can accidentally archive workspaces, even they don't want that, doing that accidentally will be really annoying.
3. Yes, I think we can do that.

jeqq’s picture

Status: Needs work » Needs review
FileSize
6.16 KB
1.28 KB

Fixed 3. from #11

Status: Needs review » Needs work

The last submitted patch, 13: 2939490-12.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jeqq’s picture

jeqq’s picture

Status: Needs work » Needs review
FileSize
7.07 KB
0 bytes

Redirect to fronpage after submitting deploy form. The success message shows which workspace has been archived and which has been set as active after archiving the active one.

Status: Needs review » Needs work

The last submitted patch, 16: 2939490-16.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

timmillwood’s picture

  1. +++ b/src/Entity/Form/ReplicationForm.php
    @@ -107,6 +109,15 @@ class ReplicationForm extends ContentEntityForm {
    +    if ($source_workspace->id() != \Drupal::getContainer()->getParameter('workspace.default')) {
    

    I added a new method in Multiversion so you could now just do !$source_workspace->isDefaultWorkspace() here.

  2. +++ b/src/Entity/Form/ReplicationForm.php
    @@ -107,6 +109,15 @@ class ReplicationForm extends ContentEntityForm {
    +        '#description' => $this->t('If selected and deployment finish with success, the workspace will be archived.'),
    

    The wording here doesn't quite sound right. Maybe, "The workspace will be archived on successful deployment."?

  3. +++ b/src/Entity/Form/ReplicationForm.php
    @@ -156,7 +167,26 @@ class ReplicationForm extends ContentEntityForm {
    +        if ($form_state->hasValue('archive') && $form_state->getValue('archive') == TRUE) {
    

    We can use === TRUE here.

jeqq’s picture

Addressed 1. and 2., 3. didn't change because the value is 1 when the checkbox is checked.

jeqq’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 19: 2939490-19.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

timmillwood’s picture

Status: Needs work » Reviewed & tested by the community

ok, looks good!

  • jeqq committed 2508300 on 8.x-1.x authored by timmillwood
    Issue #2939490 by jeqq, timmillwood: Unpublish workspaces on deployment
    
jeqq’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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