Update room visibility modal with a save button
This commit is contained in:
parent
6dd737a84f
commit
20aceaf162
|
|
@ -79,6 +79,6 @@ describe('The Room Page', () => {
|
||||||
cy.getByDataCy('change-visibility').click();
|
cy.getByDataCy('change-visibility').click();
|
||||||
cy.getByDataCy('modal-title').should('contain', 'Sichtbarkeit anpassen');
|
cy.getByDataCy('modal-title').should('contain', 'Sichtbarkeit anpassen');
|
||||||
cy.getByDataCy('select-option').eq(1).click();
|
cy.getByDataCy('select-option').eq(1).click();
|
||||||
cy.getByDataCy('save').click();
|
cy.getByDataCy('modal-save-button').click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,25 @@
|
||||||
<div class="change-visibility__content">
|
<div class="change-visibility__content">
|
||||||
<radiobutton
|
<radiobutton
|
||||||
:checked="!restricted"
|
:checked="!restricted"
|
||||||
|
data-cy="select-option"
|
||||||
label="Raumeinträge sind für alle Lernenden sichtbar"
|
label="Raumeinträge sind für alle Lernenden sichtbar"
|
||||||
@input="restrict(false)"/>
|
@input="restrict(false)"/>
|
||||||
<radiobutton
|
<radiobutton
|
||||||
:checked="restricted"
|
:checked="restricted"
|
||||||
|
data-cy="select-option"
|
||||||
label="Lernende sehen nur die eigenen Beiträge"
|
label="Lernende sehen nur die eigenen Beiträge"
|
||||||
@input="restrict(true)"/>
|
@input="restrict(true)"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div slot="footer">
|
||||||
|
<a
|
||||||
|
class="button button--primary"
|
||||||
|
data-cy="modal-save-button"
|
||||||
|
@click="confirm">Speichern</a>
|
||||||
|
<a
|
||||||
|
class="button"
|
||||||
|
@click="cancel">Abbrechen</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
</modal>
|
</modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -41,8 +53,14 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
select(restricted) {
|
restrict(restricted) {
|
||||||
this.restricted = restricted;
|
this.restricted = restricted;
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
this.$modal.confirm(this.restricted);
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.$modal.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,8 @@
|
||||||
changeVisibility() {
|
changeVisibility() {
|
||||||
console.log('changeVisibility');
|
console.log('changeVisibility');
|
||||||
this.$modal.open('change-visibility', {restricted: false})
|
this.$modal.open('change-visibility', {restricted: false})
|
||||||
.then(() => {
|
.then((res) => {
|
||||||
console.log('yay');
|
console.log('yay', res);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
console.log('nay');
|
console.log('nay');
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,9 @@ const ModalPlugin = {
|
||||||
this._reject = reject;
|
this._reject = reject;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
confirm: () => {
|
confirm: (res) => {
|
||||||
reset();
|
reset();
|
||||||
this._resolve();
|
this._resolve(res);
|
||||||
},
|
},
|
||||||
cancel: () => {
|
cancel: () => {
|
||||||
reset();
|
reset();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue