Skip to content

Commit add7015

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/ui-tests/cypress-15.2.0
2 parents b2d37b4 + 0ab63c5 commit add7015

File tree

25 files changed

+678
-68
lines changed

25 files changed

+678
-68
lines changed

plugins/dashboards/frontend/public/templates/dashboards-drawer.html

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@
33
@copy="onCopy"
44
@close="onClose"
55
:title="title"
6+
test-id="create-dashboard-drawer"
67
:saveButtonLabel="saveButtonLabel"
78
v-bind="controls">
89
<template v-slot:default="drawerScope">
910
<cly-form-step id="dashboards-drawer">
10-
<cly-form-field :label="i18n('dashboards.dashboard-name')" name="name" rules="required" v-slot:default>
11+
<cly-form-field :label="i18n('dashboards.dashboard-name')" name="name" rules="required" v-slot:default test-id="dashboard-name-input-label">
1112
<el-input
1213
v-model="drawerScope.editedObject.name"
14+
test-id="dashboard-name-input"
1315
:placeholder="i18n('placeholder.dashboards.dashboard-name')">
1416
</el-input>
1517
</cly-form-field>
16-
<div class="text-big font-weight-bold">
18+
<div class="text-big font-weight-bold" data-test-id="dashboard-visibility-label">
1719
{{i18n('dashboards.share-with')}}
18-
<cly-tooltip-icon :tooltip="i18n('dashboards.share-with-tooltip-content')"></cly-tooltip-icon>
20+
<cly-tooltip-icon :tooltip="i18n('dashboards.share-with-tooltip-content')" data-test-id="dashboard-visibility-tooltip"></cly-tooltip-icon>
1921
</div>
2022
<cly-form-field name="share_with" rules="required">
2123
<el-radio-group :disabled="!canShare" v-model="drawerScope.editedObject.share_with" style="width: 100%;">
2224
<el-radio
2325
border
2426
class="is-autosized-vstack"
27+
:test-id="'dashboard-visibility-option-' + item.value"
2528
v-for="(item) in constants.sharingOptions"
2629
:label="item.value"
2730
:key="item.value">
@@ -37,29 +40,31 @@
3740

3841

3942
<div v-if="drawerScope.editedObject.share_with === 'selected-users'">
40-
<div class="text-big font-weight-bold">
43+
<div class="text-big font-weight-bold" data-test-id="dashboard-user-permissions-label">
4144
{{i18n('dashboards.user-permissions')}}
42-
<cly-tooltip-icon :tooltip="i18n('dashboards.user-permissions-tooltip-content')"></cly-tooltip-icon>
45+
<cly-tooltip-icon :tooltip="i18n('dashboards.user-permissions-tooltip-content')" data-test-id="dashboard-user-permissions-tooltip"></cly-tooltip-icon>
4346
</div>
44-
<cly-form-field :label="i18n('dashboards.users-edit-permission')" :subheading="i18n('dashboards.users-edit-description')">
45-
<cly-select-email :disabled="!canShare" v-model="sharedEmailEdit" :placeholder="canShare ? i18n('dashboards.enter-user-email') : i18n('dashbaords.sharing-disabled')"></cly-select-email>
47+
<cly-form-field :label="i18n('dashboards.users-edit-permission')" :subheading="i18n('dashboards.users-edit-description')" test-id="dashboard-users-edit-permission-label">
48+
<cly-select-email :disabled="!canShare" v-model="sharedEmailEdit" :placeholder="canShare ? i18n('dashboards.enter-user-email') : i18n('dashbaords.sharing-disabled')" test-id="edit-permission-user-email-input"></cly-select-email>
4649
</cly-form-field>
47-
<cly-form-field :label="i18n('dashboards.users-view-permission')" :subheading="i18n('dashboards.users-view-description')">
48-
<cly-select-email :disabled="!canShare" v-model="sharedEmailView" :placeholder="canShare ? i18n('dashboards.enter-user-email') : i18n('dashbaords.sharing-disabled')"></cly-select-email>
50+
<cly-form-field :label="i18n('dashboards.users-view-permission')" :subheading="i18n('dashboards.users-view-description')" test-id="dashboard-users-view-permission-label">
51+
<cly-select-email :disabled="!canShare" v-model="sharedEmailView" :placeholder="canShare ? i18n('dashboards.enter-user-email') : i18n('dashbaords.sharing-disabled')" test-id="view-permission-user-email-input"></cly-select-email>
4952
</cly-form-field>
5053
</div>
5154

