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('modal-title').should('contain', 'Sichtbarkeit anpassen');
|
||||
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">
|
||||
<radiobutton
|
||||
:checked="!restricted"
|
||||
data-cy="select-option"
|
||||
label="Raumeinträge sind für alle Lernenden sichtbar"
|
||||
@input="restrict(false)"/>
|
||||
<radiobutton
|
||||
:checked="restricted"
|
||||
data-cy="select-option"
|
||||
label="Lernende sehen nur die eigenen Beiträge"
|
||||
@input="restrict(true)"/>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
|
|
@ -41,8 +53,14 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
select(restricted) {
|
||||
restrict(restricted) {
|
||||
this.restricted = restricted;
|
||||
},
|
||||
confirm() {
|
||||
this.$modal.confirm(this.restricted);
|
||||
},
|
||||
cancel() {
|
||||
this.$modal.cancel();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@
|
|||
changeVisibility() {
|
||||
console.log('changeVisibility');
|
||||
this.$modal.open('change-visibility', {restricted: false})
|
||||
.then(() => {
|
||||
console.log('yay');
|
||||
.then((res) => {
|
||||
console.log('yay', res);
|
||||
})
|
||||
.catch(() => {
|
||||
console.log('nay');
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ const ModalPlugin = {
|
|||
this._reject = reject;
|
||||
});
|
||||
},
|
||||
confirm: () => {
|
||||
confirm: (res) => {
|
||||
reset();
|
||||
this._resolve();
|
||||
this._resolve(res);
|
||||
},
|
||||
cancel: () => {
|
||||
reset();
|
||||
|
|
|
|||
Loading…
Reference in New Issue