Skip to content

Commit a3d75ea

Browse files
authored
Merge pull request #2 from can-keklik/feature/vue-breaking
Feature/vue breaking
2 parents 83402ea + c897fd7 commit a3d75ea

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

frontend/express/public/javascripts/countly/vue/components/datatable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@
588588
'<div>{{ i18n("common.table.no-data") }}</div>\n' +
589589
'</template>\n' +
590590
'<template v-slot:loadingContent>\n' +
591-
'<div></div>\n'+
591+
'<div></div>\n' +
592592
'</template>\n' +
593593
'</vue-good-table>\n' +
594594
'</div>'

frontend/express/public/javascripts/countly/vue/components/drawer.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
title: {type: String, required: true},
2525
saveButtonLabel: {type: String, required: true, default: ""},
2626
beforeCopyFn: {type: Function},
27+
closeFn: {type: Function}
2728
},
2829
data: function() {
2930
return {
@@ -118,8 +119,11 @@
118119
this.isMounted = true;
119120
},
120121
methods: {
121-
tryClosing: function() {
122+
doClose: function() {
122123
this.$emit("close", this.name);
124+
if (this.closeFn) {
125+
this.closeFn();
126+
}
123127
},
124128
copyOfEdited: function() {
125129
var copied = JSON.parse(JSON.stringify(this.initialEditedObject));
@@ -152,7 +156,7 @@
152156
this.beforeLeavingStep();
153157
if (this.isSubmissionAllowed) {
154158
this.$emit("submit", JSON.parse(JSON.stringify(this.editedObject)));
155-
this.tryClosing();
159+
this.doClose();
156160
}
157161
},
158162
beforeLeavingStep: function() {
@@ -171,7 +175,7 @@
171175
'v-bind:class="{mounted: isMounted, open: isOpened, \'has-sidecars\': hasSidecars}">\n' +
172176
'<div class="title">\n' +
173177
'<span>{{title}}</span>\n' +
174-
'<span class="close" v-on:click="tryClosing">\n' +
178+
'<span class="close" v-on:click="doClose">\n' +
175179
'<i class="ion-ios-close-empty"></i>\n' +
176180
'</span>\n' +
177181
'</div>\n' +
@@ -226,8 +230,13 @@
226230
acc[val] = {
227231
name: val,
228232
isOpened: false,
229-
initialEditedObject: {}
233+
initialEditedObject: {},
234+
};
235+
236+
acc[val].closeFn = function() {
237+
acc[val].isOpened = false;
230238
};
239+
231240
return acc;
232241
}, {})
233242
};

frontend/express/public/javascripts/countly/vue/components/input.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
Vue.component('validation-provider', VeeValidate.ValidationProvider);
1010
Vue.component('validation-observer', VeeValidate.ValidationObserver);
1111

12+
VeeValidate.extend('arrmin', {
13+
validate: function(value, args) {
14+
return value.length >= args.length;
15+
},
16+
params: ['length']
17+
});
18+
19+
VeeValidate.extend('arrmax', {
20+
validate: function(value, args) {
21+
return value.length <= args.length;
22+
},
23+
params: ['length']
24+
});
25+
1226
var objectWithoutProperties = function(obj, excluded) {
1327
if (!obj || !excluded || excluded.length === 0) {
1428
return obj;

plugins/vue-example/frontend/public/javascripts/countly.views.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
});
227227

228228
var ExampleDrawer = countlyVue.views.BaseView.extend({
229-
template:'#drawer-template',
229+
template: '#drawer-template',
230230
data: function() {
231231
return {
232232
title: '',
@@ -253,7 +253,7 @@
253253
onSubmit: function(doc) {
254254
this.$store.dispatch("countlyVueExample/myRecords/save", doc);
255255
},
256-
onClose: function($event){
256+
onClose: function($event) {
257257
this.$emit("close", $event);
258258
},
259259
onCopy: function(newState) {

plugins/vue-example/frontend/public/templates/drawer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<div class="panel">
7272
<div class="panel-heading">Allowed Props</div>
7373
<div class="panel-body">
74-
<validation-provider name="selectedProps" rules="min:2" v-slot="v">
74+
<validation-provider name="selectedProps" rules="required|arrmin:2" v-slot="v">
7575
<cly-check-list v-model="drawerScope.editedObject.selectedProps" :items="constants.availableProps"></cly-check-list>
7676
<div class="validation-error" v-if="v.errors.length > 0">
7777
You must select at least 2 props.

0 commit comments

Comments
 (0)