dashboard-shell-shell 1.0.113 → 1.0.114
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/components/ActionDropdown.vue +1 -1
- package/components/ActionMenu.vue +2 -2
- package/components/ActionMenuShell.vue +0 -1
- package/components/AppModal.vue +6 -78
- package/components/AssignTo.vue +11 -25
- package/components/AsyncButton.vue +7 -24
- package/components/BannerGraphic.vue +0 -1
- package/components/ButtonDropdown.vue +4 -26
- package/components/ButtonGroup.vue +0 -4
- package/components/ButtonMultiAction.vue +0 -1
- package/components/CommunityLinks.vue +3 -3
- package/components/ConsumptionGauge.vue +5 -24
- package/components/CopyToClipboardText.vue +1 -2
- package/components/CruResource.vue +7 -12
- package/components/CruResourceFooter.vue +2 -2
- package/components/DashboardOptions.vue +15 -21
- package/components/DetailText.vue +0 -5
- package/components/DisableAuthProviderModal.vue +0 -1
- package/components/ExplorerMembers.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +14 -56
- package/components/FixedBanner.vue +12 -19
- package/components/GlobalRoleBindings.vue +1 -5
- package/components/GrafanaDashboard.vue +4 -4
- package/components/GrowlManager.vue +1 -4
- package/components/HardwareResourceGauge.vue +3 -39
- package/components/InfoBox.vue +3 -3
- package/components/InputOrDisplay.vue +2 -28
- package/components/LabelValue.vue +1 -16
- package/components/LandingPagePreference.vue +3 -5
- package/components/LocaleSelector.vue +93 -39
- package/components/ModalWithCard.vue +0 -2
- package/components/MoveModal.vue +0 -1
- package/components/PromptChangePassword.vue +1 -1
- package/components/PromptModal.vue +2 -15
- package/components/PromptRemove.vue +8 -28
- package/components/PromptRestore.vue +0 -1
- package/components/ResourceCancelModal.vue +0 -1
- package/components/ResourceDetail/Masthead.vue +43 -188
- package/components/ResourceDetail/__tests__/Masthead.test.ts +1 -5
- package/components/ResourceDetail/index.vue +14 -49
- package/components/ResourceList/Masthead.vue +18 -80
- package/components/ResourceTable.vue +19 -60
- package/components/SideNav.vue +12 -32
- package/components/SortableTable/THead.vue +5 -34
- package/components/SortableTable/actions.js +1 -1
- package/components/SortableTable/index.vue +142 -649
- package/components/SortableTable/paging.js +28 -36
- package/components/SortableTable/selection.js +11 -0
- package/components/Tabbed/Tab.vue +3 -3
- package/components/Tabbed/index.vue +26 -44
- package/components/Wizard.vue +2 -2
- package/components/__tests__/AsyncButton.test.ts +2 -2
- package/components/__tests__/FixedBanner.test.ts +3 -3
- package/components/auth/Principal.vue +3 -10
- package/components/auth/__tests__/RoleDetailEdit.test.ts +2 -3
- package/components/form/ArrayList.vue +85 -123
- package/components/form/ArrayListGrouped.vue +2 -10
- package/components/form/Command.vue +15 -6
- package/components/form/EnvVars.vue +8 -16
- package/components/form/Footer.vue +5 -8
- package/components/form/HealthCheck.vue +3 -3
- package/components/form/HookOption.vue +16 -11
- package/components/form/KeyValue.vue +7 -16
- package/components/form/LabeledSelect.vue +76 -59
- package/components/form/LifecycleHooks.vue +3 -3
- package/components/form/MatchExpressions.vue +12 -35
- package/components/form/NameNsDescription.vue +115 -147
- package/components/form/Networking.vue +12 -20
- package/components/form/NodeAffinity.vue +23 -31
- package/components/form/NodeScheduling.vue +3 -13
- package/components/form/Password.vue +5 -11
- package/components/form/PodAffinity.vue +44 -43
- package/components/form/Probe.vue +66 -68
- package/components/form/ResourceQuota/Project.vue +1 -5
- package/components/form/ResourceSelector.vue +9 -7
- package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +3 -6
- package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +1 -12
- package/components/form/SSHKnownHosts/index.vue +2 -16
- package/components/form/Security.vue +56 -54
- package/components/form/Select.vue +7 -41
- package/components/form/ShellInput.vue +1 -5
- package/components/form/Tolerations.vue +1 -5
- package/components/form/UnitInput.vue +2 -2
- package/components/form/ValueFromResource.vue +121 -134
- package/components/form/WorkloadPorts.vue +18 -18
- package/components/form/__tests__/ArrayList.test.ts +2 -5
- package/components/form/__tests__/MatchExpressions.test.ts +12 -12
- package/components/form/__tests__/NameNsDescription.test.ts +14 -115
- package/components/form/__tests__/Probe.test.ts +8 -12
- package/components/form/__tests__/SSHKnownHosts.test.ts +0 -11
- package/components/form/__tests__/Select.test.ts +0 -37
- package/components/form/__tests__/UnitInput.test.ts +5 -4
- package/components/formatter/BadgeStateFormatter.vue +5 -8
- package/components/formatter/ExtensionCache.vue +74 -0
- package/components/formatter/InternalExternalIP.vue +0 -2
- package/components/formatter/Port.vue +24 -0
- package/components/formatter/SecretData.vue +7 -20
- package/components/formatter/SecretType.vue +41 -0
- package/components/nav/Favorite.vue +1 -5
- package/components/nav/Group.vue +27 -60
- package/components/nav/Header.vue +13 -39
- package/components/nav/Jump.vue +0 -7
- package/components/nav/NamespaceFilter.vue +8 -14
- package/components/nav/Pinned.vue +1 -1
- package/components/nav/TopLevelMenu.vue +17 -5
- package/components/nav/Type.vue +35 -32
- package/components/nav/__tests__/TopLevelMenu.test.ts +40 -0
- package/components/templates/blank.vue +1 -4
- package/components/templates/default.vue +0 -8
- package/components/templates/home.vue +1 -10
- package/components/templates/plain.vue +1 -10
- package/package.json +1 -1
- package/components/ActionDropdownShell.vue +0 -71
- package/components/DotState.vue +0 -84
- package/components/ModalManager.vue +0 -55
- package/components/SlideInPanelManager.vue +0 -126
- package/components/StatusBadge.vue +0 -77
- package/components/__tests__/ModalManager.spec.ts +0 -176
- package/components/__tests__/SlideInPanelManager.spec.ts +0 -166
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils';
|
|
2
|
-
import { createStore, Store } from 'vuex';
|
|
3
|
-
import { nextTick } from 'vue';
|
|
4
|
-
import SlideInPanelManager from '@shell/components/SlideInPanelManager.vue';
|
|
5
|
-
|
|
6
|
-
const MockComponent = {
|
|
7
|
-
template: '<div data-testid="slide-in-panel-component">Mock Panel Content</div>',
|
|
8
|
-
props: ['width', 'title', 'extraProp']
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
describe('slideInPanelManager.vue with Teleport', () => {
|
|
12
|
-
let store: Store<any>;
|
|
13
|
-
let getters: Record<string, () => any>;
|
|
14
|
-
let slidesDiv: HTMLDivElement;
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
// Create teleport target container
|
|
18
|
-
slidesDiv = document.createElement('div');
|
|
19
|
-
slidesDiv.setAttribute('id', 'slides');
|
|
20
|
-
document.body.appendChild(slidesDiv);
|
|
21
|
-
|
|
22
|
-
getters = {
|
|
23
|
-
'slideInPanel/isOpen': () => true,
|
|
24
|
-
'slideInPanel/component': () => MockComponent,
|
|
25
|
-
'slideInPanel/componentProps': () => ({
|
|
26
|
-
width: '40%', title: 'Test Title', extraProp: 'extra'
|
|
27
|
-
})
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
store = createStore({
|
|
31
|
-
getters,
|
|
32
|
-
mutations: { 'slideInPanel/close': jest.fn() }
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
afterEach(() => {
|
|
37
|
-
// Clean up the teleport container
|
|
38
|
-
document.body.removeChild(slidesDiv);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const factory = () => {
|
|
42
|
-
return mount(SlideInPanelManager, {
|
|
43
|
-
attachTo: document.body, // attach to document so Teleport renders
|
|
44
|
-
global: { plugins: [store] }
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
it('renders slide in panel with proper style when open', async() => {
|
|
49
|
-
factory();
|
|
50
|
-
await nextTick();
|
|
51
|
-
|
|
52
|
-
const slidePanel = document.querySelector('#slides .slide-in') as HTMLElement;
|
|
53
|
-
const slideGlass = document.querySelector('[data-testid="slide-in-glass"]') as HTMLElement;
|
|
54
|
-
const slideComponent = document.querySelector('[data-testid="slide-in-panel-component"]') as HTMLElement;
|
|
55
|
-
const headerTitle = document.querySelector('#slides .slide-in .header .title') as HTMLElement;
|
|
56
|
-
|
|
57
|
-
expect(slidePanel).toBeTruthy();
|
|
58
|
-
expect(slideGlass).toBeTruthy();
|
|
59
|
-
expect(slideComponent).toBeTruthy();
|
|
60
|
-
expect(headerTitle.textContent?.trim()).toBe('Test Title');
|
|
61
|
-
|
|
62
|
-
const styleAttr = slidePanel.getAttribute('style') || '';
|
|
63
|
-
|
|
64
|
-
expect(styleAttr).toContain('width: 40%');
|
|
65
|
-
expect(styleAttr).toContain('top: 55px');
|
|
66
|
-
expect(styleAttr).toContain('height: calc(100vh - 55px)');
|
|
67
|
-
expect(styleAttr).toContain('right: 0');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('renders default panel title when no title is provided', async() => {
|
|
71
|
-
// Update getter so that no title is provided
|
|
72
|
-
getters['slideInPanel/componentProps'] = () => ({ width: '40%' });
|
|
73
|
-
store = createStore({
|
|
74
|
-
getters,
|
|
75
|
-
mutations: { 'slideInPanel/close': jest.fn() }
|
|
76
|
-
});
|
|
77
|
-
factory();
|
|
78
|
-
await nextTick();
|
|
79
|
-
|
|
80
|
-
const headerTitle = document.querySelector('#slides #slide-in-panel-manager .header .title') as HTMLElement;
|
|
81
|
-
|
|
82
|
-
expect(headerTitle.textContent?.trim()).toBe('Details');
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('computes panelTop correctly when a banner exists', async() => {
|
|
86
|
-
// Create a banner element with a simulated clientHeight.
|
|
87
|
-
const banner = document.createElement('div');
|
|
88
|
-
|
|
89
|
-
banner.setAttribute('id', 'banner-header');
|
|
90
|
-
document.body.appendChild(banner);
|
|
91
|
-
// Simulate a banner with a clientHeight of 100.
|
|
92
|
-
Object.defineProperty(banner, 'clientHeight', { value: 100, configurable: true });
|
|
93
|
-
|
|
94
|
-
factory();
|
|
95
|
-
await nextTick();
|
|
96
|
-
|
|
97
|
-
const slidePanel = document.querySelector('#slides .slide-in') as HTMLElement;
|
|
98
|
-
const styleAttr = slidePanel.getAttribute('style') || '';
|
|
99
|
-
|
|
100
|
-
// Expected panelTop = HEADER_HEIGHT (55) + banner.clientHeight (100) = "155px"
|
|
101
|
-
expect(styleAttr).toContain('top: 155px');
|
|
102
|
-
expect(styleAttr).toContain('height: calc(100vh - 155px)');
|
|
103
|
-
|
|
104
|
-
document.body.removeChild(banner);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('renders slide in glass as hidden and panel with negative right when closed', async() => {
|
|
108
|
-
// Set isOpen to false.
|
|
109
|
-
getters['slideInPanel/isOpen'] = () => false;
|
|
110
|
-
store = createStore({
|
|
111
|
-
getters,
|
|
112
|
-
mutations: { 'slideInPanel/close': jest.fn() }
|
|
113
|
-
});
|
|
114
|
-
factory();
|
|
115
|
-
await nextTick();
|
|
116
|
-
|
|
117
|
-
const slideGlass = document.querySelector('[data-testid="slide-in-glass"]') as HTMLElement;
|
|
118
|
-
|
|
119
|
-
expect(slideGlass).toBeTruthy();
|
|
120
|
-
expect(slideGlass.style.display).toBe('none');
|
|
121
|
-
|
|
122
|
-
const slidePanel = document.querySelector('#slides .slide-in') as HTMLElement;
|
|
123
|
-
const styleAttr = slidePanel.getAttribute('style') || '';
|
|
124
|
-
|
|
125
|
-
// With currentProps width "40%", panelRight should be "-40%" when closed.
|
|
126
|
-
expect(styleAttr).toContain('right: -40%');
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('calls store commit when clicking on the slide-in glass overlay', async() => {
|
|
130
|
-
const closeMutation = jest.fn();
|
|
131
|
-
|
|
132
|
-
getters['slideInPanel/isOpen'] = () => true;
|
|
133
|
-
store = createStore({
|
|
134
|
-
getters,
|
|
135
|
-
mutations: { 'slideInPanel/close': closeMutation }
|
|
136
|
-
});
|
|
137
|
-
factory();
|
|
138
|
-
await nextTick();
|
|
139
|
-
|
|
140
|
-
const slideGlass = document.querySelector('[data-testid="slide-in-glass"]') as HTMLElement;
|
|
141
|
-
|
|
142
|
-
slideGlass.click();
|
|
143
|
-
await nextTick();
|
|
144
|
-
|
|
145
|
-
expect(closeMutation).toHaveBeenCalledWith({}, undefined);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it('calls store commit when clicking on the slide-in close icon', async() => {
|
|
149
|
-
const closeMutation = jest.fn();
|
|
150
|
-
|
|
151
|
-
getters['slideInPanel/isOpen'] = () => true;
|
|
152
|
-
store = createStore({
|
|
153
|
-
getters,
|
|
154
|
-
mutations: { 'slideInPanel/close': closeMutation }
|
|
155
|
-
});
|
|
156
|
-
factory();
|
|
157
|
-
await nextTick();
|
|
158
|
-
|
|
159
|
-
const closeIcon = document.querySelector('[data-testid="slide-in-close"]') as HTMLElement;
|
|
160
|
-
|
|
161
|
-
closeIcon.click();
|
|
162
|
-
await nextTick();
|
|
163
|
-
|
|
164
|
-
expect(closeMutation).toHaveBeenCalledWith({}, undefined);
|
|
165
|
-
});
|
|
166
|
-
});
|