From 61646a4466e5af9b3a4de64aa63daa7484e591c4 Mon Sep 17 00:00:00 2001 From: AmauryD Date: Fri, 18 Oct 2024 17:21:08 +0200 Subject: [PATCH] upgrade common-ui --- app/abilities/base.ts | 2 +- app/app.ts | 14 +- app/components/forms/forgot-password.gts | 6 +- app/components/forms/login.gts | 9 +- app/components/forms/password-recovery.gts | 8 +- app/components/forms/register.gts | 59 +- app/components/inputs/cancel-button.gts | 44 -- app/components/inputs/error-validation.gts | 26 - app/components/inputs/file.gts | 51 -- app/components/inputs/file/input-layout.gts | 44 -- app/components/inputs/input-validation.gts | 57 -- app/components/inputs/select-validation.gts | 99 --- app/components/inputs/textarea-validation.gts | 45 -- app/formats.js | 27 - app/{router.js => router.ts} | 4 +- app/services/error-handler.ts | 2 - app/services/request-manager.ts | 2 +- app/services/safe-store.ts | 2 +- app/utils/result-utils.ts | 2 +- eslint.config.mjs | 6 +- package.json | 20 +- pnpm-lock.yaml | 678 +++++++++++------- tests/helpers/index.ts | 4 - .../forms/register/component-test.gts | 11 +- tsconfig.json | 6 +- types/ember-can/index.d.ts | 8 - types/ember-data/types/registries/model.d.ts | 6 - types/template-registry.d.ts | 7 +- 28 files changed, 476 insertions(+), 773 deletions(-) delete mode 100644 app/components/inputs/cancel-button.gts delete mode 100644 app/components/inputs/error-validation.gts delete mode 100644 app/components/inputs/file.gts delete mode 100644 app/components/inputs/file/input-layout.gts delete mode 100644 app/components/inputs/input-validation.gts delete mode 100644 app/components/inputs/select-validation.gts delete mode 100644 app/components/inputs/textarea-validation.gts delete mode 100644 app/formats.js rename app/{router.js => router.ts} (76%) delete mode 100644 types/ember-can/index.d.ts delete mode 100644 types/ember-data/types/registries/model.d.ts diff --git a/app/abilities/base.ts b/app/abilities/base.ts index e0fa4bb..6ec9a27 100644 --- a/app/abilities/base.ts +++ b/app/abilities/base.ts @@ -6,7 +6,7 @@ import { Ability } from 'ember-can'; import type CurrentUserService from 'ember-boilerplate/services/current-user'; -export default abstract class BaseAbility extends Ability { +export default abstract class BaseAbility extends Ability { @service declare currentUser: CurrentUserService; @computed('currentUser.user') diff --git a/app/app.ts b/app/app.ts index 1a03bff..ded2204 100644 --- a/app/app.ts +++ b/app/app.ts @@ -1,12 +1,9 @@ import { setBuildURLConfig } from '@ember-data/request-utils'; import Application from '@ember/application'; -// @ts-expect-error -import initializer from 'ember-simple-auth/initializers/ember-simple-auth'; -// @ts-expect-error -import initializerJwt from '@triptyk/ember-simple-auth-token/initializers/simple-auth-token'; import config from 'ember-boilerplate/config/environment'; import Resolver from 'ember-resolver'; +import loadInitializers from 'ember-load-initializers'; export default class App extends Application { modulePrefix = config.modulePrefix; @@ -14,15 +11,10 @@ export default class App extends Application { Resolver = Resolver; } -// ember-load-initializers not working anymore, registering manually -function loadInitializers() { - App.instanceInitializer(initializer); - App.instanceInitializer(initializerJwt); -} - setBuildURLConfig({ host: config.host, namespace: config.namespace, }); -loadInitializers(); +loadInitializers(App, config.modulePrefix); + diff --git a/app/components/forms/forgot-password.gts b/app/components/forms/forgot-password.gts index 3b66657..713f1ca 100644 --- a/app/components/forms/forgot-password.gts +++ b/app/components/forms/forgot-password.gts @@ -1,6 +1,4 @@ import { LinkTo } from '@ember/routing'; - -import InputsValidationComponent from 'ember-boilerplate/components/inputs/input-validation'; import t from 'ember-intl/helpers/t'; import TpkForm from '@triptyk/ember-input-validation/components/tpk-form'; @@ -28,9 +26,9 @@ const FormsForgotPassword: TOC =