Skip to content
Open
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
6 changes: 3 additions & 3 deletions apps/settings/src/main-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import { getCSPNonce } from '@nextcloud/auth'
import Vue from 'vue'
import SettingsNavigation from './views/SettingsNavigation.vue'
import SettingsApp from './views/SettingsApp.vue'

__webpack_nonce__ = getCSPNonce()

const app = new Vue(SettingsNavigation)
app.$mount('#app-navigation')
const app = new Vue(SettingsApp)
app.$mount('#settings-app')
8 changes: 4 additions & 4 deletions apps/settings/src/main-users-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import VTooltipPlugin from 'v-tooltip'
import Vue from 'vue'
import Vuex from 'vuex'
import { sync } from 'vuex-router-sync'
import SettingsApp from './views/SettingsApp.vue'
import UserManagement from './views/UserManagement.vue'
import router from './router/index.ts'
import { useStore } from './store/index.js'

Expand All @@ -37,10 +37,10 @@ const pinia = createPinia()
// Migrate legacy local storage settings to the database
store.dispatch('migrateLocalStorage')

export default new Vue({
const App = Vue.extend(UserManagement)
const app = new App({
router,
store,
pinia,
render: (h) => h(SettingsApp),
el: '#content',
})
app.$mount('#content')
9 changes: 1 addition & 8 deletions apps/settings/src/router/routes.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
/**
/*
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import type { RouteConfig } from 'vue-router'

const UserManagement = () => import(/* webpackChunkName: 'settings-users' */'../views/UserManagement.vue')
const UserManagementNavigation = () => import(/* webpackChunkName: 'settings-users' */'../views/UserManagementNavigation.vue')

const routes: RouteConfig[] = [
{
name: 'users',
path: '/:index(index.php/)?settings/users',
components: {
default: UserManagement,
navigation: UserManagementNavigation,
},
props: true,
children: [
{
Expand Down
17 changes: 13 additions & 4 deletions apps/settings/src/views/SettingsApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@
-->

<template>
<NcContent app-name="settings">
<router-view name="navigation" />
<router-view />
<router-view name="sidebar" />
<NcContent :class="$style.settingsApp" appName="settings">
<SettingsNavigation />
<SettingsContentWrapper />
</NcContent>
</template>

<script setup lang="ts">
import NcContent from '@nextcloud/vue/components/NcContent'
import SettingsContentWrapper from './SettingsContentWrapper.vue'
import SettingsNavigation from './SettingsNavigation.vue'
</script>

<style module>
:global(#content):has(.settingsApp) {
margin: 0;
width: 100%;
height: 100%;
}
</style>
22 changes: 22 additions & 0 deletions apps/settings/src/views/SettingsContentWrapper.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->

<template>
<NcAppContent>
<div ref="contentMain" />
</NcAppContent>
</template>

<script setup lang="ts">
import { NcAppContent } from '@nextcloud/vue'
import { onMounted, ref } from 'vue'

const contentMain = ref<HTMLDivElement>()
onMounted(() => {
const realElement = document.getElementById('original-settings-content')!
contentMain.value!.replaceChildren(...realElement.childNodes)
realElement.parentNode!.removeChild(realElement)
})
</script>
17 changes: 12 additions & 5 deletions apps/settings/src/views/UserManagement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@
-->

<template>
<NcAppContent :page-heading="pageHeading">
<UserList
:selected-group="selectedGroupDecoded"
:external-actions="externalActions" />
</NcAppContent>
<NcContent app-name="settings">
<UserManagementNavigation />
<NcAppContent :page-heading="pageHeading">
<UserList
:selected-group="selectedGroupDecoded"
:external-actions="externalActions" />
</NcAppContent>
</NcContent>
</template>

<script>
import { emit } from '@nextcloud/event-bus'
import { translate as t } from '@nextcloud/l10n'
import { defineComponent } from 'vue'
import NcAppContent from '@nextcloud/vue/components/NcAppContent'
import NcContent from '@nextcloud/vue/components/NcContent'
import UserList from '../components/UserList.vue'
import UserManagementNavigation from './UserManagementNavigation.vue'

export default defineComponent({
name: 'UserManagement',

components: {
NcContent,
NcAppContent,
UserList,
UserManagementNavigation,
},

data() {
Expand Down
6 changes: 3 additions & 3 deletions apps/settings/templates/settings/frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
style('settings', 'settings');
?>

<div id="app-navigation"></div>
<main id="app-content" <?php if (!empty($_['activeSectionId'])) { ?> data-active-section-id="<?php print_unescaped($_['activeSectionId']) ?>" <?php } if (!empty($_['activeSectionType'])) { ?> data-active-section-type="<?php print_unescaped($_['activeSectionType']) ?>" <?php } ?>>
<div id="settings-app"></div>
<div class="hidden-visually" id="original-settings-content" <?php if (!empty($_['activeSectionId'])) { ?> data-active-section-id="<?php print_unescaped($_['activeSectionId']) ?>" <?php } if (!empty($_['activeSectionType'])) { ?> data-active-section-type="<?php print_unescaped($_['activeSectionType']) ?>" <?php } ?>>
Comment thread
pringelmann marked this conversation as resolved.
<?php print_unescaped($_['content']); ?>
</main>
</div>
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-main.js

Large diffs are not rendered by default.

Loading
Loading