5255
<div v-if="(drawerScope.editedObject.share_with === 'selected-users') && groupSharingAllowed">
53-
<div class="text-big font-weight-bold">
56+
<div class="text-big font-weight-bold" data-test-id="dashboard-user-group-permissions-label">
5457
{{i18n('dashboards.user-group-permission')}}
55-
<cly-tooltip-icon :tooltip="i18n('dashboards.user-group-permission-tooltip-content')"></cly-tooltip-icon>
58+
<cly-tooltip-icon :tooltip="i18n('dashboards.user-group-permission-tooltip-content')" data-test-id="dashboard-user-group-permission-tooltip"></cly-tooltip-icon>
5659
</div>
5760
<cly-form-field
5861
name="shared_user_groups_edit"
62+
test-id="dashboard-user-group-edit-permission-label"
5963
:label="i18n('dashboards.users-edit-permission')"
6064
:subheading="i18n('dashboards.users-edit-description')">
6165
<el-select
6266
:key="elSelectKey"
67+
test-id="dashboard-user-group-edit-permission"
6368
multiple
6469
:disabled="!canShare"
6570
v-model="sharedGroupEdit"
@@ -75,10 +80,12 @@
7580
</cly-form-field>
7681
<cly-form-field
7782
name="shared_user_groups_view"
83+
test-id="dashboard-user-group-view-permission-label"
7884
:label="i18n('dashboards.users-view-permission')"
7985
:subheading="i18n('dashboards.users-view-description')">
8086
<el-select
8187
:key="elSelectKey"
88+
test-id="dashboard-user-group-view-permission"
8289
multiple
8390
:disabled="!canShare"
8491
v-model="sharedGroupView"
@@ -94,28 +101,29 @@
94101
</cly-form-field>
95102
</div>
96103

97-
<div class="text-big font-weight-bold bu-mt-4">
104+
<div class="text-big font-weight-bold bu-mt-4" data-test-id="dashboard-additional-settings-label">
98105
{{i18n('dashboards.additional-settings')}}
99106
</div>
100107
<cly-form-field name="send-email">
101-
<el-checkbox v-model="drawerScope.editedObject.send_email_invitation">{{i18n('dashboards.send-email')}}</el-checkbox>
108+
<el-checkbox v-model="drawerScope.editedObject.send_email_invitation" test-id="dashboard-send-email-checkbox">{{i18n('dashboards.send-email')}}</el-checkbox>
102109
</cly-form-field>
103110
<cly-form-field name="use-refresh-rate">
104-
<el-checkbox v-model="drawerScope.editedObject.use_refresh_rate">
111+
<el-checkbox v-model="drawerScope.editedObject.use_refresh_rate" test-id="dashboard-use-refresh-rate-checkbox">
105112
{{ i18nM("dashboards.custom-refresh-rate") }}
106-
<cly-tooltip-icon :tooltip="i18n('dashboards.custom-refresh-rate-description')"></cly-tooltip-icon>
113+
<cly-tooltip-icon :tooltip="i18n('dashboards.custom-refresh-rate-description')" data-test-id="dashboard-custom-refresh-rate-tooltip"></cly-tooltip-icon>
107114
</el-checkbox>
108115
<cly-form-field
109116
v-if="drawerScope.editedObject.use_refresh_rate"
110117
name="title"
111118
:rules="drawerScope.editedObject.use_refresh_rate ? 'required' : ''">
112119
<el-input
113120
v-model="drawerScope.editedObject.refreshRate"
121+
test-id="dashboard-custom-refresh-rate-input"
114122
placeholder="">
115123
</el-input>
116124
</cly-form-field>
117125
</cly-form-field>
118126

