Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable27] Hide message expiration set-up for non-moderators #10492

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@
<NotificationsSettings :conversation="conversation" />
</NcAppSettingsSection>

<NcAppSettingsSection id="conversation-settings"
<NcAppSettingsSection v-if="canFullModerate"
id="conversation-settings"
:title="t('spreed', 'Moderation')">
<ListableSettings v-if="canFullModerate"
:token="token" />
<LinkShareSettings v-if="canFullModerate"
ref="linkShareSettings" />
<ListableSettings :token="token" />
<LinkShareSettings ref="linkShareSettings" />
<ExpirationSettings :token="token" can-full-moderate />
</NcAppSettingsSection>
<NcAppSettingsSection v-else
id="conversation-settings"
:title="t('spreed', 'Setup summary')">
<ExpirationSettings :token="token" />
</NcAppSettingsSection>

Expand Down
35 changes: 27 additions & 8 deletions src/components/ConversationSettings/ExpirationSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,26 @@
<div class="app-settings-section__hint">
{{ t('spreed', 'Chat messages can be expired after a certain time. Note: Files shared in chat will not be deleted for the owner, but will no longer be shared in the conversation.') }}
</div>
<NcSelect :value="selectedOption"
:options="expirationOptions"
label="label"
close-on-select
:clearable="false"
@option:selected="changeExpiration" />

<template v-if="canFullModerate">
<label for="moderation_settings_message_expiration" class="app-settings-section__label">
{{ t('spreed', 'Set message expiration') }}
</label>
<NcSelect id="moderation_settings_message_expiration"
:value="selectedOption"
:options="expirationOptions"
label="label"
close-on-select
:clearable="false"
@option:selected="changeExpiration" />
</template>

<template v-else>
<h5 class="app-settings-section__subtitle">
{{ t('spreed', 'Current message expiration') }}
</h5>
<p>{{ selectedOption.label }}</p>
</template>
</div>
</template>

Expand All @@ -53,6 +67,11 @@ export default {
type: String,
default: null,
},

canFullModerate: {
type: Boolean,
default: false,
},
},

data() {
Expand Down Expand Up @@ -132,7 +151,7 @@ export default {
</script>

<style lang="scss" scoped>
:deep(.mx-input) {
margin: 0;
.app-settings-section__label {
display: block;
}
</style>