|
30 | 30 | </div>
|
31 | 31 | </div>
|
32 | 32 | <cly-section>
|
33 |
| - <cly-datatable-n :data-source="remoteTableDataSource" v-loading="areRowsLoading || isUserCommandLoading" :force-loading="isLoading" :available-dynamic-cols="optionalTableColumns" :resizable="true" class="is-clickable cly-vue-push-notification-table"> |
| 33 | + <cly-datatable-n test-id="messaging" :data-source="remoteTableDataSource" v-loading="areRowsLoading || isUserCommandLoading" :force-loading="isLoading" :available-dynamic-cols="optionalTableColumns" :resizable="true" class="is-clickable cly-vue-push-notification-table"> |
34 | 34 | <template v-slot:header-left>
|
35 | 35 | <cly-multi-select
|
36 | 36 | class="bu-ml-3 ratings-tab-view__filter-selector"
|
|
43 | 43 | <template slot-scope="scope">
|
44 | 44 | <div class="bu-is-flex bu-is-flex-direction-column">
|
45 | 45 | <a v-bind:href="'#/messaging/details/' + scope.row._id" class="bu-is-flex bu-is-align-items-center">
|
46 |
| - <a class="has-ellipsis">{{(scope.row.name)}}</a> |
| 46 | + <a class="has-ellipsis" :data-test-id="'datatable-messaging-campaign-name-' + scope.$index">{{(scope.row.name)}}</a> |
47 | 47 | </a>
|
48 | 48 | <span class="cly-vue-push-notification-table-column__second-line">
|
49 |
| - <span> {{getPreviewPlatforms(scope.row.platforms)}} </span> |
50 |
| - <span class="blinker cly-vue-push-notification-table-column__separator-blinker"></span> |
51 |
| - <span> {{i18n('push-notification.created-by')}} {{scope.row.createdBy || '-'}} </span> |
| 49 | + <span :data-test-id="'datatable-messaging-platform-name-' + scope.$index"> {{getPreviewPlatforms(scope.row.platforms)}} </span> |
| 50 | + <span class="blinker cly-vue-push-notification-table-column__separator-blinker" :data-test-id="'datatable-messaging-blinker-' + scope.$index"></span> |
| 51 | + <span :data-test-id="'datatable-messaging-created-by-' + scope.$index"> {{i18n('push-notification.created-by')}} {{scope.row.createdBy || '-'}} </span> |
52 | 52 | </span>
|
53 | 53 | </div>
|
54 | 54 | </template>
|
|
90 | 90 | </template>
|
91 | 91 | <el-table-column width="220" sortable="custom" prop="status" :label="i18n('push-notification.table-status')">
|
92 | 92 | <template slot-scope="scope">
|
93 |
| - <cly-status-tag :text="statusOptions[scope.row.status] && statusOptions[scope.row.status].label || '' " :color="getStatusBackgroundColor(scope.row.status)"> </cly-status-tag> |
| 93 | + <cly-status-tag :text="statusOptions[scope.row.status] && statusOptions[scope.row.status].label || '' " :color="getStatusBackgroundColor(scope.row.status)" :data-test-id="'datatable-messaging-status-' + scope.$index"> </cly-status-tag> |
94 | 94 | </template>
|
95 | 95 | </el-table-column>
|
96 | 96 | <el-table-column width="220" sortable="custom" prop="sent" :label="i18n('push-notification.table-sent')" class="cly-vue-push-notification-table-column">
|
97 | 97 | <template slot-scope="scope">
|
98 |
| - <span class="cly-vue-push-notification-table-column__numbers-only"> {{formatNumber(scope.row.sent)}} </span> |
| 98 | + <span class="cly-vue-push-notification-table-column__numbers-only" :data-test-id="'datatable-messaging-sent-' + scope.$index"> {{formatNumber(scope.row.sent)}} </span> |
99 | 99 | </template>
|
100 | 100 | </el-table-column>
|
101 | 101 | <el-table-column min-width="200" sortable="custom" prop="actioned" :label="i18n('push-notification.table-actioned')" class="cly-vue-push-notification-table-column">
|
102 | 102 | <template slot-scope="scope">
|
103 | 103 | <div class="bu-level">
|
104 | 104 | <div class="bu-level-left cly-vue-push-notification-table-column__numbers-only">
|
105 |
| - <span class="bu-mr-1">{{formatNumber(scope.row.actioned)}}</span> |
106 |
| - <span class="bu-mr-1">|</span> |
107 |
| - <span>{{formatPercentage(scope.row.actioned/scope.row.sent)}} %</span> |
| 105 | + <span class="bu-mr-1" :data-test-id="'datatable-messaging-actioned-value-' + scope.$index">{{formatNumber(scope.row.actioned)}}</span> |
| 106 | + <span class="bu-mr-1" :data-test-id="'datatable-messaging-actioned-divider-' + scope.$index">|</span> |
| 107 | + <span :data-test-id="'datatable-messaging-actioned-percentage-' + scope.$index">{{formatPercentage(scope.row.actioned/scope.row.sent)}} %</span> |
108 | 108 | </div>
|
109 | 109 | </div>
|
110 | 110 | </template>
|
|
113 | 113 | <template slot-scope="scope">
|
114 | 114 | <div class="bu-is-flex bu-is-flex-direction-column">
|
115 | 115 | <template v-if="scope.row.lastDate && scope.row.lastDate.date">
|
116 |
| - <span class="cly-vue-push-notification-table-column__first-line">{{scope.row.lastDate.date}}</span> |
117 |
| - <span class="cly-vue-push-notification-table-column__second-line">{{scope.row.lastDate.time}}</span> |
| 116 | + <span class="cly-vue-push-notification-table-column__first-line" :data-test-id="'datatable-messaging-date-sent-' + scope.$index">{{scope.row.lastDate.date}}</span> |
| 117 | + <span class="cly-vue-push-notification-table-column__second-line" :data-test-id="'datatable-messaging-scheduled-' + scope.$index">{{scope.row.lastDate.time}}</span> |
118 | 118 | </template>
|
119 | 119 | <template v-else>
|
120 | 120 | <span>-</span>
|
|
133 | 133 |
|
134 | 134 | <el-table-column type="options">
|
135 | 135 | <template slot-scope="scope">
|
136 |
| - <cly-more-options v-if="scope.row.hover" size="small" @command="handleUserCommands($event, scope.row._id, scope.row.notificationType)"> |
137 |
| - <el-dropdown-item v-if="shouldShowStartUserCommand(scope.row.status)" :command="UserCommandEnum.START">{{i18n('push-notification.start')}} </el-dropdown-item> |
138 |
| - <el-dropdown-item v-if="shouldShowStopUserCommand(scope.row.status)" :command="UserCommandEnum.STOP">{{i18n('push-notification.stop')}} </el-dropdown-item> |
139 |
| - <el-dropdown-item v-if="shouldShowEditUserCommand(scope.row.status)" :command="UserCommandEnum.EDIT">{{i18n('push-notification.edit')}}</el-dropdown-item> |
140 |
| - <el-dropdown-item v-if="shouldShowEditDraftUserCommand(scope.row.status)" :command="UserCommandEnum.EDIT_DRAFT">{{i18n('push-notification.edit-draft')}}</el-dropdown-item> |
141 |
| - <el-dropdown-item v-if="shouldShowEditRejectUserCommand(scope.row.status)" :command="UserCommandEnum.EDIT_REJECT">{{i18n('push-notification.edit')}}</el-dropdown-item> |
142 |
| - <el-dropdown-item v-if="shouldShowDuplicateUserCommand(scope.row.status)" :command="UserCommandEnum.DUPLICATE">{{i18n('push-notification.duplicate')}}</el-dropdown-item> |
143 |
| - <el-dropdown-item v-if="shouldShowDeleteUserCommand(scope.row.status)" :command="UserCommandEnum.DELETE">{{i18n('push-notification.delete')}}</el-dropdown-item> |
144 |
| - <el-dropdown-item v-if="shouldShowResendUserCommand(scope.row.status)" :command="UserCommandEnum.RESEND">{{i18n('push-notification.resend')}}</el-dropdown-item> |
145 |
| - <el-dropdown-item v-if="shouldShowApproveUserCommand(scope.row.status)" :command="UserCommandEnum.APPROVE">{{i18n('push-notification.approve')}}</el-dropdown-item> |
146 |
| - <el-dropdown-item v-if="shouldShowRejectUserCommand(scope.row.status)" :command="UserCommandEnum.REJECT">{{i18n('push-notification.reject')}}</el-dropdown-item> |
| 136 | + <cly-more-options :test-id="'datatable-messaging-more-button-' + scope.$index" v-if="scope.row.hover" size="small" @command="handleUserCommands($event, scope.row._id, scope.row.notificationType)"> |
| 137 | + <el-dropdown-item v-if="shouldShowStartUserCommand(scope.row.status)" :command="UserCommandEnum.START" :data-test-id="'datatable-messaging-more-option-start-' + scope.$index">{{i18n('push-notification.start')}} </el-dropdown-item> |
| 138 | + <el-dropdown-item v-if="shouldShowStopUserCommand(scope.row.status)" :command="UserCommandEnum.STOP" :data-test-id="'datatable-messaging-more-option-stop-' + scope.$index">{{i18n('push-notification.stop')}} </el-dropdown-item> |
| 139 | + <el-dropdown-item v-if="shouldShowEditUserCommand(scope.row.status)" :command="UserCommandEnum.EDIT" :data-test-id="'datatable-messaging-more-option-edit-' + scope.$index">{{i18n('push-notification.edit')}}</el-dropdown-item> |
| 140 | + <el-dropdown-item v-if="shouldShowEditDraftUserCommand(scope.row.status)" :command="UserCommandEnum.EDIT_DRAFT" :data-test-id="'datatable-messaging-more-option-edit-draft-' + scope.$index">{{i18n('push-notification.edit-draft')}}</el-dropdown-item> |
| 141 | + <el-dropdown-item v-if="shouldShowEditRejectUserCommand(scope.row.status)" :command="UserCommandEnum.EDIT_REJECT" :data-test-id="'datatable-messaging-more-option-edit-reject-' + scope.$index">{{i18n('push-notification.edit')}}</el-dropdown-item> |
| 142 | + <el-dropdown-item v-if="shouldShowDuplicateUserCommand(scope.row.status)" :command="UserCommandEnum.DUPLICATE" :data-test-id="'datatable-messaging-more-option-duplicate-' + scope.$index">{{i18n('push-notification.duplicate')}}</el-dropdown-item> |
| 143 | + <el-dropdown-item v-if="shouldShowDeleteUserCommand(scope.row.status)" :command="UserCommandEnum.DELETE" :data-test-id="'datatable-messaging-more-option-delete-' + scope.$index">{{i18n('push-notification.delete')}}</el-dropdown-item> |
| 144 | + <el-dropdown-item v-if="shouldShowResendUserCommand(scope.row.status)" :command="UserCommandEnum.RESEND" :data-test-id="'datatable-messaging-more-option-resend-' + scope.$index">{{i18n('push-notification.resend')}}</el-dropdown-item> |
| 145 | + <el-dropdown-item v-if="shouldShowApproveUserCommand(scope.row.status)" :command="UserCommandEnum.APPROVE" :data-test-id="'datatable-messaging-more-option-approve-' + scope.$index">{{i18n('push-notification.approve')}}</el-dropdown-item> |
| 146 | + <el-dropdown-item v-if="shouldShowRejectUserCommand(scope.row.status)" :command="UserCommandEnum.REJECT" :data-test-id="'datatable-messaging-more-option-reject-' + scope.$index">{{i18n('push-notification.reject')}}</el-dropdown-item> |
147 | 147 | </cly-more-options>
|
148 | 148 | </template>
|
149 | 149 | </el-table-column>
|
|
0 commit comments