119127
</cly-form-step>
120128
</template>
121-
</cly-drawer>
129+
</cly-drawer>

plugins/dashboards/frontend/public/templates/dashboards-menu.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<div style="height: 100%;">
22
<div class="cly-vue-sidebar__header">
3-
<span class="cly-vue-sidebar__header-title">Dashboards</span>
3+
<span class="cly-vue-sidebar__header-title" data-test-id="dashboard-menu-title">Dashboards</span>
44
<span class="cly-vue-sidebar__header-button" v-if="canCreate">
5-
<el-button type="success" size="small" @click="addDashboard">
5+
<el-button type="success" size="small" @click="addDashboard" data-test-id="add-dashboard-button">
66
<i class="ion-plus-circled"></i>
77
<span>New</span>
88
</el-button>
99
</span>
1010
<form>
1111
<el-input
1212
class="bu-mt-5 cly-vue-sidebar__header-search"
13+
test-id="dashboard-search-box"
1314
autocomplete="off"
1415
v-model="searchQuery"
1516
placeholder="Search in Dashboards">
@@ -20,7 +21,12 @@
2021
<div class="cly-vue-sidebar__main-menu">
2122
<vue-scroll :ops="{scrollPanel: { scrollingX: false }}">
2223
<ul>
23-
<li v-for="(dashboard, idx) in allDashboards" :key="dashboard.id" :class="['bu-px-3 bu-mb-1 bu-is-clickable', {'bu-mb-6': (idx === (allDashboards.length - 1) ? true: false)}]">
24+
<li
25+
v-for="(dashboard, idx) in allDashboards"
26+
:key="dashboard.id"
27+
:class="['bu-px-3 bu-mb-1 bu-is-clickable', {'bu-mb-6': (idx === (allDashboards.length - 1) ? true: false)}]"
28+
:data-test-id="'custom-dashboard-' + idx"
29+
>
2430
<a :href="'#/custom/' + dashboard._id">
2531
<div
2632
style="width: calc(100% - 24px);"

plugins/dashboards/frontend/public/templates/helpers/drawer/metric.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<cly-form-field
22
name="metrics"
3+
test-id="metric"
34
rules="required"
45
:label="i18nM(multiple ? 'dashboards.metrics-multi': 'dashboards.metrics-single')">
56
<el-select
67
:is-full-width="true"
8+
test-id="metric"
79
:key="rerender"
810
style="width: 100%;"
911
v-bind="$attrs"
@@ -20,4 +22,4 @@
2022
:value="metric.value">
2123
</el-option>
2224
</el-select>
23-
</cly-form-field>
25+
</cly-form-field>

plugins/dashboards/frontend/public/templates/helpers/drawer/source-apps.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<cly-form-field
22
name="apps"
3+
test-id="source-apps"
34
rules="required"
45
:label="i18nM('dashboards.source-apps')">
56
<cly-app-select
67
:key="rerender"
8+
test-id="source-apps-select"
79
style="width: 100%;"
810
v-bind="$attrs"
911
v-on="allListeners"
@@ -13,4 +15,4 @@
1315
:multiple-limit="multipleLimit"
1416
:placeholder="placeholderText">
1517
</cly-app-select>
16-
</cly-form-field>
18+
</cly-form-field>

