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

fix(settings): Migrate away from NcAppNavigationCounter #39102

Merged
merged 1 commit into from
Jul 2, 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
27 changes: 22 additions & 5 deletions apps/settings/src/components/GroupListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
:menu-open="openGroupMenu"
@update:menuOpen="handleGroupMenuOpen">
<template #counter>
<NcCounterBubble v-if="count">
<NcCounterBubble v-if="count"
:type="active ? 'highlighted' : undefined">
{{ count }}
</NcCounterBubble>
</template>
Expand Down Expand Up @@ -67,18 +68,34 @@ export default {
NcAppNavigationItem,
},
props: {
/**
* If this group is currently selected
*/
active: {
type: Boolean,
required: true,
},
/**
* Number of members within this group
*/
count: {
type: Number,
required: true,
},
/**
* Identifier of this group
*/
id: {
type: String,
required: true,
},
/**
* Title of this group
*/
title: {
type: String,
required: true,
},
count: {
type: Number,
required: false,
},
},
data() {
return {
Expand Down
10 changes: 5 additions & 5 deletions apps/settings/src/views/Apps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
:to="{ name: 'apps-category', params: { category: 'updates' } }"
icon="icon-download"
:title="$options.APPS_SECTION_ENUM.updates">
<NcAppNavigationCounter slot="counter">
{{ updateCount }}
</NcAppNavigationCounter>
<template #counter>
<NcCounterBubble>{{ updateCount }}</NcCounterBubble>
</template>
</NcAppNavigationItem>
<NcAppNavigationItem id="app-category-your-bundles"
:to="{ name: 'apps-category', params: { category: 'app-bundles' } }"
Expand Down Expand Up @@ -141,11 +141,11 @@ import VueLocalStorage from 'vue-localstorage'

import NcAppContent from '@nextcloud/vue/dist/Components/NcAppContent.js'
import NcAppNavigation from '@nextcloud/vue/dist/Components/NcAppNavigation.js'
import NcAppNavigationCounter from '@nextcloud/vue/dist/Components/NcAppNavigationCounter.js'
import NcAppNavigationItem from '@nextcloud/vue/dist/Components/NcAppNavigationItem.js'
import NcAppNavigationSpacer from '@nextcloud/vue/dist/Components/NcAppNavigationSpacer.js'
import NcAppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar.js'
import NcAppSidebarTab from '@nextcloud/vue/dist/Components/NcAppSidebarTab.js'
import NcCounterBubble from '@nextcloud/vue/dist/Components/NcCounterBubble.js'
import NcContent from '@nextcloud/vue/dist/Components/NcContent.js'

import AppList from '../components/AppList.vue'
Expand All @@ -166,9 +166,9 @@ export default {
AppDetails,
AppList,
NcAppNavigation,
NcAppNavigationCounter,
NcAppNavigationItem,
NcAppNavigationSpacer,
NcCounterBubble,
AppScore,
NcAppSidebar,
NcAppSidebarTab,
Expand Down
29 changes: 18 additions & 11 deletions apps/settings/src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,23 @@
:title="t('settings', 'Active users')"
:to="{ name: 'users' }"
icon="icon-contacts-dark">
<NcAppNavigationCounter v-if="userCount > 0" slot="counter">
{{ userCount }}
</NcAppNavigationCounter>
<template #counter>
<NcCounterBubble :type="!selectedGroupDecoded ? 'highlighted' : undefined">
{{ userCount }}
</NcCounterBubble>
</template>
</NcAppNavigationItem>
<NcAppNavigationItem v-if="settings.isAdmin"
id="admin"
:exact="true"
:title="t('settings', 'Admins')"
:to="{ name: 'group', params: { selectedGroup: 'admin' } }"
icon="icon-user-admin">
<NcAppNavigationCounter v-if="adminGroupMenu.count" slot="counter">
{{ adminGroupMenu.count }}
</NcAppNavigationCounter>
<template v-if="adminGroupMenu.count > 0" #counter>
<NcCounterBubble :type="selectedGroupDecoded === 'admin' ? 'highlighted' : undefined">
{{ adminGroupMenu.count }}
</NcCounterBubble>
</template>
</NcAppNavigationItem>

<!-- Hide the disabled if none, if we don't have the data (-1) show it -->
Expand All @@ -69,15 +73,18 @@
:title="t('settings', 'Disabled users')"
:to="{ name: 'group', params: { selectedGroup: 'disabled' } }"
icon="icon-disabled-users">
<NcAppNavigationCounter v-if="disabledGroupMenu.usercount > 0" slot="counter">
{{ disabledGroupMenu.usercount }}
</NcAppNavigationCounter>
<template v-if="disabledGroupMenu.usercount > 0" #counter>
<NcCounterBubble :type="selectedGroupDecoded === 'disabled' ? 'highlighted' : undefined">
{{ disabledGroupMenu.usercount }}
</NcCounterBubble>
</template>
</NcAppNavigationItem>

<NcAppNavigationCaption v-if="groupList.length > 0" :title="t('settings', 'Groups')" />
<GroupListItem v-for="group in groupList"
:id="group.id"
:key="group.id"
:active="selectedGroupDecoded === group.id"
:title="group.title"
:count="group.count" />
</template>
Expand Down Expand Up @@ -137,12 +144,12 @@ import VueLocalStorage from 'vue-localstorage'
import NcAppContent from '@nextcloud/vue/dist/Components/NcAppContent.js'
import NcAppNavigation from '@nextcloud/vue/dist/Components/NcAppNavigation.js'
import NcAppNavigationCaption from '@nextcloud/vue/dist/Components/NcAppNavigationCaption.js'
import NcAppNavigationCounter from '@nextcloud/vue/dist/Components/NcAppNavigationCounter.js'
import NcAppNavigationItem from '@nextcloud/vue/dist/Components/NcAppNavigationItem.js'
import NcAppNavigationNew from '@nextcloud/vue/dist/Components/NcAppNavigationNew.js'
import NcAppNavigationNewItem from '@nextcloud/vue/dist/Components/NcAppNavigationNewItem.js'
import NcAppNavigationSettings from '@nextcloud/vue/dist/Components/NcAppNavigationSettings.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcCounterBubble from '@nextcloud/vue/dist/Components/NcCounterBubble.js'
import NcContent from '@nextcloud/vue/dist/Components/NcContent.js'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'

Expand All @@ -163,12 +170,12 @@ export default {
NcAppContent,
NcAppNavigation,
NcAppNavigationCaption,
NcAppNavigationCounter,
NcAppNavigationItem,
NcAppNavigationNew,
NcAppNavigationNewItem,
NcAppNavigationSettings,
NcCheckboxRadioSwitch,
NcCounterBubble,
NcContent,
NcSelect,
Plus,
Expand Down
2 changes: 2 additions & 0 deletions dist/2246-2246.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/2246-2246.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/691-691.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/691-691.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/settings-apps-view-7418.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-apps-view-7418.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-users-8351.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/settings-users-8351.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/*! For license information please see NcAppNavigationSettings.js.LICENSE.txt */

/*! For license information please see NcCounterBubble.js.LICENSE.txt */

/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
Expand Down
2 changes: 1 addition & 1 deletion dist/settings-users-8351.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

Loading