@appscode/design-system 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/_video-player.scss +65 -0
- package/base/utilities/_all.scss +7 -5
- package/base/utilities/_colors.scss +377 -0
- package/base/utilities/_customize-bulma.scss +23 -27
- package/base/utilities/_extended.scss +39 -0
- package/base/utilities/{_default.scss → _global.scss} +192 -333
- package/base/utilities/_layouts.scss +19 -0
- package/base/utilities/_mixin.scss +11 -11
- package/base/utilities/_spacing.scss +96 -0
- package/base/utilities/_typography.scss +56 -24
- package/components/_ac-alert-box.scss +205 -263
- package/components/_ac-calendar.scss +4 -4
- package/components/_ac-code-highlight.scss +13 -16
- package/components/_ac-content-layout.scss +165 -165
- package/components/_ac-drag.scss +13 -13
- package/components/_ac-modal.scss +212 -212
- package/components/_ac-options.scss +122 -123
- package/components/_ac-select-box.scss +10 -10
- package/components/_ac-table.scss +503 -502
- package/components/_ac-tabs.scss +65 -61
- package/components/_ac-tags.scss +116 -116
- package/components/_accordion.scss +117 -0
- package/components/_add-card.scss +3 -3
- package/components/_all.scss +35 -28
- package/components/_app-drawer.scss +0 -134
- package/components/_breadcumb.scss +0 -71
- package/components/_buttons.scss +779 -779
- package/components/_card-body-wrapper.scss +5 -5
- package/components/_dashboard-header.scss +0 -115
- package/components/_direct-deploy.scss +8 -8
- package/components/_getkeeper.scss +110 -0
- package/components/_go-to-top.scss +1 -1
- package/components/_graph.scss +10 -10
- package/components/_image-upload.scss +9 -9
- package/components/_input-card.scss +232 -0
- package/components/_input.scss +573 -0
- package/components/_left-sidebar-menu.scss +452 -587
- package/components/_monaco-editor.scss +2 -2
- package/components/{_ac-multi-select.scss → _multi-select.scss} +89 -251
- package/components/_navbar.scss +786 -752
- package/components/_nested-list.scss +3 -3
- package/components/_overview-info.scss +10 -10
- package/components/_overview-page.scss +4 -4
- package/components/_pagination.scss +106 -124
- package/components/_payment-card.scss +21 -21
- package/components/_preloader.scss +1 -1
- package/components/_preview-modal.scss +18 -18
- package/components/_pricing-table.scss +14 -14
- package/components/_progress-bar.scss +73 -86
- package/components/_subscription-card.scss +22 -24
- package/components/_table-of-content.scss +8 -8
- package/components/{_ac-terminal.scss → _terminal.scss} +114 -81
- package/components/_tfa.scss +9 -9
- package/components/_transitions.scss +35 -0
- package/components/_widget-menu.scss +252 -257
- package/components/_wizard.scss +518 -793
- package/components/ac-toaster/_ac-toasted.scss +11 -16
- package/components/bbum/_activities-header.scss +1 -1
- package/components/bbum/_card-team.scss +12 -12
- package/components/bbum/_information-center.scss +21 -23
- package/components/bbum/_left-sidebar.scss +8 -8
- package/components/bbum/_mobile-desktop.scss +16 -21
- package/components/bbum/_post.scss +5 -5
- package/components/bbum/_sign-up-notification.scss +10 -10
- package/components/bbum/_single-post-preview.scss +29 -29
- package/components/bbum/_user-profile.scss +10 -10
- package/components/ui-builder/_ui-builder.scss +221 -31
- package/components/ui-builder/_vue-open-api.scss +565 -7
- package/icons/close-icon.svg +3 -0
- package/layouts/_code-preview.scss +17 -18
- package/main.scss +26 -10
- package/package.json +1 -1
- package/plugins/theme.js +11 -9
- package/plugins/vue-toaster.js +1 -1
- package/vue-components/images/icons/cluster-icon.svg +10 -0
- package/vue-components/images/icons/org-icon.svg +10 -0
- package/vue-components/plugins/time-convert.js +49 -0
- package/vue-components/types/cluster.ts +6 -0
- package/vue-components/types/importFlow.ts +16 -0
- package/vue-components/types/notification.ts +6 -0
- package/vue-components/types/previewYaml.ts +8 -0
- package/vue-components/types/table.ts +55 -0
- package/vue-components/types/theme.ts +10 -0
- package/vue-components/types/user.ts +22 -0
- package/vue-components/v2/banner/Banner.vue +1 -1
- package/vue-components/v2/button/Buttons.vue +1 -1
- package/vue-components/v2/card/Card.vue +1 -1
- package/vue-components/v2/card/OverviewCards.vue +17 -2
- package/vue-components/v2/content/ContentTable.vue +14 -9
- package/vue-components/v2/editor/FilteredFileEditor.vue +2 -2
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +21 -21
- package/vue-components/v2/icons/Ellipsis.vue +2 -1
- package/vue-components/v2/modal/Modal.vue +2 -6
- package/vue-components/v2/navbar/Appdrawer.vue +37 -12
- package/vue-components/v2/navbar/Navbar.vue +3 -3
- package/vue-components/v2/navbar/NavbarItem.vue +3 -1
- package/vue-components/v2/navbar/NavbarItemContent.vue +1 -1
- package/vue-components/v2/navbar/User.vue +5 -22
- package/vue-components/v2/pagination/Pagination.vue +66 -0
- package/vue-components/v2/sidebar/SidebarItem.vue +10 -7
- package/{components/_ac-accordion.scss → vue-components/v3/accordion/Accordion.vue} +40 -6
- package/vue-components/v3/alert/Alert.vue +238 -0
- package/vue-components/v3/alert/Toast.vue +79 -0
- package/vue-components/v3/banner/Banner.vue +10 -0
- package/vue-components/v3/breadcrumbs/Breadcrumb.vue +166 -0
- package/vue-components/v3/button/Button.vue +110 -57
- package/vue-components/v3/button/Buttons.vue +22 -0
- package/vue-components/v3/button/DownloadBtn.vue +31 -0
- package/vue-components/v3/cards/Card.vue +32 -0
- package/vue-components/v3/cards/CardContent.vue +7 -0
- package/vue-components/v3/cards/CardHeader.vue +14 -0
- package/vue-components/v3/cards/Cards.vue +7 -0
- package/vue-components/v3/cards/Cluster.vue +159 -0
- package/vue-components/v3/cards/Counter.vue +39 -0
- package/vue-components/v3/cards/FeatureCard.vue +67 -0
- package/vue-components/v3/cards/FeatureCards.vue +6 -0
- package/vue-components/v3/cards/InfoCard.vue +242 -0
- package/vue-components/v3/cards/Monitoring.vue +90 -0
- package/vue-components/v3/cards/OrgClusterCard.vue +86 -0
- package/vue-components/v3/cards/OverviewCard.vue +28 -0
- package/vue-components/v3/cards/OverviewCards.vue +39 -0
- package/vue-components/v3/cards/Payment.vue +62 -0
- package/vue-components/v3/cards/Vendor.vue +89 -0
- package/vue-components/v3/content/ContentHeader.vue +39 -30
- package/vue-components/v3/content/ContentLayout.vue +20 -0
- package/vue-components/v3/content/ContentTable.vue +44 -58
- package/vue-components/v3/dropdown/DropdownAction.vue +95 -0
- package/vue-components/v3/dropdown/DropdownDivider.vue +2 -0
- package/vue-components/v3/dropdown/DropdownItem.vue +2 -0
- package/vue-components/v3/dropdown/DropdownMenu.vue +85 -91
- package/vue-components/v3/editor/Editor.vue +117 -115
- package/vue-components/v3/editor/FilteredFileEditor.vue +325 -128
- package/vue-components/v3/editor/ResourceKeyValueEditor.vue +73 -94
- package/vue-components/v3/footer/FooterArea.vue +40 -0
- package/vue-components/v3/footer/FooterItem.vue +32 -0
- package/vue-components/v3/footer/FooterItems.vue +15 -0
- package/vue-components/v3/footer/Info.vue +25 -0
- package/vue-components/v3/footer/Status.vue +43 -0
- package/vue-components/v3/footer/Usage.vue +34 -0
- package/vue-components/v3/form/Form.vue +24 -36
- package/vue-components/v3/form/FormFooter.vue +24 -0
- package/vue-components/v3/form/FormFooterControl.vue +7 -0
- package/vue-components/v3/form/FormFooterControls.vue +7 -0
- package/vue-components/v3/form-fields/AcSingleInput.vue +21 -0
- package/vue-components/v3/form-fields/FileUpload.vue +89 -0
- package/vue-components/v3/form-fields/Input.vue +19 -15
- package/vue-components/v3/header/Header.vue +120 -26
- package/vue-components/v3/header/HeaderItem.vue +18 -0
- package/vue-components/v3/header/HeaderItems.vue +4 -0
- package/vue-components/v3/icons/Ellipsis.vue +2 -0
- package/vue-components/v3/loaders/ClusterSwitcherLoader.vue +13 -0
- package/vue-components/v3/loaders/InfoCardLoader.vue +19 -0
- package/vue-components/v3/loaders/ResourceLoader.vue +4 -12
- package/vue-components/v3/loaders/SidebarLoader.vue +4 -12
- package/vue-components/v3/loaders/SingleInfoCardLoader.vue +24 -0
- package/vue-components/v3/modal/Modal.vue +294 -95
- package/vue-components/v3/modals/DeleteConfirmationModal.vue +37 -50
- package/vue-components/v3/modals/JsonShowModal.vue +63 -68
- package/vue-components/v3/navbar/Appdrawer.vue +198 -51
- package/vue-components/v3/navbar/Navbar.vue +139 -0
- package/vue-components/v3/navbar/NavbarItem.vue +103 -0
- package/vue-components/v3/navbar/NavbarItemContent.vue +282 -0
- package/vue-components/v3/navbar/Notification.vue +207 -0
- package/vue-components/v3/navbar/ThemeMode.vue +128 -112
- package/vue-components/v3/navbar/User.vue +394 -267
- package/vue-components/v3/notification/AlertBox.vue +266 -39
- package/vue-components/v3/notification/Notification.vue +50 -44
- package/vue-components/v3/notification/NotificationItem.vue +51 -19
- package/vue-components/v3/option-dots/Options.vue +197 -0
- package/vue-components/v3/pagination/Pagination.vue +216 -102
- package/vue-components/v3/preloader/Preloader.vue +23 -0
- package/vue-components/v3/searchbars/SearchBar.vue +50 -34
- package/vue-components/v3/sidebar/AccentColorPicker.vue +97 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +71 -86
- package/vue-components/v3/sidebar/Sidebar.vue +239 -0
- package/vue-components/v3/sidebar/SidebarBody.vue +14 -0
- package/vue-components/v3/sidebar/SidebarFooter.vue +89 -0
- package/vue-components/v3/sidebar/SidebarHeader.vue +131 -0
- package/vue-components/v3/sidebar/SidebarItem.vue +62 -0
- package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +101 -104
- package/vue-components/v3/sidebar/SidebarMenuList.vue +9 -0
- package/vue-components/v3/sidebar/Steps.vue +152 -0
- package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabs.vue +204 -0
- package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabsLayout.vue +44 -0
- package/vue-components/v3/sidebar/sidebar-tabs/TabsContent.vue +99 -0
- package/vue-components/v3/tab/TabItem.vue +10 -12
- package/vue-components/v3/tab/Tabs.vue +36 -0
- package/vue-components/v3/tab/TabsBody.vue +7 -0
- package/vue-components/v3/table/EmptyTableInfo.vue +8 -0
- package/vue-components/v3/table/FakeTableCell.vue +22 -31
- package/vue-components/v3/table/InfoTable.vue +89 -61
- package/vue-components/v3/table/MultiInfoTable.vue +72 -95
- package/vue-components/v3/table/Table.vue +596 -157
- package/vue-components/v3/table/TableCell.vue +13 -24
- package/vue-components/v3/table/TableContainer.vue +50 -28
- package/vue-components/v3/table/TableRow.vue +65 -87
- package/vue-components/v3/table/table-cell/ArrayCell.vue +94 -103
- package/vue-components/v3/table/table-cell/CellValue.vue +74 -106
- package/vue-components/v3/table/table-cell/GenericCell.vue +43 -42
- package/vue-components/v3/table/table-cell/ObjectCell.vue +91 -101
- package/vue-components/v3/table/table-cell/ValueWithModal.vue +22 -31
- package/vue-components/v3/tabs/EditorTabs.vue +18 -24
- package/vue-components/v3/tag/Tag.vue +16 -12
- package/vue-components/v3/tag/Tags.vue +7 -0
- package/base/utilities/_derived-variables.scss +0 -25
- package/base/utilities/_initial-variables.scss +0 -215
- package/base/utilities/dark-theme.scss +0 -26
- package/components/_ac-card.scss +0 -597
- package/components/_ac-input.scss +0 -876
- package/mixins/stickyContent.js +0 -141
- package/plugins/caching.ts +0 -243
- package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +0 -92
- package/vue-components/v3/modals/LongRunningTasksModal.vue +0 -400
- package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +0 -148
- /package/components/{_ac-report.scss → _report.scss} +0 -0
|
@@ -1,283 +1,250 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent, ref, watch, computed, nextTick } from "vue";
|
|
3
|
+
import HeroiconsCog6Tooth from "~icons/heroicons/cog-6-tooth";
|
|
4
|
+
import HeroiconsWrenchScrewdriver from "~icons/heroicons/wrench-screwdriver";
|
|
5
|
+
import HeroiconsUserGroup from "~icons/heroicons/user-group";
|
|
6
|
+
import HeroiconsChartPie from "~icons/heroicons/chart-pie";
|
|
7
|
+
import HeroiconsPower from "~icons/heroicons/power";
|
|
8
|
+
import HeroiconsCheck from "~icons/heroicons/check";
|
|
9
|
+
|
|
10
|
+
import type { User } from "../../types/user";
|
|
11
|
+
|
|
12
|
+
interface FormatedOrgs extends User {
|
|
13
|
+
isPersonalAccount?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface Props {
|
|
17
|
+
user: User;
|
|
18
|
+
serverDomain?: string;
|
|
19
|
+
accountsDomain?: string;
|
|
20
|
+
showAccountSwitcher?: boolean;
|
|
21
|
+
organizations?: Array<FormatedOrgs>;
|
|
22
|
+
showThemeMode?: boolean;
|
|
23
|
+
isPlatformDomain?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
27
|
+
serverDomain: "",
|
|
28
|
+
accountsDomain: "",
|
|
29
|
+
showAccountSwitcher: false,
|
|
30
|
+
organizations: () => [],
|
|
31
|
+
showThemeMode: false,
|
|
32
|
+
isPlatformDomain: false,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const emit = defineEmits(["set:theme", "on-logout", "activeorg$set"]);
|
|
36
|
+
|
|
37
|
+
const NavbarItem = defineAsyncComponent(
|
|
38
|
+
() => import("../navbar/NavbarItem.vue")
|
|
39
|
+
);
|
|
40
|
+
const NavbarItemContent = defineAsyncComponent(
|
|
41
|
+
() => import("../navbar/NavbarItemContent.vue")
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const ThemeMode = defineAsyncComponent(() => import("../navbar/ThemeMode.vue"));
|
|
45
|
+
|
|
46
|
+
const dropDownStatus = ref("close");
|
|
47
|
+
const dropDownSectionHeight = ref<string | null>(null);
|
|
48
|
+
const dropdownItems = ref(null as { $el: HTMLElement } | null);
|
|
49
|
+
|
|
50
|
+
const formattedOrganizations = computed(() => {
|
|
51
|
+
let activeUser: User | undefined = undefined;
|
|
52
|
+
const filteredList = props.organizations.filter((item) => {
|
|
53
|
+
if (item.username === props.user.username) {
|
|
54
|
+
activeUser = item;
|
|
55
|
+
} else {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (activeUser) filteredList.unshift(activeUser);
|
|
62
|
+
|
|
63
|
+
return filteredList || [];
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const toggleList = () => {
|
|
67
|
+
dropDownStatus.value = dropDownStatus.value === "open" ? "close" : "open";
|
|
68
|
+
nextTick(() => {
|
|
69
|
+
dropdownItems.value?.$el.scrollTo(0, 0);
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const onOrganizationClick = (orgName: string) => {
|
|
74
|
+
dropdownItems.value?.$el.scrollTo(0, 0);
|
|
75
|
+
emit("activeorg$set", orgName);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const onMouseLeave = () => {
|
|
79
|
+
dropDownStatus.value = "close";
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const setTheme = (val: string) => {
|
|
83
|
+
emit("set:theme", val);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
watch(dropDownStatus, (n) => {
|
|
87
|
+
if (n === "open") {
|
|
88
|
+
nextTick(() => {
|
|
89
|
+
const dropDownUl = dropdownItems.value;
|
|
90
|
+
if (dropDownUl)
|
|
91
|
+
dropDownSectionHeight.value = `${dropDownUl.$el.scrollHeight}px`;
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
dropDownSectionHeight.value = null;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
</script>
|
|
98
|
+
|
|
1
99
|
<template>
|
|
2
|
-
<navbar-item>
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
|
6
|
-
<div class="ac-user-profile">
|
|
100
|
+
<navbar-item :modifierClasses="'ac-profile-button'">
|
|
101
|
+
<template #navbar-item>
|
|
102
|
+
<div class="ac-user-profile mr-8">
|
|
7
103
|
<img :src="user.avatar_url" alt="User Photo" />
|
|
8
104
|
</div>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class="
|
|
31
|
-
|
|
32
|
-
>
|
|
33
|
-
|
|
105
|
+
{{ user.full_name || user.username }}
|
|
106
|
+
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
|
107
|
+
</template>
|
|
108
|
+
<!-- <button class="button ac-nav-button ac-profile-button">
|
|
109
|
+
|
|
110
|
+
</button> -->
|
|
111
|
+
|
|
112
|
+
<template #navbar-content>
|
|
113
|
+
<navbar-item-content class="navbar-dropdown-wrapper">
|
|
114
|
+
<div
|
|
115
|
+
v-if="user.username"
|
|
116
|
+
class="user-profile-wrapper"
|
|
117
|
+
@mouseleave="onMouseLeave()"
|
|
118
|
+
>
|
|
119
|
+
<div class="profile-area">
|
|
120
|
+
<div class="profile-photo">
|
|
121
|
+
<img
|
|
122
|
+
:src="user.avatar_url"
|
|
123
|
+
alt="User Photo"
|
|
124
|
+
class="width-32 height-32"
|
|
125
|
+
/>
|
|
126
|
+
<button class="camera-icon"></button>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="profile-info" style="width: calc(100% - 60px)">
|
|
129
|
+
<a
|
|
130
|
+
:href="`${serverDomain}/${user.username}`"
|
|
131
|
+
:title="user.username.toUpperCase()"
|
|
132
|
+
data-testid="user-profile-link"
|
|
133
|
+
class="line-break-anywhere is-ellipsis-1 has-text-weight-medium"
|
|
134
|
+
>{{ user.username }}</a
|
|
135
|
+
>
|
|
136
|
+
<a :href="`mailto:${user.email}`"> {{ user.email }}</a>
|
|
137
|
+
</div>
|
|
34
138
|
</div>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
data-testid="user-settings-link"
|
|
40
|
-
:href="`${serverDomain}/user/settings/`"
|
|
41
|
-
>Settings</a
|
|
42
|
-
>
|
|
43
|
-
</li>
|
|
44
|
-
<li v-if="user.is_admin" key="site-admin">
|
|
45
|
-
<a data-testid="site-admin-link" :href="`${accountsDomain}/admin`"
|
|
46
|
-
>Site Administration</a
|
|
47
|
-
>
|
|
48
|
-
</li>
|
|
49
|
-
<li
|
|
50
|
-
v-if="showAccountSwitcher"
|
|
51
|
-
:class="`is-${dropDownStatus}`"
|
|
52
|
-
key="switcher"
|
|
139
|
+
<transition-group
|
|
140
|
+
name="list"
|
|
141
|
+
tag="ul"
|
|
142
|
+
class="list-items py-2 ac-scrollbar px-0"
|
|
53
143
|
>
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
</a>
|
|
73
|
-
<transition-group
|
|
74
|
-
name="list"
|
|
75
|
-
tag="ul"
|
|
76
|
-
class="ac-vscrollbar"
|
|
77
|
-
ref="dropdownItems"
|
|
78
|
-
:style="{ maxHeight: dropDownSectionHeight }"
|
|
144
|
+
<li key="settings">
|
|
145
|
+
<a
|
|
146
|
+
data-testid="user-settings-link"
|
|
147
|
+
:href="`${serverDomain}/user/settings/`"
|
|
148
|
+
><span class="icon"><HeroiconsCog6Tooth /></span
|
|
149
|
+
><span>Settings</span></a
|
|
150
|
+
>
|
|
151
|
+
</li>
|
|
152
|
+
<li v-if="user.is_admin" key="site-admin">
|
|
153
|
+
<a data-testid="site-admin-link" :href="`${accountsDomain}/admin`"
|
|
154
|
+
><span class="icon"><HeroiconsWrenchScrewdriver /></span
|
|
155
|
+
><span>Site Administration</span></a
|
|
156
|
+
>
|
|
157
|
+
</li>
|
|
158
|
+
<li
|
|
159
|
+
v-if="showAccountSwitcher"
|
|
160
|
+
:class="`is-${dropDownStatus}`"
|
|
161
|
+
key="switcher"
|
|
79
162
|
>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
163
|
+
<a
|
|
164
|
+
class="ac-dropdown-button is-fullwidth is-flex is-justify-content-space-between is-align-items-center"
|
|
165
|
+
@click="toggleList()"
|
|
83
166
|
>
|
|
84
|
-
<
|
|
85
|
-
class="
|
|
86
|
-
|
|
167
|
+
<div class="is-flex gap-8">
|
|
168
|
+
<span class="icon"><HeroiconsUserGroup /></span
|
|
169
|
+
><span>Switch Account</span>
|
|
170
|
+
</div>
|
|
171
|
+
<span
|
|
172
|
+
><i
|
|
173
|
+
:class="`fa fa-angle-${
|
|
174
|
+
dropDownStatus === 'open' ? 'up' : 'down'
|
|
175
|
+
}`"
|
|
176
|
+
></i
|
|
177
|
+
></span>
|
|
178
|
+
</a>
|
|
179
|
+
<transition-group
|
|
180
|
+
name="list"
|
|
181
|
+
tag="ul"
|
|
182
|
+
class="ac-vscrollbar"
|
|
183
|
+
ref="dropdownItems"
|
|
184
|
+
:style="{ maxHeight: dropDownSectionHeight }"
|
|
185
|
+
>
|
|
186
|
+
<li
|
|
187
|
+
v-for="(org, idx) in formattedOrganizations"
|
|
188
|
+
:key="org.username"
|
|
87
189
|
>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
class="ac-user-profile is-rounded"
|
|
92
|
-
alt="icon"
|
|
93
|
-
/>
|
|
94
|
-
</div>
|
|
95
|
-
<div
|
|
96
|
-
class="
|
|
97
|
-
is-flex
|
|
98
|
-
is-align-items-center
|
|
99
|
-
is-justify-content-space-between
|
|
100
|
-
is-fullwidth
|
|
101
|
-
ml-10
|
|
102
|
-
"
|
|
190
|
+
<a
|
|
191
|
+
class="is-flex is-align-items-center"
|
|
192
|
+
@click="onOrganizationClick(org.username)"
|
|
103
193
|
>
|
|
104
|
-
<div class="
|
|
105
|
-
<
|
|
106
|
-
:
|
|
107
|
-
class="
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<p>
|
|
111
|
-
{{
|
|
112
|
-
org.isPersonalAccount
|
|
113
|
-
? "Personal Account"
|
|
114
|
-
: "Organization"
|
|
115
|
-
}}
|
|
116
|
-
</p>
|
|
194
|
+
<div class="width-30 height-30 image">
|
|
195
|
+
<img
|
|
196
|
+
:src="org.avatar_url"
|
|
197
|
+
class="ac-user-profile is-rounded"
|
|
198
|
+
alt="icon"
|
|
199
|
+
/>
|
|
117
200
|
</div>
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
class="
|
|
121
|
-
material-icons-outlined
|
|
122
|
-
font-size-18
|
|
123
|
-
ml-10
|
|
124
|
-
is-pulled-right
|
|
125
|
-
"
|
|
201
|
+
<div
|
|
202
|
+
class="is-flex is-align-items-center is-justify-content-space-between is-fullwidth ml-10"
|
|
126
203
|
>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
204
|
+
<div class="org-info">
|
|
205
|
+
<strong
|
|
206
|
+
:title="org.username"
|
|
207
|
+
class="line-break-anywhere is-ellipsis-1"
|
|
208
|
+
>{{ org.username }}</strong
|
|
209
|
+
>
|
|
210
|
+
<p>
|
|
211
|
+
{{
|
|
212
|
+
org.isPersonalAccount
|
|
213
|
+
? "Personal Account"
|
|
214
|
+
: "Organization"
|
|
215
|
+
}}
|
|
216
|
+
</p>
|
|
217
|
+
</div>
|
|
218
|
+
<span
|
|
219
|
+
v-if="idx === 0"
|
|
220
|
+
class="material-icons font-size-18 ml-10 is-pulled-right"
|
|
221
|
+
>
|
|
222
|
+
<HeroiconsCheck />
|
|
223
|
+
</span>
|
|
224
|
+
</div>
|
|
225
|
+
</a>
|
|
226
|
+
</li>
|
|
227
|
+
</transition-group>
|
|
228
|
+
</li>
|
|
229
|
+
<li key="signout" @click="$emit('on-logout')">
|
|
230
|
+
<a
|
|
231
|
+
data-testid="user-logout-link"
|
|
232
|
+
:href="`${accountsDomain}/user/logout`"
|
|
233
|
+
>
|
|
234
|
+
<span class="icon"><HeroiconsPower /></span>
|
|
235
|
+
<span>Sign out</span>
|
|
236
|
+
</a>
|
|
237
|
+
</li>
|
|
238
|
+
<!-- <li key="theme" v-if="showThemeMode">
|
|
239
|
+
<theme-mode @set:theme="setTheme" />
|
|
240
|
+
</li> -->
|
|
241
|
+
</transition-group>
|
|
242
|
+
</div>
|
|
243
|
+
</navbar-item-content>
|
|
244
|
+
</template>
|
|
164
245
|
</navbar-item>
|
|
165
246
|
</template>
|
|
166
247
|
|
|
167
|
-
<script>
|
|
168
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
169
|
-
|
|
170
|
-
export default defineComponent({
|
|
171
|
-
props: {
|
|
172
|
-
// active user info
|
|
173
|
-
user: {
|
|
174
|
-
type: Object,
|
|
175
|
-
default: () => ({}),
|
|
176
|
-
},
|
|
177
|
-
serverDomain: {
|
|
178
|
-
type: String,
|
|
179
|
-
default: "",
|
|
180
|
-
},
|
|
181
|
-
accountsDomain: {
|
|
182
|
-
type: String,
|
|
183
|
-
default: "",
|
|
184
|
-
},
|
|
185
|
-
showAccountSwitcher: {
|
|
186
|
-
type: Boolean,
|
|
187
|
-
default: false,
|
|
188
|
-
},
|
|
189
|
-
// all available organization list including personal account
|
|
190
|
-
organizations: {
|
|
191
|
-
type: Array,
|
|
192
|
-
default: () => [],
|
|
193
|
-
},
|
|
194
|
-
showThemeMode: {
|
|
195
|
-
type: Boolean,
|
|
196
|
-
default: false,
|
|
197
|
-
},
|
|
198
|
-
isPlatformDomain: {
|
|
199
|
-
type: Boolean,
|
|
200
|
-
default: false,
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
emits: ["set:theme", "on-logout"],
|
|
204
|
-
|
|
205
|
-
components: {
|
|
206
|
-
NavbarItem: defineAsyncComponent(() =>
|
|
207
|
-
import("../../v2/navbar/NavbarItem.vue").then((module) => module.default)
|
|
208
|
-
),
|
|
209
|
-
NavbarItemContent: defineAsyncComponent(() =>
|
|
210
|
-
import("../../v2/navbar/NavbarItemContent.vue").then(
|
|
211
|
-
(module) => module.default
|
|
212
|
-
)
|
|
213
|
-
),
|
|
214
|
-
ThemeMode: defineAsyncComponent(() =>
|
|
215
|
-
import("../../v3/navbar/ThemeMode.vue").then((module) => module.default)
|
|
216
|
-
),
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
computed: {
|
|
220
|
-
formattedOrganizations() {
|
|
221
|
-
let activeUser;
|
|
222
|
-
const filteredList = this.organizations.filter((item) => {
|
|
223
|
-
if (item.username === this.user.username) {
|
|
224
|
-
activeUser = item;
|
|
225
|
-
} else {
|
|
226
|
-
return true;
|
|
227
|
-
}
|
|
228
|
-
return false;
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
filteredList.unshift(activeUser);
|
|
232
|
-
|
|
233
|
-
return filteredList || [];
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
data() {
|
|
238
|
-
return {
|
|
239
|
-
dropDownStatus: "close",
|
|
240
|
-
dropDownSectionHeight: null,
|
|
241
|
-
};
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
methods: {
|
|
245
|
-
toggleList() {
|
|
246
|
-
this.dropDownStatus = this.dropDownStatus === "open" ? "close" : "open";
|
|
247
|
-
this.$nextTick(() => {
|
|
248
|
-
this.$refs["dropdownItems"].$el.scrollTo(0, 0);
|
|
249
|
-
});
|
|
250
|
-
},
|
|
251
|
-
onOrganizationClick(orgName) {
|
|
252
|
-
this.$refs["dropdownItems"].$el.scrollTo(0, 0);
|
|
253
|
-
this.$emit("activeorg$set", orgName);
|
|
254
|
-
},
|
|
255
|
-
onMouseLeave() {
|
|
256
|
-
this.dropDownStatus = "close";
|
|
257
|
-
},
|
|
258
|
-
setTheme(val) {
|
|
259
|
-
this.$emit("set:theme", val);
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
|
|
263
|
-
watch: {
|
|
264
|
-
dropDownStatus: {
|
|
265
|
-
immediate: true,
|
|
266
|
-
handler(n) {
|
|
267
|
-
if (n === "open") {
|
|
268
|
-
this.$nextTick(() => {
|
|
269
|
-
const dropDownUl = this.$refs["dropdownItems"];
|
|
270
|
-
if (dropDownUl)
|
|
271
|
-
this.dropDownSectionHeight = `${dropDownUl.scrollHeight}px`;
|
|
272
|
-
});
|
|
273
|
-
} else {
|
|
274
|
-
this.dropDownSectionHeight = null;
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
});
|
|
280
|
-
</script>
|
|
281
248
|
<style lang="scss" scoped>
|
|
282
249
|
.ac-vscrollbar {
|
|
283
250
|
overflow: auto !important;
|
|
@@ -285,4 +252,164 @@ export default defineComponent({
|
|
|
285
252
|
.line-break-anywhere {
|
|
286
253
|
line-break: anywhere;
|
|
287
254
|
}
|
|
288
|
-
|
|
255
|
+
.navbar-dropdown-wrapper {
|
|
256
|
+
width: 240px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.user-profile-wrapper {
|
|
260
|
+
background-color: $white-100;
|
|
261
|
+
border-radius: 4px;
|
|
262
|
+
border: 1px solid $primary-90;
|
|
263
|
+
|
|
264
|
+
.profile-area {
|
|
265
|
+
display: flex;
|
|
266
|
+
align-items: center;
|
|
267
|
+
border-bottom: 1px solid $primary-90;
|
|
268
|
+
padding: 16px 16px;
|
|
269
|
+
|
|
270
|
+
.profile-photo {
|
|
271
|
+
// width: 50px;
|
|
272
|
+
// height: 50px;
|
|
273
|
+
border-radius: 50%;
|
|
274
|
+
position: relative;
|
|
275
|
+
z-index: 1;
|
|
276
|
+
margin-right: 10px;
|
|
277
|
+
|
|
278
|
+
img {
|
|
279
|
+
border-radius: 50%;
|
|
280
|
+
width: 100%;
|
|
281
|
+
border: 2px solid #d2e7f9;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.camera-icon {
|
|
285
|
+
position: absolute;
|
|
286
|
+
right: -10px;
|
|
287
|
+
top: 0;
|
|
288
|
+
background-color: transparent;
|
|
289
|
+
border: none;
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.profile-info {
|
|
295
|
+
p {
|
|
296
|
+
color: $primary-10;
|
|
297
|
+
font-size: 13px;
|
|
298
|
+
font-weight: 500;
|
|
299
|
+
line-height: 1.3;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
a {
|
|
303
|
+
font-size: 1rem;
|
|
304
|
+
color: $primary-20;
|
|
305
|
+
line-height: 1.3;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
.list-items {
|
|
310
|
+
max-height: calc(100vh - 100px);
|
|
311
|
+
overflow-y: auto;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.ac-menu-item {
|
|
316
|
+
&.ac-profile-button {
|
|
317
|
+
margin-right: 15px;
|
|
318
|
+
button.button.ac-nav-button {
|
|
319
|
+
.ac-user-profile {
|
|
320
|
+
width: 32px;
|
|
321
|
+
height: 32px;
|
|
322
|
+
border-radius: 50%;
|
|
323
|
+
overflow: hidden;
|
|
324
|
+
border: 2px solid $primary-90;
|
|
325
|
+
}
|
|
326
|
+
i.fa {
|
|
327
|
+
padding-left: 8px;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.list-items {
|
|
334
|
+
li {
|
|
335
|
+
&.is-close {
|
|
336
|
+
ul {
|
|
337
|
+
max-height: 0;
|
|
338
|
+
visibility: hidden;
|
|
339
|
+
transition: max-height 0.25s ease-out;
|
|
340
|
+
&.ac-vscrollbar {
|
|
341
|
+
padding: 0;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
&.is-open {
|
|
347
|
+
ul {
|
|
348
|
+
padding: 8px;
|
|
349
|
+
max-height: 200px;
|
|
350
|
+
visibility: visible;
|
|
351
|
+
transition: max-height 0.25s ease-out;
|
|
352
|
+
li {
|
|
353
|
+
padding: 0;
|
|
354
|
+
border: 1px solid $primary-95;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
a {
|
|
359
|
+
padding: 8px 16px;
|
|
360
|
+
font-weight: 500;
|
|
361
|
+
display: block;
|
|
362
|
+
color: $primary-10;
|
|
363
|
+
transition: 0.3s;
|
|
364
|
+
display: flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
gap: 8px;
|
|
367
|
+
|
|
368
|
+
&:hover {
|
|
369
|
+
background-color: $primary-97;
|
|
370
|
+
color: $primary;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
.ac-menu-item {
|
|
376
|
+
.is-fullwidth {
|
|
377
|
+
width: 100%;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
.ac-nav-button {
|
|
381
|
+
background-color: transparent;
|
|
382
|
+
border: none;
|
|
383
|
+
color: $primary-80;
|
|
384
|
+
padding: 0 14px;
|
|
385
|
+
margin-left: 15px;
|
|
386
|
+
|
|
387
|
+
// &.ac-profile-button {
|
|
388
|
+
// color: $primary-10;
|
|
389
|
+
// font-weight: 500;
|
|
390
|
+
// }
|
|
391
|
+
|
|
392
|
+
&:last-child {
|
|
393
|
+
margin-left: 0;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
span {
|
|
397
|
+
position: absolute;
|
|
398
|
+
top: 5px;
|
|
399
|
+
right: 5px;
|
|
400
|
+
width: 15px;
|
|
401
|
+
height: 15px;
|
|
402
|
+
background-color: $white-100;
|
|
403
|
+
font-size: 12px;
|
|
404
|
+
line-height: 15px;
|
|
405
|
+
border-radius: 50%;
|
|
406
|
+
color: $primary;
|
|
407
|
+
z-index: 9;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
&:focus {
|
|
411
|
+
outline: none;
|
|
412
|
+
box-shadow: none !important;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
</style>
|