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
36 changes: 33 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@

<!-- App loaded normally -->
<template v-else-if="storesReady && hasOpenRegisters">
<MainMenu />
<MainMenu @open-settings="settingsOpen = true" />
<UserSettings :open="settingsOpen" @update:open="settingsOpen = $event" />
<Views />
<CnIndexSidebar
v-if="sidebarState.active"
v-if="sidebarState.active && !objectSidebarState.active"
:schema="sidebarState.schema"
:visible-columns="sidebarState.visibleColumns"
:search-value="sidebarState.searchValue"
Expand All @@ -38,6 +39,19 @@
@search="onSidebarSearch"
@columns-change="onSidebarColumnsChange"
@filter-change="onSidebarFilterChange" />

<!-- Object sidebar (files/notes/tags/tasks/audit trail — controlled by CnDetailPage) -->
<CnObjectSidebar
v-if="objectSidebarState.active"
:object-type="objectSidebarState.objectType"
:object-id="objectSidebarState.objectId"
:title="objectSidebarState.title"
:subtitle="objectSidebarState.subtitle"
:register="objectSidebarState.register"
:schema="objectSidebarState.schema"
:hidden-tabs="objectSidebarState.hiddenTabs"
:open.sync="objectSidebarState.open" />

<Modals />
<Dialogs />
</template>
Expand All @@ -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'

Check failure on line 72 in src/App.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

CnObjectSidebar not found in '@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'
Expand All @@ -71,22 +86,37 @@
NcButton,
NcEmptyContent,
NcLoadingIcon,
CnObjectSidebar,
CnIndexSidebar,
MainMenu,
UserSettings,
Modals,
Dialogs,
Views,
},

provide() {
return {
objectSidebarState: this.objectSidebarState,
sidebarState: this.sidebarState,
}
},

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,
Expand Down
16 changes: 16 additions & 0 deletions src/navigation/MainMenu.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<NcAppNavigation>
<NcAppNavigationList>

Check warning on line 3 in src/navigation/MainMenu.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected 1 line break after opening tag (`<NcAppNavigationList>`), but 2 line breaks found

<!-- Dashboard -->
<NcAppNavigationItem
:active="navigationStore.selected === 'dashboard'"
Expand All @@ -23,18 +24,30 @@
</template>
</NcAppNavigationItem>
</NcAppNavigationList>

<NcAppNavigationSettings>
<NcAppNavigationItem
name="Settings"
@click="$emit('open-settings')">
<template #icon>
<Cog :size="20" />
</template>
</NcAppNavigationItem>
</NcAppNavigationSettings>
</NcAppNavigation>
</template>
<script>
import {
NcAppNavigation,
NcAppNavigationList,
NcAppNavigationItem,
NcAppNavigationSettings,
} from '@nextcloud/vue'
import { navigationStore, objectStore } from '../store/store.js'

// Icons
import ViewDashboard from 'vue-material-design-icons/ViewDashboard.vue'
import Cog from 'vue-material-design-icons/Cog.vue'
import OfficeBuildingOutline from 'vue-material-design-icons/OfficeBuildingOutline.vue'
import AccountMultiple from 'vue-material-design-icons/AccountMultiple.vue'
import ApplicationCog from 'vue-material-design-icons/ApplicationCog.vue'
Expand All @@ -58,12 +71,15 @@
*/
export default {
name: 'MainMenu',
emits: ['open-settings'],
components: {

Check warning on line 75 in src/navigation/MainMenu.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

The "components" property should be above the "emits" property on line 74
NcAppNavigation,
NcAppNavigationList,
NcAppNavigationItem,
NcAppNavigationSettings,
// Icons
ViewDashboard,
Cog,
OfficeBuildingOutline,
AccountMultiple,
ApplicationCog,
Expand Down
22 changes: 22 additions & 0 deletions src/views/settings/UserSettings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- SPDX-License-Identifier: EUPL-1.2 -->
<template>
<NcAppSettingsDialog

Check failure on line 3 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
:open="open"

Check failure on line 4 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
:show-navigation="false"

Check failure on line 5 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
:name="t('softwarecatalog', 'Software Catalogus settings')"

Check failure on line 6 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
@update:open="$emit('update:open', $event)">

Check failure on line 7 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
<NcAppSettingsSection id="general" :name="t('softwarecatalog', 'General')">

Check failure on line 8 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
<template #icon><CogIcon :size="20" /></template>

Check warning on line 9 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected 1 line break after opening tag (`<template>`), but no line breaks found

Check failure on line 9 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
<p>{{ t('softwarecatalog', 'User preferences will appear here.') }}</p>

Check failure on line 10 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
</NcAppSettingsSection>

Check failure on line 11 in src/views/settings/UserSettings.vue

View workflow job for this annotation

GitHub Actions / quality / Vue Quality (eslint)

Expected "\t" character, but found " " character
</NcAppSettingsDialog>
</template>
<script>
import { NcAppSettingsDialog, NcAppSettingsSection } from '@nextcloud/vue'
import CogIcon from 'vue-material-design-icons/Cog.vue'
export default {
name: 'UserSettings',
components: { NcAppSettingsDialog, NcAppSettingsSection, CogIcon },
props: { open: { type: Boolean, default: false } },
}
</script>
62 changes: 31 additions & 31 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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.
Expand Down
Loading