plugins/dashboards/frontend/public/templates/helpers/drawer/visualization.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<cly-form-field
22
name="visualization"
3+
test-id="visualization"
34
:rules="{ required: { allowFalse: false } }"
45
:subheading="!mute && i18nM('dashbaords.visualization-description')"
56
:label="!mute && i18nM('dashbaords.visualization')">
@@ -14,6 +15,7 @@
1415
:class="['clyd-visualization__item bu-is-clickable',
1516
'bu-is-flex bu-is-flex-direction-column bu-is-justify-content-center bu-is-align-items-center',
1617
{'selected': item.value === selectedType}]"
18+
:data-test-id="`visualization-item-${item.value}`"
1719
@click="onClick(item)">
1820
<div class="text-smallish">{{item.label}}</div>
1921
</div>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div class="clyd-apps">
22
<hr>
3-
<div class="bu-is-flex bu-is-flex-wrap-wrap apps">
3+
<div class="bu-is-flex bu-is-flex-wrap-wrap apps" data-test-id="widget-apps">
44
<span class="bu-ml-1 text-small has-ellipsis bu-is-flex-shrink-1" v-if="isMultiple" v-tooltip="tooltip">
55
{{ i18n("dashboards.multiple-apps-count", apps.length) }}
66
</span>
77
<div v-else class="bu-is-flex apps__single">
88
<div v-if="app.avatar" class="apps__single--avatar bu-mr-1" :style="app.avatar">
9-
<span v-if="!app.image" class="has-ellipsis">{{getAppInitials(app.name)}}</span>
9+
<span v-if="!app.image" class="has-ellipsis" data-test-id="widget-app-icon">{{getAppInitials(app.name)}}</span>
1010
</div>
11-
<span class="text-small has-ellipsis bu-is-flex-shrink-1">{{app.name}}</span>
11+
<span class="text-small has-ellipsis bu-is-flex-shrink-1" data-test-id="widget-app-name">{{app.name}}</span>
1212
</div>
1313
</div>
1414
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div class="text-small clyd-legend-period has-ellipsis bu-is-flex-shrink-1 bu-mr-1" :class="{'clyd-legend-period--custom': customPeriod ? true: false}">{{period}}</div>
1+
<div class="text-small clyd-legend-period has-ellipsis bu-is-flex-shrink-1 bu-mr-1" :class="{'clyd-legend-period--custom': customPeriod ? true: false}" data-test-id="widget-period">{{period}}</div>

plugins/dashboards/frontend/public/templates/helpers/widget/secondary-legend.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div v-if="item.labels && item.labels.length" class="bu-is-flex bu-is-align-items-center bu-is-flex-shrink-1 bu-is-flex-grow-1" style="min-width: 0">
55
<div v-for="(label, i) in item.labels" :class="['bu-is-flex bu-is-align-items-center bu-is-flex-shrink-1 bu-px-2 bu-mr-1']" :style="{backgroundColor: label.color + '26', borderRadius: '4px', minWidth: 0}">
66
<i class="fas fa-circle bu-mr-2" :style="{fontSize: '6px', color: label.color}"></i>
7-
<span class="text-small has-ellipsis bu-is-flex-shrink-1">{{unescapeHtml(label.label)}}</span>
7+
<span class="text-small has-ellipsis bu-is-flex-shrink-1" :data-test-id="'widget-label-' + i">{{unescapeHtml(label.label)}}</span>
88
</div>
99
</div>
1010
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div v-if="labels" class="clyd-title-labels bu-is-flex bu-is-flex-shrink-1" style="min-width: 0;">
2-
<div v-for="(item, idx) in labels" class="bu-ml-1 bu-p-1 text-smallest has-ellipsis">
2+
<div v-for="(item, idx) in labels" class="bu-ml-1 bu-p-1 text-smallest has-ellipsis" :data-test-id="'widget-item-' + idx">
33
{{item}}
44
</div>
55
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div class="bu-is-flex bu-is-flex-shrink-1" style="min-width: 0">
2-
<h4 class="bu-is-flex-shrink-1 has-ellipsis" v-if="title">{{unescapeHtml(title)}}</h4>
2+
<h4 class="bu-is-flex-shrink-1 has-ellipsis" v-if="title" data-test-id="widget-title">{{unescapeHtml(title)}}</h4>
33
<clyd-title-labels v-if="labels && labels.length" :labels="labels"></clyd-title-labels>
44
</div>

0 commit comments

Comments
 (0)