Skip to content

Commit

Permalink
fix: admin node robot & registry view
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jun 12, 2024
1 parent 0353035 commit a4c5239
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 26 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/client-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@authup/core-http-kit": "^1.0.0-beta.13",
"@authup/core-kit": "^1.0.0-beta.13",
"@bootstrap-vue-next/nuxt": "^0.21.2",
"@ilingo/vuelidate": "^5.0.2",
"@fortawesome/fontawesome-free": "^6.5.2",
"@nuxtjs/google-fonts": "^3.2.0",
"@privateaim/client-vue": "^0.5.0",
Expand All @@ -45,7 +46,6 @@
"bootstrap-vue-next": "^0.20.0",
"events": "^3.3.0",
"hapic": "^2.5.1",
"ilingo": "^4.3.1",
"nuxt": "^3.11.2",
"pinia": "^2.1.7",
"rapiq": "^0.9.0",
Expand Down
20 changes: 1 addition & 19 deletions packages/client-ui/plugins/ilingo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,7 @@
* view the LICENSE file that was distributed with this source code.
*/

import { Ilingo } from 'ilingo';

declare module '#app' {
interface NuxtApp {
$ilingo: Ilingo;
}
}

declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$ilingo: Ilingo;
}
}

export default defineNuxtPlugin((ctx) => {
const ilingo = new Ilingo();

export default defineNuxtPlugin(() => {
// registryRobotSecret: 'Die Eingabe muss größer als 8 Zeichen, min. 1 Großbuchstaben, 1 Kleinbuchstaben und 1 Zahl enthalten.',
// registryRobotSecret: 'The input value must be larger than 8 letters, contain at least 1 uppercase letter, 1 lowercase letter and 1 number.',

ctx.provide('ilingo', ilingo);
});
4 changes: 2 additions & 2 deletions packages/client-vue/src/components/node/FNodeRobot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default defineComponent({

const translationsValidation = useTranslationsForNestedValidations($v.value);

const translationsSubmit = createFormSubmitTranslations();

return () => h(ARobot, {
onResolved(entity) {
if (entity) {
Expand Down Expand Up @@ -96,8 +98,6 @@ export default defineComponent({
}),
});

const translationsSubmit = createFormSubmitTranslations();

const submitNode = buildFormSubmitWithTranslations({
submit: () => slotProps.update(form),
busy: slotProps.busy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export default defineComponent({
},
}, form);

const translationsValidation = useTranslationsForNestedValidations(vuelidate.value);

const manager = createEntityManager({
type: `${DomainType.REGISTRY_PROJECT}`,
setup,
Expand Down Expand Up @@ -103,8 +105,6 @@ export default defineComponent({
);
}

const translationsValidation = useTranslationsForNestedValidations(vuelidate.value);

return () => {
const fallback = () : VNodeChild => h('div', [
h('div', {
Expand Down
1 change: 1 addition & 0 deletions packages/client-vue/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export * from './busy';
export * from './object';
export * from './slot';
export * from './socket';
export * from './translator';
export * from './http-client';
export * from './vuelidate';
9 changes: 9 additions & 0 deletions packages/client-vue/src/core/translator/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/

export * from './install';
export * from './types';
22 changes: 22 additions & 0 deletions packages/client-vue/src/core/translator/install.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2024.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/

import { MemoryStore } from '@ilingo/vuelidate/core';
import { install } from '@ilingo/vuelidate';
import type { App } from 'vue';
import type { TranslatorInstallOptions } from './types';

export function installTranslator(app: App, options: TranslatorInstallOptions = {}) {
const store = new MemoryStore({
data: {},
});

install(app, {
store,
locale: options.locale,
});
}
10 changes: 10 additions & 0 deletions packages/client-vue/src/core/translator/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2024.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/

export type TranslatorInstallOptions = {
locale?: string
};
5 changes: 5 additions & 0 deletions packages/client-vue/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
installCoreHTTPClient,
installSocketManager,
installStorageHTTPClient,
installTranslator,
} from './core';
import type { Options } from './type';

Expand All @@ -28,6 +29,10 @@ export function install(app: App, options: Options): void {
baseURL: options.realtimeURL,
});

installTranslator(app, {
locale: options.translatorLocale,
});

const storeManager = installStoreManager(app);
if (options.storeManager) {
applyStoreManagerOptions(storeManager, options.storeManager);
Expand Down
4 changes: 3 additions & 1 deletion packages/client-vue/src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ export type Options = {
realtimeURL: string,

components?: boolean | string[],
storeManager?: StoreManagerOptions
storeManager?: StoreManagerOptions,

translatorLocale?: string,
};

0 comments on commit a4c5239

Please sign in to comment.