@appscode/design-system 1.0.43-alpha.99 → 1.1.0-alpha.10
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/utilities/_all.scss +8 -0
- package/base/utilities/_customize-bulma.scss +191 -0
- package/base/utilities/_default.scss +58 -124
- package/base/utilities/_derived-variables.scss +6 -0
- package/base/utilities/_extended.scss +38 -0
- package/base/utilities/_grid.scss +29 -0
- package/base/utilities/_initial-variables.scss +14 -10
- package/base/utilities/_typography.scss +6 -12
- package/base/utilities/dark-theme.scss +1 -0
- package/components/_ac-accordion.scss +14 -5
- package/components/_ac-alert-box.scss +32 -6
- package/components/_ac-card.scss +17 -5
- package/components/_ac-drag.scss +2 -0
- package/components/_ac-input.scss +19 -11
- package/components/_ac-modal.scss +1 -1
- package/components/_ac-multi-select.scss +60 -4
- package/components/_ac-report.scss +53 -0
- package/components/_ac-table.scss +60 -2
- package/components/_ac-tabs.scss +16 -2
- package/components/_ac-tags.scss +85 -0
- package/components/_ac-terminal.scss +1 -3
- package/components/_all.scss +29 -0
- package/components/_basic-card.scss +128 -0
- package/components/_buttons.scss +14 -33
- package/components/_dashboard-header.scss +32 -0
- package/components/_left-sidebar-menu.scss +9 -9
- package/components/_navbar.scss +89 -4
- package/components/_preview-modal.scss +14 -1
- package/components/_transitions.scss +296 -0
- package/components/_wizard.scss +1 -0
- package/components/bbum/_all.scss +9 -0
- package/components/bbum/_single-post-preview.scss +1 -1
- package/components/ui-builder/_ui-builder.scss +65 -1
- package/components/ui-builder/_vue-open-api.scss +6 -0
- package/layouts/_all.scss +2 -0
- package/layouts/_code-preview.scss +5 -2
- package/main.scss +5 -56
- package/package.json +4 -2
- package/plugins/caching.ts +243 -0
- package/plugins/time-convert.js +49 -0
- package/plugins/vue-toaster.js +3 -0
- package/vue-components/v2/banner/Banner.vue +2 -2
- package/vue-components/v2/breadcrumbs/Breadcrumb.vue +97 -0
- package/vue-components/v2/button/Button.vue +5 -0
- package/vue-components/v2/button/DownloadBtn.vue +45 -0
- package/vue-components/v2/card/Card.vue +1 -0
- package/vue-components/v2/content/ContentTable.vue +10 -0
- package/vue-components/v2/editor/Editor.vue +37 -24
- package/vue-components/v2/editor/FilteredFileEditor.vue +189 -0
- package/vue-components/v2/editor/MonacoEditor.vue +125 -0
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +209 -0
- package/vue-components/v2/form-fields/Input.vue +1 -1
- package/vue-components/v2/loaders/ResourceLoader.vue +101 -0
- package/vue-components/v2/loaders/SidebarLoader.vue +43 -0
- package/vue-components/v2/modal/Modal.vue +31 -5
- package/vue-components/v2/modals/DeleteConfirmationModal.vue +79 -0
- package/vue-components/v2/modals/JsonShowModal.vue +12 -2
- package/vue-components/v2/navbar/User.vue +229 -17
- package/vue-components/v2/notification/Notification.vue +101 -0
- package/vue-components/v2/notification/NotificationItem.vue +44 -0
- package/vue-components/v2/pagination/Pagination.vue +16 -3
- package/vue-components/v2/preloader/Preloader.vue +1 -1
- package/vue-components/v2/sidebar/SidebarItemWithDropDown.vue +19 -20
- package/vue-components/v2/tab/TabItem.vue +1 -1
- package/vue-components/v2/table/Table.vue +49 -8
- package/vue-components/v2/table/TableRow.vue +12 -2
- package/vue-components/v2/table/table-cell/CellValue.vue +29 -9
- package/vue-components/v2/table/table-cell/GenericCell.vue +56 -0
- package/vue-components/v2/table/table-cell/ObjectCell.vue +4 -1
- package/vue-components/v3/button/Button.vue +6 -1
- package/vue-components/v3/content/ContentHeader.vue +2 -1
- package/vue-components/v3/content/ContentTable.vue +25 -2
- package/vue-components/v3/editor/Editor.vue +36 -33
- package/vue-components/v3/editor/FilteredFileEditor.vue +186 -0
- package/vue-components/v3/editor/MonacoEditor.vue +131 -0
- package/vue-components/v3/editor/ResourceKeyValueEditor.vue +125 -0
- package/vue-components/v3/form/Form.vue +63 -0
- package/vue-components/v3/form-fields/Input.vue +11 -10
- package/vue-components/v3/header/HeaderItem.vue +5 -0
- package/vue-components/v3/header/HeaderItems.vue +5 -0
- package/vue-components/v3/loaders/ResourceLoader.vue +83 -0
- package/vue-components/v3/loaders/SidebarLoader.vue +34 -0
- package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +92 -0
- package/vue-components/v3/modal/Modal.vue +35 -7
- package/vue-components/v3/modals/DeleteConfirmationModal.vue +85 -0
- package/vue-components/v3/modals/JsonShowModal.vue +25 -16
- package/vue-components/v3/modals/LongRunningTasksModal.vue +400 -0
- package/vue-components/v3/navbar/ThemeMode.vue +41 -49
- package/vue-components/v3/navbar/User.vue +242 -18
- package/vue-components/v3/notification/AlertBox.vue +61 -0
- package/vue-components/v3/notification/Notification.vue +98 -0
- package/vue-components/v3/notification/NotificationItem.vue +52 -0
- package/vue-components/v3/pagination/Pagination.vue +16 -3
- package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +120 -0
- package/vue-components/v3/tab/TabItem.vue +1 -1
- package/vue-components/v3/table/MultiInfoTable.vue +143 -0
- package/vue-components/v3/table/Table.vue +55 -14
- package/vue-components/v3/table/TableContainer.vue +34 -0
- package/vue-components/v3/table/TableRow.vue +93 -6
- package/vue-components/v3/table/table-cell/CellValue.vue +23 -7
- package/vue-components/v3/table/table-cell/GenericCell.vue +75 -0
- package/vue-components/v3/table/table-cell/ObjectCell.vue +7 -2
- package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +148 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
v-if="showModal"
|
|
7
7
|
class="ac-modal is-middle-alignment"
|
|
8
8
|
:class="modifierClasses"
|
|
9
|
-
@click.self="
|
|
9
|
+
@click.self="onModalOutsideClick"
|
|
10
10
|
>
|
|
11
11
|
<div class="ac-modal-inner">
|
|
12
12
|
<!-- modal header start -->
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
<ac-button
|
|
19
19
|
modifier-classes="is-square is-transparent"
|
|
20
20
|
:disabled="isCloseOptionDisabled"
|
|
21
|
-
:icon-image="
|
|
21
|
+
:icon-image="
|
|
22
|
+
require('@appscode/design-system-images/icons/close-icon.svg')
|
|
23
|
+
"
|
|
24
|
+
data-testid="delete-confirmation-modal-close-icon"
|
|
22
25
|
@click.stop="destroyModal"
|
|
23
26
|
/>
|
|
24
27
|
</header-item>
|
|
@@ -27,7 +30,11 @@
|
|
|
27
30
|
<!-- modal header end -->
|
|
28
31
|
|
|
29
32
|
<!-- modal body start -->
|
|
30
|
-
<div
|
|
33
|
+
<div
|
|
34
|
+
class="ac-modal-body ac-vscrollbar"
|
|
35
|
+
:class="modifierBodyClasses"
|
|
36
|
+
data-testid="ac-modal-content-with-scroll"
|
|
37
|
+
>
|
|
31
38
|
<div class="ac-modal-content">
|
|
32
39
|
<!-- freedom content start -->
|
|
33
40
|
<slot />
|
|
@@ -37,7 +44,10 @@
|
|
|
37
44
|
<!-- modal body end -->
|
|
38
45
|
|
|
39
46
|
<!-- modal footer start -->
|
|
40
|
-
<div
|
|
47
|
+
<div
|
|
48
|
+
v-if="!hideActionFooter"
|
|
49
|
+
class="ac-modal-footer action-footer is-flex is-align-items-center is-justify-content-space-between"
|
|
50
|
+
>
|
|
41
51
|
<div>
|
|
42
52
|
<slot name="modal-footer-left" />
|
|
43
53
|
</div>
|
|
@@ -69,7 +79,19 @@ export default {
|
|
|
69
79
|
isCloseOptionDisabled: {
|
|
70
80
|
type: Boolean,
|
|
71
81
|
default: false,
|
|
72
|
-
}
|
|
82
|
+
},
|
|
83
|
+
ignoreOutsideClick: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
87
|
+
hideActionFooter: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false,
|
|
90
|
+
},
|
|
91
|
+
modifierBodyClasses: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: "",
|
|
94
|
+
},
|
|
73
95
|
},
|
|
74
96
|
|
|
75
97
|
components: {
|
|
@@ -105,6 +127,10 @@ export default {
|
|
|
105
127
|
this.destroyModal();
|
|
106
128
|
}
|
|
107
129
|
},
|
|
130
|
+
onModalOutsideClick() {
|
|
131
|
+
if (this.ignoreOutsideClick) return;
|
|
132
|
+
this.destroyModal();
|
|
133
|
+
},
|
|
108
134
|
initializeModal() {
|
|
109
135
|
this.showModal = true;
|
|
110
136
|
document.addEventListener("keydown", this.onKeyDown);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- modal start -->
|
|
3
|
+
<modal
|
|
4
|
+
:title="title"
|
|
5
|
+
modifier-classes="is-normal"
|
|
6
|
+
:open="open"
|
|
7
|
+
@closemodal="closeModal"
|
|
8
|
+
>
|
|
9
|
+
<!-- freedom content start -->
|
|
10
|
+
<div class="action-message pt-35 pb-35 has-text-centered">
|
|
11
|
+
<h5 class="is-message">{{ message }} {{ itemName ? "" : "?" }}</h5>
|
|
12
|
+
<p class="is-description">{{ itemName }} {{ itemName ? "?" : "" }}</p>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<!-- freedom content end -->
|
|
16
|
+
|
|
17
|
+
<!-- modal footer start -->
|
|
18
|
+
<template #modal-footer-controls>
|
|
19
|
+
<ac-button
|
|
20
|
+
@click.stop="closeModal"
|
|
21
|
+
title="Cancel"
|
|
22
|
+
modifier-classes="is-outlined"
|
|
23
|
+
data-testid="delete-confirmation-modal-close-button"
|
|
24
|
+
/>
|
|
25
|
+
<ac-button
|
|
26
|
+
modifier-classes="is-danger"
|
|
27
|
+
:is-loader-active="isDeleteActive"
|
|
28
|
+
title="Yes"
|
|
29
|
+
data-testid="delete-confirmation-modal-confirm-button"
|
|
30
|
+
@click.stop="confirm(true)"
|
|
31
|
+
/>
|
|
32
|
+
</template>
|
|
33
|
+
</modal>
|
|
34
|
+
<!-- modal end -->
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
export default {
|
|
39
|
+
components: {
|
|
40
|
+
Modal: () => import("./../modal/Modal.vue"),
|
|
41
|
+
AcButton: () => import("./../button/Button.vue"),
|
|
42
|
+
},
|
|
43
|
+
props: {
|
|
44
|
+
open: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
47
|
+
},
|
|
48
|
+
title: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "",
|
|
51
|
+
},
|
|
52
|
+
message: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "",
|
|
55
|
+
},
|
|
56
|
+
itemName: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "",
|
|
59
|
+
},
|
|
60
|
+
isLoading: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
isDeleteActive: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
confirm(response) {
|
|
71
|
+
this.$emit("delete-confirmation-modal$confirm", response);
|
|
72
|
+
},
|
|
73
|
+
closeModal() {
|
|
74
|
+
this.confirm(false);
|
|
75
|
+
this.$emit("closemodal", true);
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
</script>
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
<ac-button
|
|
11
11
|
modifier-classes="is-square is-primary"
|
|
12
12
|
icon-class="copy"
|
|
13
|
-
v-clipboard:copy="
|
|
13
|
+
v-clipboard:copy="
|
|
14
|
+
`${editorTitle}: ${JSON.stringify(parsedContent, null, 4)}`
|
|
15
|
+
"
|
|
14
16
|
v-clipboard:success="onCopy"
|
|
15
17
|
v-clipboard:error="onError"
|
|
16
18
|
/>
|
|
@@ -26,6 +28,8 @@
|
|
|
26
28
|
</template>
|
|
27
29
|
|
|
28
30
|
<script>
|
|
31
|
+
import Preloader from "../preloader/Preloader.vue";
|
|
32
|
+
import Banner from "../banner/Banner.vue";
|
|
29
33
|
export default {
|
|
30
34
|
props: {
|
|
31
35
|
open: {
|
|
@@ -43,7 +47,13 @@ export default {
|
|
|
43
47
|
},
|
|
44
48
|
components: {
|
|
45
49
|
Modal: () => import("../modal/Modal.vue"),
|
|
46
|
-
Editor: () =>
|
|
50
|
+
Editor: () => ({
|
|
51
|
+
component: import("../editor/Editor.vue"),
|
|
52
|
+
loading: Preloader,
|
|
53
|
+
delay: 200,
|
|
54
|
+
error: Banner,
|
|
55
|
+
timeout: 100000,
|
|
56
|
+
}),
|
|
47
57
|
AcButton: () => import("../button/Button.vue"),
|
|
48
58
|
HeaderItem: () => import("../header/HeaderItem.vue"),
|
|
49
59
|
},
|
|
@@ -7,31 +7,155 @@
|
|
|
7
7
|
<img :src="user.avatar_url" alt="User Photo" />
|
|
8
8
|
</div>
|
|
9
9
|
</button>
|
|
10
|
-
<navbar-item-content>
|
|
11
|
-
<div
|
|
10
|
+
<navbar-item-content class="navbar-dropdown-wrapper">
|
|
11
|
+
<div
|
|
12
|
+
v-if="user.username"
|
|
13
|
+
class="user-profile-wrapper"
|
|
14
|
+
@mouseleave="onMouseLeave()"
|
|
15
|
+
>
|
|
12
16
|
<div class="profile-area">
|
|
13
17
|
<div class="profile-photo">
|
|
14
|
-
<img
|
|
18
|
+
<img
|
|
19
|
+
:src="user.avatar_url"
|
|
20
|
+
alt="User Photo"
|
|
21
|
+
class="width-50 height-50"
|
|
22
|
+
/>
|
|
15
23
|
<button class="camera-icon"></button>
|
|
16
24
|
</div>
|
|
17
|
-
<div class="profile-info">
|
|
18
|
-
<
|
|
25
|
+
<div class="profile-info" style="width: calc(100% - 60px)">
|
|
26
|
+
<a
|
|
27
|
+
:href="`${serverDomain}/${user.username}`"
|
|
28
|
+
:title="user.username.toUpperCase()"
|
|
29
|
+
data-testid="user-profile-link"
|
|
30
|
+
class="line-break-anywhere is-ellipsis-1"
|
|
31
|
+
>{{ user.username.toUpperCase() }}</a
|
|
32
|
+
>
|
|
19
33
|
<a :href="`mailto:${user.email}`"> {{ user.email }}</a>
|
|
20
34
|
</div>
|
|
21
35
|
</div>
|
|
22
|
-
<ul>
|
|
23
|
-
<li>
|
|
24
|
-
<a
|
|
36
|
+
<transition-group name="list" tag="ul">
|
|
37
|
+
<li key="settings">
|
|
38
|
+
<a
|
|
39
|
+
data-testid="user-settings-link"
|
|
40
|
+
:href="`${serverDomain}/user/settings/`"
|
|
41
|
+
>Settings</a
|
|
42
|
+
>
|
|
25
43
|
</li>
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</template>
|
|
31
|
-
<li>
|
|
32
|
-
<a :href="`${serverDomain}/user/logout`"> Sign out </a>
|
|
44
|
+
<li v-if="isLoggedinUserAdmin" key="site-admin">
|
|
45
|
+
<a data-testid="site-admin-link" :href="`${accountsDomain}/admin`"
|
|
46
|
+
>Site Administration</a
|
|
47
|
+
>
|
|
33
48
|
</li>
|
|
34
|
-
|
|
49
|
+
<li
|
|
50
|
+
v-if="showAccountSwitcher"
|
|
51
|
+
:class="`is-${dropDownStatus}`"
|
|
52
|
+
key="switcher"
|
|
53
|
+
>
|
|
54
|
+
<a
|
|
55
|
+
class="
|
|
56
|
+
ac-dropdown-button
|
|
57
|
+
is-fullwidth
|
|
58
|
+
is-flex
|
|
59
|
+
is-justify-content-space-between
|
|
60
|
+
is-align-items-center
|
|
61
|
+
"
|
|
62
|
+
@click="toggleList()"
|
|
63
|
+
>
|
|
64
|
+
<span>Switch Account</span>
|
|
65
|
+
<span
|
|
66
|
+
><i
|
|
67
|
+
:class="`fa fa-angle-${
|
|
68
|
+
dropDownStatus === 'open' ? 'up' : 'down'
|
|
69
|
+
}`"
|
|
70
|
+
></i
|
|
71
|
+
></span>
|
|
72
|
+
</a>
|
|
73
|
+
<transition-group
|
|
74
|
+
name="list"
|
|
75
|
+
tag="ul"
|
|
76
|
+
class="ac-vscrollbar"
|
|
77
|
+
ref="dropdownItems"
|
|
78
|
+
:style="{ maxHeight: dropDownSectionHeight }"
|
|
79
|
+
>
|
|
80
|
+
<li
|
|
81
|
+
v-for="(org, idx) in formattedOrganizations"
|
|
82
|
+
:key="org.username"
|
|
83
|
+
>
|
|
84
|
+
<a
|
|
85
|
+
class="is-flex is-align-items-center"
|
|
86
|
+
@click="onOrganizationClick(org.username)"
|
|
87
|
+
>
|
|
88
|
+
<div class="width-30 height-30 image">
|
|
89
|
+
<img
|
|
90
|
+
:src="org.avatar_url"
|
|
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
|
+
"
|
|
103
|
+
>
|
|
104
|
+
<div class="org-info">
|
|
105
|
+
<strong
|
|
106
|
+
:title="org.username"
|
|
107
|
+
class="line-break-anywhere is-ellipsis-1"
|
|
108
|
+
>{{ org.username }}</strong
|
|
109
|
+
>
|
|
110
|
+
<p>
|
|
111
|
+
{{
|
|
112
|
+
org.isPersonalAccount
|
|
113
|
+
? "Personal Account"
|
|
114
|
+
: "Organization"
|
|
115
|
+
}}
|
|
116
|
+
</p>
|
|
117
|
+
</div>
|
|
118
|
+
<span
|
|
119
|
+
v-if="idx === 0"
|
|
120
|
+
class="
|
|
121
|
+
material-icons-outlined
|
|
122
|
+
font-size-18
|
|
123
|
+
ml-10
|
|
124
|
+
is-pulled-right
|
|
125
|
+
"
|
|
126
|
+
>
|
|
127
|
+
check
|
|
128
|
+
</span>
|
|
129
|
+
</div>
|
|
130
|
+
</a>
|
|
131
|
+
</li>
|
|
132
|
+
</transition-group>
|
|
133
|
+
</li>
|
|
134
|
+
<li key="dashboard">
|
|
135
|
+
<nuxt-link
|
|
136
|
+
v-if="isPlatformDomain"
|
|
137
|
+
to="/dashboard"
|
|
138
|
+
data-testid="user-dashboard-link"
|
|
139
|
+
>
|
|
140
|
+
Dashboard
|
|
141
|
+
</nuxt-link>
|
|
142
|
+
<a
|
|
143
|
+
v-else
|
|
144
|
+
:href="`${serverDomain}/dashboard`"
|
|
145
|
+
data-testid="user-dashboard-link"
|
|
146
|
+
>
|
|
147
|
+
Dashboard
|
|
148
|
+
</a>
|
|
149
|
+
</li>
|
|
150
|
+
<li key="signout">
|
|
151
|
+
<a
|
|
152
|
+
:href="`${accountsDomain}/user/logout`"
|
|
153
|
+
data-testid="signout-link"
|
|
154
|
+
>
|
|
155
|
+
Sign out
|
|
156
|
+
</a>
|
|
157
|
+
</li>
|
|
158
|
+
</transition-group>
|
|
35
159
|
</div>
|
|
36
160
|
</navbar-item-content>
|
|
37
161
|
</navbar-item>
|
|
@@ -40,6 +164,7 @@
|
|
|
40
164
|
<script>
|
|
41
165
|
export default {
|
|
42
166
|
props: {
|
|
167
|
+
// active user info
|
|
43
168
|
user: {
|
|
44
169
|
type: Object,
|
|
45
170
|
default: () => ({}),
|
|
@@ -48,11 +173,98 @@ export default {
|
|
|
48
173
|
type: String,
|
|
49
174
|
default: "",
|
|
50
175
|
},
|
|
176
|
+
accountsDomain: {
|
|
177
|
+
type: String,
|
|
178
|
+
default: "",
|
|
179
|
+
},
|
|
180
|
+
showAccountSwitcher: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: false,
|
|
183
|
+
},
|
|
184
|
+
// all available organization list including personal account
|
|
185
|
+
organizations: {
|
|
186
|
+
type: Array,
|
|
187
|
+
default: () => [],
|
|
188
|
+
},
|
|
189
|
+
isLoggedinUserAdmin: {
|
|
190
|
+
type: Boolean,
|
|
191
|
+
default: false,
|
|
192
|
+
},
|
|
193
|
+
isPlatformDomain: {
|
|
194
|
+
type: Boolean,
|
|
195
|
+
default: false,
|
|
196
|
+
},
|
|
51
197
|
},
|
|
52
198
|
|
|
53
199
|
components: {
|
|
54
200
|
NavbarItem: () => import("./NavbarItem.vue"),
|
|
55
201
|
NavbarItemContent: () => import("./NavbarItemContent.vue"),
|
|
56
202
|
},
|
|
203
|
+
|
|
204
|
+
computed: {
|
|
205
|
+
formattedOrganizations() {
|
|
206
|
+
let activeUser;
|
|
207
|
+
const filteredList = this.organizations.filter((item) => {
|
|
208
|
+
if (item.username === this.user.username) {
|
|
209
|
+
activeUser = item;
|
|
210
|
+
} else {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
return false;
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
filteredList.unshift(activeUser);
|
|
217
|
+
|
|
218
|
+
return filteredList || [];
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
data() {
|
|
223
|
+
return {
|
|
224
|
+
dropDownStatus: "close",
|
|
225
|
+
dropDownSectionHeight: null,
|
|
226
|
+
};
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
methods: {
|
|
230
|
+
toggleList() {
|
|
231
|
+
this.dropDownStatus = this.dropDownStatus === "open" ? "close" : "open";
|
|
232
|
+
this.$nextTick(() => {
|
|
233
|
+
this.$refs["dropdownItems"].$el.scrollTo(0, 0);
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
onOrganizationClick(orgName) {
|
|
237
|
+
this.$refs["dropdownItems"].$el.scrollTo(0, 0);
|
|
238
|
+
this.$emit("activeorg$set", orgName);
|
|
239
|
+
},
|
|
240
|
+
onMouseLeave() {
|
|
241
|
+
this.dropDownStatus = "close";
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
watch: {
|
|
246
|
+
dropDownStatus: {
|
|
247
|
+
immediate: true,
|
|
248
|
+
handler(n) {
|
|
249
|
+
if (n === "open") {
|
|
250
|
+
this.$nextTick(() => {
|
|
251
|
+
const dropDownUl = this.$refs["dropdownItems"];
|
|
252
|
+
if (dropDownUl)
|
|
253
|
+
this.dropDownSectionHeight = `${dropDownUl.scrollHeight}px`;
|
|
254
|
+
});
|
|
255
|
+
} else {
|
|
256
|
+
this.dropDownSectionHeight = null;
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
},
|
|
57
261
|
};
|
|
58
|
-
</script>
|
|
262
|
+
</script>
|
|
263
|
+
<style lang="scss" scoped>
|
|
264
|
+
.ac-vscrollbar {
|
|
265
|
+
overflow: auto !important;
|
|
266
|
+
}
|
|
267
|
+
.line-break-anywhere {
|
|
268
|
+
line-break: anywhere;
|
|
269
|
+
}
|
|
270
|
+
</style>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
@mouseenter="notificationPanelOpen = true"
|
|
4
|
+
@mouseleave="notificationPanelOpen = false"
|
|
5
|
+
>
|
|
6
|
+
<button class="button ac-nav-button">
|
|
7
|
+
<span v-if="unreadCount">{{ unreadCount }}</span>
|
|
8
|
+
<i
|
|
9
|
+
class="fa fa-bell"
|
|
10
|
+
:class="{ 'ac-shake': unreadCount }"
|
|
11
|
+
aria-hidden="true"
|
|
12
|
+
></i>
|
|
13
|
+
</button>
|
|
14
|
+
<div class="ac-menu-content is-notification">
|
|
15
|
+
<div class="notification-header">
|
|
16
|
+
<div class="left-content">
|
|
17
|
+
<p>
|
|
18
|
+
Notifications <span>({{ notifications.length }})</span>
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="right-content"></div>
|
|
22
|
+
</div>
|
|
23
|
+
<div :key="notificationPanelOpen ? 1 : 0" class="notification-body">
|
|
24
|
+
<transition-group v-if="notifications.length" name="slide-right">
|
|
25
|
+
<notification-item
|
|
26
|
+
v-for="notification in notifications"
|
|
27
|
+
:key="`${notification.id}${unreadCount}`"
|
|
28
|
+
:notification="notification"
|
|
29
|
+
/>
|
|
30
|
+
</transition-group>
|
|
31
|
+
<span v-else class="single-notification-item"
|
|
32
|
+
>No new notifications</span
|
|
33
|
+
>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import { StringCodec } from "nats.ws/cjs/nats";
|
|
41
|
+
export default {
|
|
42
|
+
components: {
|
|
43
|
+
NotificationItem: () => import("./NotificationItem.vue"),
|
|
44
|
+
},
|
|
45
|
+
data() {
|
|
46
|
+
return {
|
|
47
|
+
notifications: [],
|
|
48
|
+
notificationsRead: 0,
|
|
49
|
+
|
|
50
|
+
notificationPanelOpen: false,
|
|
51
|
+
subscription: null,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
unreadCount() {
|
|
56
|
+
return this.notifications.length - this.notificationsRead;
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
watch: {
|
|
60
|
+
notificationPanelOpen(n) {
|
|
61
|
+
if (n) {
|
|
62
|
+
this.notificationsRead = this.notifications.length;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
created() {
|
|
67
|
+
this.subscribeToNotifcations();
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
addNewNotification(notification) {
|
|
71
|
+
this.notifications.unshift(notification);
|
|
72
|
+
if (this.notificationPanelOpen) {
|
|
73
|
+
this.notificationsRead = this.notifications.length;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
async subscribeToNotifcations() {
|
|
77
|
+
this.subscription = this.$nc?.subscribe("notifications");
|
|
78
|
+
console.log("Started listening to Notifications");
|
|
79
|
+
|
|
80
|
+
if (this.subscription) {
|
|
81
|
+
// listen to channel events
|
|
82
|
+
for await (const msg of this.subscription) {
|
|
83
|
+
console.log("notifications ===>");
|
|
84
|
+
console.log({ data: StringCodec().decode(msg.data) });
|
|
85
|
+
const log = JSON.parse(StringCodec().decode(msg.data));
|
|
86
|
+
console.log({ log });
|
|
87
|
+
const currentTime = new Date().getTime();
|
|
88
|
+
this.addNewNotification({
|
|
89
|
+
...log,
|
|
90
|
+
id: currentTime,
|
|
91
|
+
time: currentTime,
|
|
92
|
+
});
|
|
93
|
+
msg.respond();
|
|
94
|
+
}
|
|
95
|
+
console.log("Stopped listening to Notifications");
|
|
96
|
+
console.log("Closed Channel Notifications");
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
</script>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a class="single-notification-item is-complete">
|
|
3
|
+
<p>
|
|
4
|
+
{{ notification.msg }}
|
|
5
|
+
</p>
|
|
6
|
+
<div class="notification-status">
|
|
7
|
+
<p
|
|
8
|
+
:class="{
|
|
9
|
+
'is-success': notification.status === 'Success',
|
|
10
|
+
'has-text-danger': notification.status === 'Failed',
|
|
11
|
+
'is-info':
|
|
12
|
+
notification.status === 'Started' ||
|
|
13
|
+
notification.status === 'Running',
|
|
14
|
+
'is-warning': notification.status === 'Pending',
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
<i
|
|
18
|
+
class="fa mr-5"
|
|
19
|
+
:class="{
|
|
20
|
+
'fa-check': notification.status === 'Success',
|
|
21
|
+
'fa-exclamation-triangle': notification.status === 'Failed',
|
|
22
|
+
'fa-info-circle':
|
|
23
|
+
notification.status === 'Started' ||
|
|
24
|
+
notification.status === 'Pending' ||
|
|
25
|
+
notification.status === 'Running',
|
|
26
|
+
}"
|
|
27
|
+
/>
|
|
28
|
+
{{ notification.status }}
|
|
29
|
+
</p>
|
|
30
|
+
<p>{{ notification.time | getDayDifferences }} ago</p>
|
|
31
|
+
</div>
|
|
32
|
+
</a>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
export default {
|
|
37
|
+
props: {
|
|
38
|
+
notification: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: () => ({}),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
"
|
|
10
10
|
>
|
|
11
11
|
<label>Rows per page</label>
|
|
12
|
-
<select
|
|
12
|
+
<select
|
|
13
|
+
v-model="selectedItemCountPerPage"
|
|
14
|
+
name="page"
|
|
15
|
+
data-testid="rows-per-page-selector"
|
|
16
|
+
>
|
|
13
17
|
<option :value="5">5</option>
|
|
14
18
|
<option :value="10" v-show="totalNoOfItems > 5">10</option>
|
|
15
19
|
<option :value="15" v-show="totalNoOfItems > 10">15</option>
|
|
@@ -31,19 +35,28 @@
|
|
|
31
35
|
|
|
32
36
|
<ul v-if="totalNoOfItems > selectedItemCountPerPage">
|
|
33
37
|
<li>
|
|
34
|
-
<a
|
|
38
|
+
<a
|
|
39
|
+
class="previous"
|
|
40
|
+
@click.prevent="prevPage()"
|
|
41
|
+
data-testid="pagination-previous-page-button"
|
|
42
|
+
>
|
|
35
43
|
<i class="fa fa-angle-left" aria-hidden="true"></i>
|
|
36
44
|
</a>
|
|
37
45
|
</li>
|
|
38
46
|
<li v-for="page in pages" :key="`page-${page}`">
|
|
39
47
|
<a
|
|
40
48
|
@click.prevent="changePage(page)"
|
|
49
|
+
data-testid="pagination-page-switch-button"
|
|
41
50
|
:class="{ 'is-current': activePageNo === page }"
|
|
42
51
|
>{{ page }}</a
|
|
43
52
|
>
|
|
44
53
|
</li>
|
|
45
54
|
<li>
|
|
46
|
-
<a
|
|
55
|
+
<a
|
|
56
|
+
class="next"
|
|
57
|
+
@click.prevent="nextPage()"
|
|
58
|
+
data-testid="pagination-next-page-button"
|
|
59
|
+
>
|
|
47
60
|
<i class="fa fa-angle-right" aria-hidden="true"></i>
|
|
48
61
|
</a>
|
|
49
62
|
</li>
|