Skip to content

Commit

Permalink
Merge pull request #11556 from nextcloud/fix/11543/fix-nested-modals
Browse files Browse the repository at this point in the history
fix(modal): mount nested modals inside global modals
  • Loading branch information
Antreesy authored Feb 12, 2024
2 parents eeb71fd + b939b26 commit 9dc0ff0
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</NcButton>
<NcActions v-if="hasSelected"
type="primary"
:container="container"
container=".participants-editor__buttons"
:menu-name="t('spreed', 'Assign')">
<NcActionButton v-for="(item, index) in assignments"
:key="index"
Expand All @@ -91,7 +91,7 @@
<NcDialog :open.sync="showDialog"
:name="t('spreed','Delete breakout rooms')"
:message="dialogMessage"
:container="container">
container=".participants-editor">
<template #actions>
<NcButton type="tertiary" @click="toggleShowDialog">
{{ t('spreed', 'Cancel') }}
Expand Down Expand Up @@ -385,4 +385,9 @@ export default {
.delete {
margin-right: auto;
}

// TODO remove after https://github.com/nextcloud-libraries/nextcloud-vue/issues/5228
:deep(.modal-wrapper--small .modal-container) {
width: 400px !important;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
:conversation-name="conversationName"
:permissions="conversationPermissions"
:loading="loading"
nested-container=".conversation-permissions-editor"
@close="handleClosePermissionsEditor"
@submit="handleSubmitPermissions" />
</div>
Expand Down
9 changes: 7 additions & 2 deletions src/components/ConversationSettings/DangerZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
:open.sync="isDeleteConversationDialogOpen"
:name="t('spreed','Delete Conversation')"
:message="deleteConversationDialogMessage"
:container="container">
container=".danger-zone">
<template #actions>
<NcButton type="tertiary" @click="toggleShowDeleteConversationDialog">
{{ t('spreed', 'No') }}
Expand All @@ -77,7 +77,7 @@
:open.sync="isDeleteChatDialogOpen"
:name="t('spreed','Delete all chat messages')"
:message="deleteChatDialogMessage"
:container="container">
container=".danger-zone">
<template #actions>
<NcButton type="tertiary" @click="toggleShowDeleteChatDialog">
{{ t('spreed', 'No') }}
Expand Down Expand Up @@ -235,6 +235,11 @@ h4 {
color: var(--color-text-maxcontrast);
}
&__dialog {
// TODO remove after https://github.com/nextcloud-libraries/nextcloud-vue/issues/5228
:deep(.modal-wrapper--small .modal-container) {
width: 400px !important;
}

:deep(.modal-container) {
padding-block: 4px 8px;
padding-inline: 12px 8px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</template>
</NcButton>
<NcModal v-if="logModal"
:container="container"
container=".matterbridge-settings"
@close="closeLogModal">
<div class="modal__content">
<NcTextArea :value="processLog"
Expand All @@ -88,7 +88,7 @@
:type="types[part.type]"
:editing="part.editing"
:editable="!enabled"
:container="container"
container=".matterbridge-settings"
@edit-clicked="onEditClicked(i)"
@delete-part="onDelete(i)" />
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
-->

<template>
<NcModal ref="translate-modal" size="large" @close="$emit('close')">
<NcModal ref="translate-modal"
size="large"
:container="container"
@close="$emit('close')">
<div v-if="isMounted" class="translate-dialog">
<h2> {{ t('spreed', 'Translate message') }} </h2>
<div class="translate-dialog__wrapper">
Expand Down Expand Up @@ -128,6 +131,10 @@ export default {
},

computed: {
container() {
return this.$store.getters.getMainContainerSelector()
},

userLanguage() {
return navigator.language.substring(0, 2)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<div v-if="getFilteredDetails(index).length > 0 || selfHasVotedOption(index)"
class="results__option__details">
<PollVotersDetails v-if="details"
:container="container"
:details="getFilteredDetails(index)" />
<p v-if="selfHasVotedOption(index)" class="results__option-subtitle">
{{ t('spreed', 'You voted for this option') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->

<template>
<NcPopover class="poll-voters-details" trigger="hover">
<NcPopover class="poll-voters-details" trigger="hover" :container="container">
<template #trigger>
<NcButton type="tertiary-no-background"
:aria-label="t('spreed','Voted participants')"
Expand Down Expand Up @@ -78,6 +78,11 @@ export default {
type: Array,
required: true,
},

container: {
type: String,
required: true,
}
},

setup() {
Expand Down
11 changes: 10 additions & 1 deletion src/components/PermissionsEditor/PermissionsEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ export default {
default: '',
},

nestedContainer: {
type: String,
default: null,
},

/**
* The conversation's name. Don't provide this when modifying
* participants' permissions.
Expand Down Expand Up @@ -148,7 +153,7 @@ export default {

computed: {
container() {
return this.$store.getters.getMainContainerSelector()
return this.nestedContainer ?? this.$store.getters.getMainContainerSelector()
},

modalTitle() {
Expand Down Expand Up @@ -262,4 +267,8 @@ export default {
margin: 0 auto;
}

// TODO remove after https://github.com/nextcloud-libraries/nextcloud-vue/issues/5228
:deep(.modal-wrapper--small .modal-container) {
width: 400px !important;
}
</style>

0 comments on commit 9dc0ff0

Please sign in to comment.