diff --git a/src/App.vue b/src/App.vue index 2f6a7877..fdf50acc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,10 +24,11 @@ @@ -55,9 +69,10 @@ import Vue from 'vue' import { NcContent, NcAppContent, NcButton, NcEmptyContent, NcLoadingIcon } from '@nextcloud/vue' -import { CnIndexSidebar } from '@conduction/nextcloud-vue' +import { CnObjectSidebar, CnIndexSidebar } from '@conduction/nextcloud-vue' import { generateUrl, imagePath } from '@nextcloud/router' import MainMenu from './navigation/MainMenu.vue' +import UserSettings from './views/settings/UserSettings.vue' import Modals from './modals/Modals.vue' import Dialogs from './dialogs/Dialogs.vue' import Views from './views/Views.vue' @@ -71,8 +86,10 @@ export default { NcButton, NcEmptyContent, NcLoadingIcon, + CnObjectSidebar, CnIndexSidebar, MainMenu, + UserSettings, Modals, Dialogs, Views, @@ -80,6 +97,7 @@ export default { provide() { return { + objectSidebarState: this.objectSidebarState, sidebarState: this.sidebarState, } }, @@ -87,6 +105,18 @@ export default { data() { return { storesReady: false, + settingsOpen: false, + objectSidebarState: { + active: false, + open: true, + objectType: '', + objectId: '', + title: '', + subtitle: '', + register: '', + schema: '', + hiddenTabs: [], + }, sidebarState: Vue.observable({ active: false, open: true, diff --git a/src/navigation/MainMenu.vue b/src/navigation/MainMenu.vue index 1292bc9b..7eefc004 100644 --- a/src/navigation/MainMenu.vue +++ b/src/navigation/MainMenu.vue @@ -1,6 +1,7 @@ diff --git a/webpack.config.js b/webpack.config.js index 71e3ba4e..7ec70a82 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,7 @@ const path = require('path') const fs = require('fs') const webpackConfig = require('@nextcloud/webpack-vue-config') const { VueLoaderPlugin } = require('vue-loader') +const NodePolyfillPlugin = require('node-polyfill-webpack-plugin') const buildMode = process.env.NODE_ENV const isDev = buildMode === 'development' @@ -28,41 +29,40 @@ webpackConfig.entry = { const localLib = path.resolve(__dirname, '../nextcloud-vue/src') const useLocalLib = fs.existsSync(localLib) -webpackConfig.resolve = { - extensions: ['.ts', '.tsx', '.vue', '.js'], - alias: { - '@': path.resolve(__dirname, 'src'), - ...(useLocalLib ? { '@conduction/nextcloud-vue': localLib } : {}), - // Deduplicate shared packages so the aliased library source uses - // the same instances as the app (prevents dual-Pinia / dual-Vue bugs). - 'vue$': path.resolve(__dirname, 'node_modules/vue'), - 'pinia$': path.resolve(__dirname, 'node_modules/pinia'), - '@nextcloud/vue$': path.resolve(__dirname, 'node_modules/@nextcloud/vue'), - }, +webpackConfig.resolve = webpackConfig.resolve || {} +webpackConfig.resolve.modules = [path.resolve(__dirname, 'node_modules'), 'node_modules'] +webpackConfig.resolve.alias = { + ...(webpackConfig.resolve.alias || {}), + '@': path.resolve(__dirname, 'src'), + ...(useLocalLib ? { '@conduction/nextcloud-vue': localLib } : {}), + // Deduplicate shared packages so the aliased library source uses + // the same instances as the app (prevents dual-Pinia / dual-Vue bugs). + 'vue$': path.resolve(__dirname, 'node_modules/vue'), + 'pinia$': path.resolve(__dirname, 'node_modules/pinia'), + '@nextcloud/vue$': path.resolve(__dirname, 'node_modules/@nextcloud/vue'), } -webpackConfig.module = { - rules: [ - { - test: /\.vue$/, - loader: 'vue-loader', - }, - { - test: /\.ts$/, - loader: 'ts-loader', - exclude: /node_modules/, - options: { appendTsSuffixTo: [/\.vue$/] }, - }, - { - test: /\.css$/, - use: ['style-loader', 'css-loader'], - }, - ], -} +webpackConfig.module.rules.push( + { + test: /\.vue$/, + loader: 'vue-loader', + }, + { + test: /\.ts$/, + loader: 'ts-loader', + exclude: /node_modules/, + options: { appendTsSuffixTo: [/\.vue$/] }, + }, + { + test: /\.css$/, + use: ['style-loader', 'css-loader'], + }, +) -webpackConfig.plugins = [ +webpackConfig.plugins.push( new VueLoaderPlugin(), -] + new NodePolyfillPlugin({ additionalAliases: ['process'] }), +) // Force @nextcloud/dialogs to resolve from this app's node_modules, // preventing the nextcloud-vue submodule's nested deps (Vue 3) from leaking in.