Skip to content
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
Port admin delegation selects
Signed-off-by: Christopher Ng <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
Pytal authored and nextcloud-command committed Mar 2, 2023
commit ed8bae0cdfcdfc21e1299d47baaadd5cd0d8d19e
4 changes: 3 additions & 1 deletion apps/settings/lib/Settings/Admin/Delegation.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ private function initSettingState(): void {
$settings = array_merge(
$settings,
array_map(function (IDelegatedSettings $setting) use ($section) {
$sectionName = $section->getName() . ($setting->getName() !== null ? ' - ' . $setting->getName() : '');

Check notice

Code scanning / Psalm

PossiblyNullOperand

Cannot concatenate with a possibly null null|string
return [
'class' => get_class($setting),
'sectionName' => $section->getName() . ($setting->getName() !== null ? ' - ' . $setting->getName() : ''),
'sectionName' => $sectionName,
'id' => mb_strtolower(str_replace(' ', '-', $sectionName)),
'priority' => $section->getPriority(),
];
}, $sectionSettings)
Expand Down
11 changes: 10 additions & 1 deletion apps/settings/src/components/AdminDelegating.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:doc-url="authorizedSettingsDocLink">
<div class="setting-list">
<div v-for="setting in availableSettings" :key="setting.class">
<h3>{{ setting.sectionName }}</h3>
<label :for="setting.id">{{ setting.sectionName }}</label>
<GroupSelect :available-groups="availableGroups" :authorized-groups="authorizedGroups" :setting="setting" />
</div>
</div>
Expand Down Expand Up @@ -32,3 +32,12 @@ export default {
},
}
</script>

<style lang="scss" scoped>
label {
display: block;
font-size: 16px;
margin: 12px 0;
color: var(--color-text-light);
}
</style>
16 changes: 7 additions & 9 deletions apps/settings/src/components/AdminDelegation/GroupSelect.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<template>
<NcMultiselect v-model="selected"
class="group-multiselect"
<NcSelect :input-id="setting.id"
v-model="selected"
class="group-select"
:placeholder="t('settings', 'None')"
track-by="gid"
label="displayName"
:options="availableGroups"
open-direction="bottom"
:multiple="true"
:allow-empty="true" />
:close-on-select="false" />
</template>

<script>
import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import { generateUrl } from '@nextcloud/router'
import axios from '@nextcloud/axios'
import { showError } from '@nextcloud/dialogs'
Expand All @@ -20,7 +19,7 @@ import logger from '../../logger'
export default {
name: 'GroupSelect',
components: {
NcMultiselect,
NcSelect,
},
props: {
availableGroups: {
Expand Down Expand Up @@ -67,8 +66,7 @@ export default {
</script>

<style lang="scss">
.group-multiselect {
.group-select {
width: 100%;
margin-right: 0;
}
</style>
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-admin-delegation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-admin-delegation.js.map

Large diffs are not rendered by default.