Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overwritten lines brought back. #2968

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions plugins/star-rating/frontend/public/javascripts/countly.views.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,15 @@
data: function() {
return {
cohortsEnabled: countlyGlobal.plugins.indexOf('cohorts') > -1,
widgetsTablePersistKey: 'widgets_table_' + countlyCommon.ACTIVE_APP_ID
persistKey: 'ratingsWidgetsTable_' + countlyCommon.ACTIVE_APP_ID,
tableDynamicCols: [
{
value: "target_pages",
label: CV.i18n("feedback.pages"),
default: true,
required: true
}
],
};
},
computed: {
Expand Down Expand Up @@ -443,6 +451,11 @@
],
data: function() {
return {
empty: {
title: CV.i18n("ratings.empty.title"),
body: CV.i18n("ratings.empty.body"),
image: "/star-rating/images/star-rating/ratings-empty.svg"
},
widgets: [],
drawerSettings: {
createTitle: CV.i18n('feedback.add-widget'),
Expand Down Expand Up @@ -658,19 +671,24 @@
// reset cumulative data
self.cumulativeData = [{
count: 0,
percent: 0
percent: 0,
rating: 0
}, {
count: 0,
percent: 0
percent: 0,
rating: 1
}, {
count: 0,
percent: 0
percent: 0,
rating: 2
}, {
count: 0,
percent: 0
percent: 0,
rating: 3
}, {
count: 0,
percent: 0
percent: 0,
rating: 4
}];

var ratingArray = [];
Expand Down
30 changes: 17 additions & 13 deletions plugins/star-rating/frontend/public/templates/widgets-table.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<cly-datatable-n
:force-loading="loading"
:rows="widgets"
:persist-key="widgetsTablePersistKey">
:persist-key="persistKey"
:available-dynamic-cols="tableDynamicCols"
width="100%">
<template v-slot="scope">
<el-table-column width="100" fixed type="switch" sortable="true" prop="status" :label="i18n('feedback.status')">
<template v-slot="rowScope">
Expand All @@ -12,7 +14,7 @@
</el-switch>
</template>
</el-table-column>
<el-table-column width="350" fixed :label="i18n('feedback.ratings-widget-name')">
<el-table-column min-width="300" fixed :label="i18n('feedback.ratings-widget-name')">
<template v-slot="rowScope">
<div @click="goWidgetDetail(rowScope.row._id)" :class="[rowScope.row.hover && 'bu-is-underlined bu-is-clickable color-primary', 'color-dark-blue-100 text-medium']">
{{rowScope.row.popup_header_text}}
Expand All @@ -23,33 +25,35 @@
</div>
</template>
</el-table-column>
<el-table-column v-if="cohortsEnabled" prop="targeting" :label="i18n('feedback.targeting')">
<el-table-column min-width="150" v-if="cohortsEnabled" prop="targeting" :label="i18n('feedback.targeting')">
<template v-slot="rowScope">
<cly-cohort-targeting inline :targeting="rowScope.row.targeting">
</cly-cohort-targeting>
</template>
</el-table-column>
<el-table-column sortable="true" prop="rating_score" :label="i18n('feedback.rating-score')">
<el-table-column min-width="150" sortable="true" prop="rating_score" :label="i18n('feedback.rating-score')">
<template v-slot="rowScope" class="bu-is-flex bu-is-justify-content-center">
<span class="bu-is-size-4">
{{ rowScope.row.ratingScore }}
</span>
</template>
</el-table-column>
<el-table-column sortable="true" prop="responses" :label="i18n('feedback.responses')">
<el-table-column min-width="130" sortable="true" prop="responses" :label="i18n('feedback.responses')">
<template v-slot="rowScope" class="bu-is-flex bu-is-justify-content-center">
<span class="text-medium">
{{ rowScope.row.ratingsCount }}
</span>
</template>
</el-table-column>
<el-table-column sortable="true" prop="target_pages" :label="i18n('feedback.pages')">
<template v-slot="rowScope" class="bu-is-flex bu-is-justify-content-center">
<span class="text-medium">
{{ rowScope.row.target_pages }}
</span>
</template>
</el-table-column>
</template>
<template v-for="(col,idx) in scope.dynamicCols" :prop="col.value">
<el-table-column v-if="col.value === 'target_pages'" :key="idx"
min-width="120" sortable="true" prop="target_pages" :label="col.label">
<template v-slot="rowScope" class="bu-is-flex bu-is-justify-content-center">
<span class="text-medium">
{{ rowScope.row.target_pages }}
</span>
</template>
</el-table-column>
</template>
</template>
</cly-datatable-n>