diff --git a/zero.Api/ZeroApiEntityStoreController.cs b/zero.Api/ZeroApiEntityStoreController.cs index 52b306c1..089476d4 100644 --- a/zero.Api/ZeroApiEntityStoreController.cs +++ b/zero.Api/ZeroApiEntityStoreController.cs @@ -54,6 +54,7 @@ public abstract class ZeroApiEntityStoreController : ZeroApiCont protected async Task> GetModels(ListQuery query) where T : BasicModel { query.OrderQuery ??= q => q.OrderByDescending(x => x.CreatedDate); + query.SearchSelector ??= x => x.Name; Paged result = await Store.Load(query.Page, query.PageSize, q => q.Filter(query)); return Mapper.Map(result, (src, dest) => @@ -66,6 +67,7 @@ public abstract class ZeroApiEntityStoreController : ZeroApiCont protected async Task> GetModels(ListQuery query) where T : BasicModel where TIndex : AbstractCommonApiForIndexes, new() { query.OrderQuery ??= q => q.OrderByDescending(x => x.CreatedDate); + query.SearchSelector ??= x => x.Name; Paged result = await Store.Load(query.Page, query.PageSize, q => q.Filter(query)); return Mapper.Map(result, (src, dest) => diff --git a/zero.Backoffice.UI/app/_about.vue b/zero.Backoffice.UI/app/_about.vue new file mode 100644 index 00000000..424aa40f --- /dev/null +++ b/zero.Backoffice.UI/app/_about.vue @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/zero.Backoffice.UI/app/_root.vue b/zero.Backoffice.UI/app/_root.vue new file mode 100644 index 00000000..d25a8132 --- /dev/null +++ b/zero.Backoffice.UI/app/_root.vue @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/zero.Backoffice.UI/app/app.vue b/zero.Backoffice.UI/app/app.vue index 15d89068..af015311 100644 --- a/zero.Backoffice.UI/app/app.vue +++ b/zero.Backoffice.UI/app/app.vue @@ -1,6 +1,14 @@  @@ -38,19 +68,24 @@ data: () => ({ input: null, name: localize('@name'), - tabLabel: 'Settings' + tabLabel: 'Settings', + rte: '

Hallo
Das ist schön

Ciao Tobi

', + toggled: true, + search: null }), - created() - { - console.info(this.zero.version); - }, - computed: { output() { return selectorToArray(this.input); } + }, + + methods: { + searchSubmit(ev) + { + console.info('searched: ' + ev); + } } } diff --git a/zero.Backoffice.UI/old_app/config/axios.config.js b/zero.Backoffice.UI/app/axios.config.ts similarity index 69% rename from zero.Backoffice.UI/old_app/config/axios.config.js rename to zero.Backoffice.UI/app/axios.config.ts index ee1571ab..15b2aa1f 100644 --- a/zero.Backoffice.UI/old_app/config/axios.config.js +++ b/zero.Backoffice.UI/app/axios.config.ts @@ -1,13 +1,13 @@ import Axios from 'axios'; -import Auth from 'zero/helpers/auth.js'; +//import Auth from 'zero/helpers/auth.js'; import Qs from 'qs'; -if (!__zero || !__zero.apiPath) -{ - throw Exception('window.zero and zero.apiPath (= base path to the backoffice API) have to be configured'); -} +//if (!__zero || !__zero.apiPath) +//{ +// throw Exception('window.zero and zero.apiPath (= base path to the backoffice API) have to be configured'); +//} -Axios.defaults.baseURL = __zero.apiPath; +Axios.defaults.baseURL = '/zero/api/'; Axios.defaults.withCredentials = true; Axios.defaults.paramsSerializer = (params) => @@ -21,7 +21,8 @@ Axios.interceptors.response.use(response => response, error => { if (error.response.status === 401) { - Auth.rejectUser("@login.rejectReasons.inactive"); + console.error('[zero.axios] Auth failed. Please login again.'); + //Auth.rejectUser("@login.rejectReasons.inactive"); //Notification.error('Authentication failed. Please login again.', 3); } } diff --git a/zero.Backoffice.UI/app/components/generic/index.ts b/zero.Backoffice.UI/app/components/generic/index.ts deleted file mode 100644 index db8af7de..00000000 --- a/zero.Backoffice.UI/app/components/generic/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import uiIcon from './ui-icon.vue'; -import uiLoading from './ui-loading.vue'; - -export { - uiIcon, - uiLoading -}; \ No newline at end of file diff --git a/zero.Backoffice.UI/app/components/index.ts b/zero.Backoffice.UI/app/components/index.ts new file mode 100644 index 00000000..0bffd90b --- /dev/null +++ b/zero.Backoffice.UI/app/components/index.ts @@ -0,0 +1,29 @@ +import uiIcon from './ui-icon.vue'; +import uiLoading from './ui-loading.vue'; +import uiTab from './ui-tab.vue'; +import uiTabs from './ui-tabs.vue'; +import uiInlineTabs from './ui-inline-tabs.vue'; +import uiButton from './ui-button.vue'; +import uiDotButton from './ui-dot-button.vue'; +import uiIconButton from './ui-icon-button.vue'; +import uiSelectButton from './ui-select-button.vue'; +import uiStateButton from './ui-state-button.vue'; +import uiMessage from './ui-message.vue'; +import uiPagination from './ui-pagination.vue'; +import uiError from './ui-error.vue'; + +export { + uiIcon, + uiLoading, + uiTab, + uiTabs, + uiInlineTabs, + uiButton, + uiDotButton, + uiIconButton, + uiSelectButton, + uiStateButton, + uiMessage, + uiPagination, + uiError +}; \ No newline at end of file diff --git a/zero.Backoffice.UI/app/components/register.ts b/zero.Backoffice.UI/app/components/register.ts index 72f52c6f..8e137b10 100644 --- a/zero.Backoffice.UI/app/components/register.ts +++ b/zero.Backoffice.UI/app/components/register.ts @@ -1,10 +1,13 @@ import { App } from 'vue'; -import registerGeneric from './generic/register'; -import registerTabs from './tabs/register'; +import * as components from './index'; export default function (app: App) { - registerGeneric(app); - registerTabs(app); + for (var key in components) + { + let component = components[key]; + + app.component(key, component.default || component); + } }; \ No newline at end of file diff --git a/zero.Backoffice.UI/app/components/tabs/index.ts b/zero.Backoffice.UI/app/components/tabs/index.ts deleted file mode 100644 index a855bba3..00000000 --- a/zero.Backoffice.UI/app/components/tabs/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import uiTab from './ui-tab.vue'; -import uiTabs from './ui-tabs.vue'; -import uiInlineTabs from './ui-inline-tabs.vue'; - -export -{ - uiTab, - uiTabs, - uiInlineTabs -}; \ No newline at end of file diff --git a/zero.Backoffice.UI/app/components/tabs/register.ts b/zero.Backoffice.UI/app/components/tabs/register.ts deleted file mode 100644 index 8e137b10..00000000 --- a/zero.Backoffice.UI/app/components/tabs/register.ts +++ /dev/null @@ -1,13 +0,0 @@ - -import { App } from 'vue'; -import * as components from './index'; - -export default function (app: App) -{ - for (var key in components) - { - let component = components[key]; - - app.component(key, component.default || component); - } -}; \ No newline at end of file diff --git a/zero.Backoffice.UI/old_app/components/buttons/button.vue b/zero.Backoffice.UI/app/components/ui-button.vue similarity index 94% rename from zero.Backoffice.UI/old_app/components/buttons/button.vue rename to zero.Backoffice.UI/app/components/ui-button.vue index c7aba92c..21f18281 100644 --- a/zero.Backoffice.UI/old_app/components/buttons/button.vue +++ b/zero.Backoffice.UI/app/components/ui-button.vue @@ -1,5 +1,5 @@