-
Notifications
You must be signed in to change notification settings - Fork 981
Expand file tree
/
Copy pathevents-default.html
More file actions
212 lines (198 loc) · 15.6 KB
/
events-default.html
File metadata and controls
212 lines (198 loc) · 15.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<div class="cly-vue-data-manager__events">
<cly-main>
<cly-notification v-if="limits && limits.show" class="cly-vue-data-manager__alerts bu-mx-5 bu-mb-5" :text="limits.message" color="light-warning">
</cly-notification>
<cly-datatable-n
ref="eventsDefaultTable"
test-id="datatable-events"
:searchPlaceholder="i18n('data-manager.event-search-placeholder')"
:rows="events"
:keyFn="function(row) {return row.key ||row.e || row.name}"
:indent=0
:force-loading="isLoading"
:tracked-fields="trackedFields"
@select-all="handleAllChange"
@select="handleCurrentChange"
:available-dynamic-cols="dynamicEventCols"
:persist-key="eventsTablePersistKey"
:default-sort="{prop: 'lastModifiedts', order: 'descending'}">
<template v-slot:header-left>
<cly-multi-select
test-id="event-category-filters"
ref="eventCategoryFilters"
v-bind:arrow="true"
:selectXWidth="336"
v-model="filter"
:fields="filterFields">
<template v-slot:action>
<div class="bu-level-item bu-is-clickable text-small color-red-100 bu-pl-1">
<a @click="manageCategories">Manage</a>
</div>
</template>
</cly-multi-select>
</template>
<template v-slot="scope">
<el-table-column v-if="canUserUpdate || canUserDelete" fixed="left" type="selection" :reserve-selection="true" width="55" prop="isSelected">
</el-table-column>
<el-table-column fixed="left" min-width="330" sortable="custom" prop="name" :label="i18n('data-manager.event-name')">
<template v-slot="rowScope">
<!-- <div @click="onRowClick(rowScope.row)" class="cly-vue-data-manager__clickable bu-is-clickable color-dark-blue-100">{{rowScope.row.name || rowScope.row.key || rowScope.row.e}}</div> -->
<a v-bind:href="'#/manage/data-manager/events/events/' + JSON.stringify(rowScope.row.key)" @click="onRowClick(rowScope.row)" class="cly-vue-data-manager__clickable bu-is-clickable color-dark-blue-100">
<div :data-test-id="'datatable-manage-events-events-event-name-' + rowScope.$index">{{unescapeHtml(rowScope.row.name || rowScope.row.key || rowScope.row.e)}}</div>
</a>
<div v-if="rowScope.row.audit && rowScope.row.audit.userName" :data-test-id="'datatable-manage-events-last-modified-by-label-' + rowScope.$index" class="text-small color-cool-gray-50">Last modified by {{rowScope.row.audit.userName}}</div>
<div>
<span v-if="isDrill" class="tag-container">
<span v-bind:class="statusClassObject(rowScope.row.status)" class="bu-tag bu-mt-1">
<span class="blinker"></span>
<span :data-test-id="'datatable-manage-events-events-status-' + rowScope.$index">{{rowScope.row.status}}</span>
</span>
</span>
<span v-if="rowScope.row.is_visible === false" :data-test-id="'datatable-manage-events-events-icon-eye-hidden-' + rowScope.$index" class="cly-vue-data-manager__hidden-icon">
<i class="ion-eye-disabled"></i>
</span>
<span v-else class="cly-vue-data-manager__hidden-icon"><i class="ion-eye" :data-test-id="'datatable-manage-events-events-icon-eye-visible-' + rowScope.$index"></i></ion-icon></span>
<span v-if="eventTransformationMap && eventTransformationMap[rowScope.row.key]" class="cly-vue-data-manager__transform-icon">
<svg width="12px" height="10px" viewBox="0 0 12 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="transformations" transform="translate(-320.000000, -295.000000)" fill="#444444" fill-rule="nonzero">
<g id="Group-9" transform="translate(320.000000, 292.000000)">
<g id="merge_type-24px" transform="translate(46.500000, 8.000000) rotate(90.000000) translate(-46.500000, -8.000000) translate(38.500000, -38.500000)">
<path fill="#fff" d="M11.3333333,92.6066667 L12.2733333,91.6666667 L10,89.3933333 L9.06,90.3333333 L11.3333333,92.6066667 Z M5,84.3333333 L7.33333333,84.3333333 L7.33333333,88.06 L3.72666667,91.6666667 L4.66666667,92.6066667 L8.66666667,88.6066667 L8.66666667,84.3333333 L11,84.3333333 L8,81.3333333 L5,84.3333333 Z" id="Shape"></path>
</g>
</g>
</g>
</g>
</svg>
</span>
</div>
</template>
</el-table-column>
<template v-for="(col,idx) in scope.dynamicCols" :prop="col.value">
<el-table-column v-if="col.value === 'category'"
min-width="250" sortable="custom" prop="categoryName" :label="i18n('data-manager.category')">
<template v-slot="rowScope">
<div :data-test-id="'datatable-manage-events-events-category-name-' + rowScope.$index">{{unescapeHtml(rowScope.row.categoryName)}}</div>
</template>
</el-table-column>
<el-table-column v-else-if="col.value === 'lastModifiedts'"
prop="lastModifiedts" column-key="lastModifiedDate" sortable="custom" min-width="275" :label="i18n('data-manager.last-modified')">
<template v-slot="rowScope">
<div v-if="rowScope.row && rowScope.row.lastModifiedts">
<div :data-test-id="'datatable-manage-events-events-last-mod-date-' + rowScope.$index">{{rowScope.row.lastModifiedDate || i18n('data-manager.empty-placeholder') }}</div>
<span class="text-small color-cool-gray-50" :data-test-id="'datatable-manage-events-events-last-mod-time-' + rowScope.$index">{{rowScope.row.lastModifiedTime}}</span>
</div>
<div :data-test-id="'datatable-manage-events-events-last-mod-date-' + rowScope.$index" v-else>
{{ i18n('data-manager.empty-placeholder') }}
</div>
</template>
</el-table-column>
<el-table-column v-else-if="col.value === 'lts' && isDrill" sortable="custom" min-width="250" prop="lts" :label="i18n('data-manager.last-triggered')">
<template v-slot="rowScope">
<div v-if="rowScope.row && rowScope.row.lts">
<div>{{rowScope.row.lastTriggerDate || i18n('data-manager.empty-placeholder') }}</div>
</div>
<div v-else :data-test-id="'datatable-manage-events-events-last-triggered-value-' + rowScope.$index">
{{ i18n('data-manager.empty-placeholder') }}
</div>
</template>
</el-table-column>
<el-table-column v-else-if="col.value === 'totalCount' " sortable="custom" min-width="250" prop="totalCount" label="Count">
<template v-slot="rowScope">
<div :data-test-id="'datatable-manage-events-events-count-' + rowScope.$index">{{rowScope.row.totalCountFormatted || i18n('data-manager.empty-placeholder') }}</div>
</template>
</el-table-column>
<el-table-column v-else-if="col.value === 'description' " sortable="custom" min-width="250" prop="description" :label="i18n('data-manager.description')">
<template v-slot="rowScope">
<div :data-test-id="'datatable-manage-events-events-description-' + rowScope.$index">{{unescapeHtml(rowScope.row.description || i18n('data-manager.empty-placeholder'))}}</div>
</template>
</el-table-column>
<el-table-column v-else v-bind:sortable="col.sort ? 'custom' : false" :key="idx" min-width="300" :prop="col.value" :label="col.label">
<template v-slot="rowScope">
<div :data-test-id="'datatable-manage-events-events-value-' + rowScope.$index">{{unescapeHtml(rowScope.row[col.value] || i18n('data-manager.empty-placeholder'))}}</div>
</template>
</el-table-column>
</template>
<el-table-column type="options" align="center">
<template v-slot="rowScope">
<cly-more-options test-id="more-button" v-if="(canUserUpdate || canUserDelete) && rowScope.row.hover" size="small" @command="handleCommand($event, scope, rowScope.row)">
<el-dropdown-item v-if="canUserUpdate" command="edit" :data-test-id="'datatable-manage-events-events-edit-button-' + rowScope.$index">{{i18n('common.edit')}}</el-dropdown-item>
<el-dropdown-item v-if="canUserDelete" command="delete" :data-test-id="'datatable-manage-events-events-delete-button-' + rowScope.$index">{{i18n('common.delete')}}</el-dropdown-item>
</cly-more-options>
</template>
</el-table-column>
</template>
<template v-slot:bottomline="scope">
<cly-diff-helper v-if="canUserUpdate || canUserDelete" :diff="scope.diff" @discard="scope.unpatch()" :isModal=true>
<template v-slot:main>
<div class="bu-mr-0 bu-is-flex bu-is-justify-content-flex-end bu-is-align-items-center cly-vue-user-selected" style="height: 100%;">
<span class="selected-count-blue bu-pl-1 text-medium"></span>
<span style="background-color:#0166D6; color:white; padding:3px 7px; border-radius:4px;">{{scope.diff.length}}</span><span class="bu-is-lowercase text-medium color-cool-gray-50 bu-pl-1">{{i18n('common.selected')}}</span>
</span>
<span class="vertical-divider bu-mr-4 bu-ml-4"></span>
<cly-more-options class="bu-mr-3" size="small" :text="i18n('data-manager.change-category')" type="default" icon="cly-io cly-io-hashtag bu-mr-2" :widthSameAsTrigger="true" :showArrows=true @command="handleChangeCategory($event, scope.diff)">
<el-dropdown-item command=null><i class="cly-io cly-io-hashtag"></i>{{ i18n('data-manager.uncategorized') }}</el-dropdown-item>
<el-dropdown-item :command="cat._id" :key="idx" v-for="(cat, idx) in categories"><i class="cly-io cly-io-hashtag"></i>{{cat.name}}</el-dropdown-item>
</cly-more-options>
<cly-more-options v-if="isDrill" class="bu-mr-3" size="small" text="Change Status" type="default" icon="cly-io cly-io-refresh bu-mr-2" :widthSameAsTrigger="true" :showArrows=true @command="handleChangeStatus($event, scope.diff)" >
<el-dropdown-item command="live" icon="cly-io cly-io-play">{{ i18n('data-manager.live') }}</el-dropdown-item>
<el-dropdown-item command="approved" icon="cly-io cly-io-badge-check">{{ i18n('data-manager.approved') }}</el-dropdown-item>
<el-dropdown-item command="unplanned" icon="cly-io cly-io-clock">{{ i18n('data-manager.unplanned') }}</el-dropdown-item>
<el-dropdown-item command="created" icon="cly-io cly-io-plus-circle">{{ i18n('data-manager.created') }}</el-dropdown-item>
<el-dropdown-item command="blocked" icon="cly-io cly-io-x-circle">{{ i18n('data-manager.blocked') }}</el-dropdown-item>
</cly-more-options>
<cly-more-options size="small" :text=" i18n('data-manager.change-visibility') " type="default" icon="cly-io cly-io-eye bu-mr-2" :widthSameAsTrigger="true" :showArrows=true @command="handleChangeVisibility($event, scope.diff)">
<el-dropdown-item command="visible"><i class="cly-io cly-io-eye"></i>{{ i18n('data-manager.visible') }}</el-dropdown-item>
<el-dropdown-item command="hidden"><i class="cly-io cly-io-eye-off"></i>{{ i18n('data-manager.hidden') }}</el-dropdown-item>
</cly-more-options>
<span class="vertical-divider bu-mr-4 bu-ml-4"></span>
<el-button v-if="canUserDelete" class="bu-mr-3" size="small" type="default" @click="handleDelete(scope.diff)">
<i class="cly-io-16 cly-io cly-io-trash" style="color:red"></i>
<span class="ml-1" style="color: red">
{{ i18n('common.delete') }}
</span>
</el-button>
<el-button class="x-button" @click="unpatchSelectedEvents">
<i class="cly-io-16 cly-io cly-io-x color-cool-gray-50"></i>
</el-button>
</div>
</template>
</cly-diff-helper>
</template>
</cly-datatable-n>
</cly-main>
<cly-confirm-dialog
@cancel="closeDeleteForm"
@confirm="submitDeleteForm"
:before-close="closeDeleteForm"
ref="deleteConfirmDialog"
:visible.sync="showDeleteDialog"
dialogType="danger"
:saveButtonLabel="i18n('common.delete')"
:cancelButtonLabel="i18n('common.no-dont-delete')"
:title="i18n('data-manager.delete-events')">
<template slot-scope="scope">
<div data-test-id="delete-event-popup-delete-event-permanently-question-label">{{i18n('data-manager.delete-event-permanently')}}<br/></div>
<small data-test-id="delete-popup-delete-event-warning-label" class="color-red-100">{{ i18n('data-manager.delete-event-warning') }}</small>
<ul>
<li v-for="ev in deleteQueue" data-test-id="delete-event-popup-event-key"> {{ev.key || ev.e || ev.name}}</li>
</ul>
</template>
</cly-confirm-dialog>
<cly-form-dialog
name="Manage Categories"
:title="i18n('data-manager.manage-categories')"
@submit="onSaveCategories"
:closeFn="onCloseCategories"
saveButtonLabel="Save"
:isOpened="categoryDialogVisible"
v-bind="categories">
<template v-slot="formDialogScope">
<data-manager-manage-category
:max-categories="100"
:deletedCategories="deletedCategories"
v-model="categories">
</data-manager-manage-category>
</template>
</cly-form-dialog>
</div>