Skip to content
This repository was archived by the owner on Apr 10, 2021. It is now read-only.

Commit b4b4f72

Browse files
committed
Merge branch 'develop' into feature/dashboard
# Conflicts: # raw-cms-app/src/modules/core/components/top-bar/top-bar.tpl.html
2 parents c84d044 + a24f055 commit b4b4f72

File tree

24 files changed

+58
-63
lines changed

24 files changed

+58
-63
lines changed

raw-cms-app/src/app/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const _App = Vue.component('rawcms-app', (resolve, reject) => {
2020
return vuexStore.state.core.isLoggedIn;
2121
},
2222
},
23-
data: () => {
23+
data: function() {
2424
return {
2525
showSnackbar: false,
2626
snackbarConfig: {},

raw-cms-app/src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<div id="app"></div>
5959

6060
<!-- Vue + other deps -->
61-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js"></script>
61+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
6262
<script src="https://unpkg.com/[email protected]/dist/vuex.js"></script>
6363
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
6464
<script src="https://unpkg.com/vue-i18n/dist/vue-i18n.js"></script>

raw-cms-app/src/modules/core/assets/i18n/i18n.en.json

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"apiCallsText": "API calls (last week):",
5353
"entitiesNumText": "Entities number",
5454
"recordsQuotaText": "Records quota",
55+
"title": "Home",
5556
"totalRecordsText": "Total records",
5657
"welcomeText": "Welcome back! Here you can find some insights about your app."
5758
},

raw-cms-app/src/modules/core/components/config-edit-dialog/config-edit-dialog.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const _ConfigEditDialog = async (res, rej) => {
77
props: {
88
activeEntity: Object,
99
},
10-
data: () => {
10+
data: function() {
1111
return {
12-
data: { Code: 'ddd' },
12+
data: { code: '' },
1313
};
1414
},
1515
methods: {

raw-cms-app/src/modules/core/components/left-menu/left-menu.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const _LeftMenu = async (resolve, reject) => {
1919
return vuexStore.state.core.userInfo || {};
2020
},
2121
},
22-
data: () => {
22+
data: function() {
2323
return {
2424
isVisible: false,
2525
isUserMenuVisible: false,

raw-cms-app/src/modules/core/components/left-menu/left-menu.tpl.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<v-list dark tile>
1010
<v-list-item>
1111
<v-list-item-avatar>
12-
<user-avatar size="48" color="blue lighten-3" dark></user-avatar>
12+
<user-avatar :size="48" color="blue lighten-3" dark></user-avatar>
1313
</v-list-item-avatar>
1414
</v-list-item>
1515

raw-cms-app/src/modules/core/components/top-bar/top-bar.tpl.html

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
<v-app-bar :clipped-left="$vuetify.breakpoint.lgAndUp" app dark color="primary">
22
<v-toolbar-title class="ml-0 pl-4">
33
<v-app-bar-nav-icon @click.stop="toggleDrawer()"></v-app-bar-nav-icon>
4-
<span class="hidden-sm-and-down">Raw CMS</span>
4+
<span class="hidden-sm-and-down">{{ Title }}</span>
55
</v-toolbar-title>
66

77
<v-spacer></v-spacer>
8-
<v-toolbar-title>
9-
<h1>{{Title}}</h1>
10-
</v-toolbar-title>
11-
128
<div class="flex-grow-1"></div>
139
<v-avatar tile>
1410
<img src="/modules/core/assets/rawlogo_small.png" alt="RawCMS Logo" />

raw-cms-app/src/modules/core/views/collection-table-view/collection-table-view.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import vuexStore from '../../../../config/vuex.js';
2+
import { sleep } from '../../../../utils/time.utils.js';
23
import { CollectionTableDef } from '../../components/collection-table/collection-table.js';
34

45
const _CollectionTableView = async (res, rej) => {
@@ -34,10 +35,21 @@ const _CollectionTableView = async (res, rej) => {
3435
},
3536
methods: {
3637
amdRequire: require,
37-
resizeMonaco: function() {
38-
const monacoEditor = this.$refs.monaco.getMonaco();
39-
const oldLayout = monacoEditor.getLayoutInfo();
40-
monacoEditor.layout({ width: oldLayout.width, height: 80 });
38+
resizeMonaco: async function() {
39+
await sleep(0);
40+
41+
const monacoRef = this.$refs.monaco;
42+
const monacoEditor = monacoRef.getMonaco();
43+
const expPanelContentEl = this.$refs.filterContent.$el.getElementsByClassName(
44+
'v-expansion-panel-content__wrap'
45+
)[0];
46+
const style = window.getComputedStyle(expPanelContentEl, null);
47+
const h = monacoRef.$el.offsetHeight;
48+
const w =
49+
parseFloat(style.getPropertyValue('width')) -
50+
parseFloat(style.getPropertyValue('padding-left')) -
51+
parseFloat(style.getPropertyValue('padding-right'));
52+
monacoEditor.layout({ width: w, height: h });
4153
},
4254
goToCreateView: function() {
4355
this.$router.push({

raw-cms-app/src/modules/core/views/collection-table-view/collection-table-view.tpl.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<v-layout class="flex-column">
22
<v-expansion-panels>
33
<v-expansion-panel>
4-
<v-expansion-panel-header
5-
>{{ $t('core.collections.detail.filter') }}</v-expansion-panel-header
6-
>
7-
<v-expansion-panel-content>
4+
<v-expansion-panel-header>
5+
{{ $t('core.collections.detail.filter') }}
6+
</v-expansion-panel-header>
7+
<v-expansion-panel-content ref="filterContent">
88
<monaco-editor
99
ref="monaco"
1010
@editorDidMount="resizeMonaco()"
1111
v-model="txtQuery"
1212
:options="monacoOptions"
1313
:amdRequire="amdRequire"
14+
style="height:100px;"
1415
>
1516
</monaco-editor>
1617
<v-row justify="center">

raw-cms-app/src/modules/core/views/collections-list-view/collections-list-view.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { CollectionsListDef } from '../../components/collections-list/collections-list.js';
21
import vuexStore from '../../../../config/vuex.js';
2+
import { CollectionsListDef } from '../../components/collections-list/collections-list.js';
33

44
const _CollectionsListView = async (res, rej) => {
55
const tpl = await RawCMS.loadComponentTpl(
@@ -14,9 +14,6 @@ const _CollectionsListView = async (res, rej) => {
1414
mounted() {
1515
vuexStore.dispatch('core/updateTopBarTitle', this.$t('core.collections.title'));
1616
},
17-
data: function() {
18-
return {};
19-
},
2017
methods: {},
2118
template: tpl,
2219
});

raw-cms-app/src/modules/core/views/configuration-details-view/configuration-details-view.js

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const _ConfigurationDetailsView = async (res, rej) => {
2121
});
2222
});
2323
},
24-
data: function() {},
2524
methods: {
2625
updateTitle: function({ isNew, name }) {
2726
let title = isNew

raw-cms-app/src/modules/core/views/configuration-list-view/configuration-list-view.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ConfigurationListDef } from '../../components/configuration-list/configuration-list.js';
21
import vuexStore from '../../../../config/vuex.js';
2+
import { ConfigurationListDef } from '../../components/configuration-list/configuration-list.js';
33

44
const _ConfigurationListView = async (res, rej) => {
55
const tpl = await RawCMS.loadComponentTpl(
@@ -14,9 +14,6 @@ const _ConfigurationListView = async (res, rej) => {
1414
mounted() {
1515
vuexStore.dispatch('core/updateTopBarTitle', this.$t('core.configuration.title'));
1616
},
17-
data: function() {
18-
return {};
19-
},
2017
methods: {
2118
goToCreateView: function() {
2219
this.$router.push({ name: 'configuration-details', params: { id: 'new' } });

raw-cms-app/src/modules/core/views/entities-list-view/entities-list-view.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { EntitiesListDef } from '../../components/entities-list/entities-list.js';
21
import vuexStore from '../../../../config/vuex.js';
2+
import { EntitiesListDef } from '../../components/entities-list/entities-list.js';
33

44
const _EntitiesListView = async (res, rej) => {
55
const tpl = await RawCMS.loadComponentTpl(
@@ -14,9 +14,6 @@ const _EntitiesListView = async (res, rej) => {
1414
mounted() {
1515
vuexStore.dispatch('core/updateTopBarTitle', this.$t('core.entities.title'));
1616
},
17-
data: function() {
18-
return {};
19-
},
2017
methods: {
2118
goToCreateView: function() {
2219
this.$router.push({ name: 'entity-details', params: { id: 'new' } });

raw-cms-app/src/modules/core/views/entity-details-view/entity-details-view.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ const _EntityDetailsView = async (res, rej) => {
1414
EntityDetails: entityDetails,
1515
},
1616
created: function() {
17-
RawCMS.eventBus.$on(rawCmsDetailEditEvents.loaded, ev => {
17+
RawCMS.eventBus.$once(rawCmsDetailEditEvents.loaded, ev => {
1818
this.updateTitle({
1919
isNew: ev.isNew,
2020
name: optionalChain(() => ev.value.CollectionName, { fallbackValue: '<NONE>' }),
2121
});
2222
});
2323
},
24-
data: function() {},
2524
methods: {
2625
updateTitle: function({ isNew, name }) {
2726
let title = isNew

raw-cms-app/src/modules/core/views/home-view/home-view.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { vuexStore } from '../../../../config/vuex.js';
12
import { DashboardDef } from '../../components/dashboard/dashboard.js';
23

34
const _HomeView = async (res, rej) => {
@@ -8,6 +9,9 @@ const _HomeView = async (res, rej) => {
89
components: {
910
Dashboard: dashboardDef,
1011
},
12+
mounted() {
13+
vuexStore.dispatch('core/updateTopBarTitle', this.$t('core.home.title'));
14+
},
1115
template: tpl,
1216
});
1317
};

raw-cms-app/src/modules/core/views/lambda-details-view/lambda-details-view.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ const _LambdaDetailsView = async (res, rej) => {
1414
LambdaDetails: editor,
1515
},
1616
created: function() {
17-
RawCMS.eventBus.$on(rawCmsDetailEditEvents.loaded, ev => {
17+
RawCMS.eventBus.$once(rawCmsDetailEditEvents.loaded, ev => {
1818
this.updateTitle({
1919
isNew: ev.isNew,
2020
name: optionalChain(() => ev.value.Name, { fallbackValue: '<NONE>' }),
2121
});
2222
});
2323
},
24-
data: function() {},
2524
methods: {
2625
updateTitle: function({ isNew, name }) {
2726
let title = isNew

raw-cms-app/src/modules/core/views/lambdas-list-view/lambdas-list-view.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { LambdasListDef } from '../../components/lambdas-list/lambdas-list.js';
21
import vuexStore from '../../../../config/vuex.js';
2+
import { LambdasListDef } from '../../components/lambdas-list/lambdas-list.js';
33

44
const _LambdasListView = async (res, rej) => {
55
const tpl = await RawCMS.loadComponentTpl(
@@ -14,9 +14,6 @@ const _LambdasListView = async (res, rej) => {
1414
mounted() {
1515
vuexStore.dispatch('core/updateTopBarTitle', this.$t('core.lambdas.title'));
1616
},
17-
data: function() {
18-
return {};
19-
},
2017
methods: {
2118
goToCreateView: function() {
2219
this.$router.push({ name: 'lambda-details', params: { id: 'new' } });

raw-cms-app/src/modules/core/views/login-view/login-view.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const _LoginView = async (res, rej) => {
2323
return errors;
2424
},
2525
},
26-
data: () => {
26+
data: function() {
2727
return {
2828
username: '',
2929
password: '',

raw-cms-app/src/modules/core/views/login-view/login-view.tpl.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<v-col cols="12" sm="8" md="4">
33
<v-card class="elevation-12">
44
<v-form ref="loginForm" @submit="login($event)">
5-
<v-toolbar color="primary" flat dark color="primary">
5+
<v-toolbar color="primary" flat dark>
66
<v-toolbar-title>{{ $t('core.login.title') }}</v-toolbar-title>
77
<div class="flex-grow-1"></div>
88
</v-toolbar>

raw-cms-app/src/modules/core/views/user-details-view/user-details-view.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ const _UserDetailsView = async (res, rej) => {
1414
UserDetails: details,
1515
},
1616
created: function() {
17-
RawCMS.eventBus.$on(rawCmsDetailEditEvents.loaded, ev => {
17+
RawCMS.eventBus.$once(rawCmsDetailEditEvents.loaded, ev => {
1818
this.updateTitle({
1919
isNew: ev.isNew,
2020
name: optionalChain(() => ev.value.UserName, { fallbackValue: '<NONE>' }),
2121
});
2222
});
2323
},
24-
data: function() {},
2524
methods: {
2625
updateTitle: function({ isNew, name }) {
27-
let title = isNew
26+
const title = isNew
2827
? this.$t('core.users.detail.newTitle')
2928
: this.$t('core.users.detail.updateTitle', { name: name });
3029

raw-cms-app/src/modules/core/views/users-list-view/users-list-view.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { UsersListDef } from '../../components/users-list/users-list.js';
21
import vuexStore from '../../../../config/vuex.js';
2+
import { UsersListDef } from '../../components/users-list/users-list.js';
33

44
const _UsersListView = async (res, rej) => {
55
const tpl = await RawCMS.loadComponentTpl(
@@ -14,9 +14,6 @@ const _UsersListView = async (res, rej) => {
1414
mounted() {
1515
vuexStore.dispatch('core/updateTopBarTitle', this.$t('core.users.title'));
1616
},
17-
data: function() {
18-
return {};
19-
},
2017
methods: {
2118
goToCreateView: function() {
2219
this.$router.push({ name: 'user-details', params: { id: 'new' } });

raw-cms-app/src/modules/formly-material/components/date-field/date-field.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ const _DateFieldDef = async () => {
66
);
77

88
return {
9-
data: vm => ({
10-
isMenuVisible: false,
11-
}),
9+
data: function() {
10+
return {
11+
isMenuVisible: false,
12+
};
13+
},
1214
computed: {
1315
dateFormatted: function() {
1416
return this.toTextValue(this.modelValue);

raw-cms-app/src/modules/shared/components/data-table/data-table.tpl.html

+6-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@
3232
:server-items-length="totalItemsCount"
3333
@click:row="goTo($event)"
3434
>
35-
<template
36-
v-for="(header, index) in dataHeaders"
37-
:key="index"
38-
v-slot:[getTemplateName(header)]="slotProps"
39-
>
40-
<slot :name="getTemplateName(header)" v-bind="slotProps">
41-
{{ slotProps.item[header.value] }}
42-
</slot>
35+
<template v-for="(header, index) in dataHeaders" v-slot:[getTemplateName(header)]="slotProps">
36+
<div :key="index">
37+
<slot :name="getTemplateName(header)" v-bind="slotProps">
38+
{{ slotProps.item[header.value] }}
39+
</slot>
40+
</div>
4341
</template>
4442

4543
<template v-slot:item.action="{ item }">

raw-cms-app/src/modules/shared/components/detail-edit/detail-edit.tpl.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
dark
1111
background-color="tabHeader"
1212
class="rawcms-detail-edit elevation-2"
13-
centered="true"
14-
grow="true"
13+
:centered="true"
14+
:grow="true"
1515
prev-icon="mdi-arrow-left-bold-box-outline"
1616
next-icon="mdi-arrow-right-bold-box-outline"
17-
icons-and-text="true"
17+
:icons-and-text="true"
1818
v-model="activeTabId"
1919
v-if="!isLoading"
2020
ref="tabs"

0 commit comments

Comments
 (0)