From da00531698f783fa2b55be6b50360d5b713bf0e1 Mon Sep 17 00:00:00 2001 From: RAHUL RATHORE <41804588+rahul-rocket@users.noreply.github.com> Date: Sat, 2 Dec 2023 18:25:21 +0530 Subject: [PATCH 01/34] wip: Open AI API Key saved with integration --- .../services/gauzy-ai/gauzy-ai.service.ts | 4 ++-- .../authorization.component.html | 13 +++++++++++++ .../authorization/authorization.component.ts | 19 +++++++++++++++---- apps/gauzy/src/assets/i18n/en.json | 2 ++ packages/contracts/src/integration.model.ts | 3 ++- .../gauzy-ai/integration-ai.controller.ts | 4 ++-- .../gauzy-ai/integration-ai.service.ts | 10 +++++++--- 7 files changed, 43 insertions(+), 12 deletions(-) diff --git a/apps/gauzy/src/app/@core/services/gauzy-ai/gauzy-ai.service.ts b/apps/gauzy/src/app/@core/services/gauzy-ai/gauzy-ai.service.ts index 72c65f3b884..e6bc0ea4fc3 100644 --- a/apps/gauzy/src/app/@core/services/gauzy-ai/gauzy-ai.service.ts +++ b/apps/gauzy/src/app/@core/services/gauzy-ai/gauzy-ai.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs/internal/Observable'; -import { IIntegrationKeySecretPairInput, IIntegrationTenant } from '@gauzy/contracts'; +import { IIntegrationAICreateInput, IIntegrationTenant } from '@gauzy/contracts'; import { API_PREFIX } from '../../constants'; @Injectable({ @@ -18,7 +18,7 @@ export class GauzyAIService { * @param input * @returns */ - addIntegration(input: IIntegrationKeySecretPairInput): Observable { + create(input: IIntegrationAICreateInput): Observable { return this._http.post(`${API_PREFIX}/integration/gauzy-ai`, input); } } diff --git a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/authorization/authorization.component.html b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/authorization/authorization.component.html index 0779dc76516..bb62b58a1c6 100644 --- a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/authorization/authorization.component.html +++ b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/authorization/authorization.component.html @@ -40,6 +40,19 @@
fullWidth /> +
+ + +
@@ -67,7 +67,7 @@

Sign in to Workspace

diff --git a/apps/gauzy/src/app/auth/login/login.component.html b/apps/gauzy/src/app/auth/login/login.component.html index 2e14547b8b9..3deb963e400 100644 --- a/apps/gauzy/src/app/auth/login/login.component.html +++ b/apps/gauzy/src/app/auth/login/login.component.html @@ -12,24 +12,36 @@

{{ 'LOGIN_PAGE.TITLE' | translate }}

-
Demo Credentials
+
+
-
Super Admin
+
{{ "LOGIN_PAGE.DEMO.SUPER_ADMIN_TITLE" | translate }}

-
Email: admin@ever.co
-
Password: admin
+
+ {{ "LOGIN_PAGE.DEMO.LABELS.EMAIL" | translate }} admin@ever.co +
+
+ {{ "LOGIN_PAGE.DEMO.LABELS.PASSWORD" | translate }} admin +

-
Admin
+
{{ "LOGIN_PAGE.DEMO.ADMIN_TITLE" | translate }}

-
Email: local.admin@ever.co
-
Password: admin
+
+ {{ "LOGIN_PAGE.DEMO.LABELS.EMAIL" | translate }} local.admin@ever.co +
+
+ {{ "LOGIN_PAGE.DEMO.LABELS.PASSWORD" | translate }} admin +

-
Employee
+
{{ "LOGIN_PAGE.DEMO.EMPLOYEE_TITLE" | translate }}

-
Email: employee@ever.co
-
Password: 123456
+
+ {{ "LOGIN_PAGE.DEMO.LABELS.EMAIL" | translate }} employee@ever.co
+
+ {{ "LOGIN_PAGE.DEMO.LABELS.PASSWORD" | translate }} 123456 +
@@ -234,8 +246,10 @@

{{ 'LOGIN_PAGE.TITLE' | translate }}

- Don’t know your workspace? - Find your workspaces + {{ "WORKSPACES.UNKNOWN_WORKSPACE" | translate }} + + {{ "WORKSPACES.FIND_WORKSPACE" | translate }} +
diff --git a/apps/gauzy/src/app/auth/register/register.component.html b/apps/gauzy/src/app/auth/register/register.component.html index d9f6ad3e2ac..508917afe63 100644 --- a/apps/gauzy/src/app/auth/register/register.component.html +++ b/apps/gauzy/src/app/auth/register/register.component.html @@ -5,7 +5,7 @@
-

Register

+

{{ "REGISTER_PAGE.TITLE" | translate }}

@@ -25,7 +25,7 @@

Register

Register #fullName="ngModel" id="input-name" name="fullName" - placeholder="Full name" + [placeholder]=" 'REGISTER_PAGE.PLACEHOLDERS.FULL_NAME' | translate " autofocus fullWidth fieldSize="large" @@ -43,25 +43,27 @@

Register

[maxlength]="getConfigValue('forms.validation.fullName.maxLength')" [attr.aria-invalid]=" fullName.invalid && fullName.touched ? true : null" autocomplete="full-name" - /> + />

- Full name is required! + {{ "REGISTER_PAGE.VALIDATIONS.FULL_NAME_REQUIRED" | translate }}

- Full name should contains from - {{ getConfigValue('forms.validation.fullName.minLength') }} to - {{ getConfigValue('forms.validation.fullName.maxLength') }} - characters + {{ "REGISTER_PAGE.VALIDATIONS.FULL_NAME_SHOULD_CONTAIN" | + translate : { + minLength: getConfigValue('forms.validation.fullName.minLength'), + maxLength: getConfigValue('forms.validation.fullName.maxLength') + } + }}

Register name="email" pattern=".+@.+..+" noSpaceEdges - placeholder="Email address" + [placeholder]="'REGISTER_PAGE.PLACEHOLDERS.EMAIL' | translate" fullWidth fieldSize="large" [status]=" email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'" @@ -81,16 +83,16 @@

Register

/>

- Email is required! + {{ "REGISTER_PAGE.VALIDATIONS.EMAIL_REQUIRED" | translate }}

- Email should be the real one! + {{ "REGISTER_PAGE.VALIDATIONS.EMAIL_SHOULD_BE_REAL" | translate }}

Register type="password" id="input-password" name="password" - placeholder="Password" + [placeholder]=" 'REGISTER_PAGE.PLACEHOLDERS.PASSWORD' | translate " fullWidth fieldSize="large" [status]="password.dirty ? password.invalid ? 'danger' : 'success' : 'basic'" @@ -122,22 +124,22 @@

Register

- Passwords must not begin or end with spaces. + {{ "REGISTER_PAGE.VALIDATIONS.PASSWORD_NO_SPACE_EDGES" | translate }}

- Password is required! + {{ "REGISTER_PAGE.VALIDATIONS.PASSWORD_REQUIRED" | translate }}

- Password should contain from - {{ getConfigValue('forms.validation.password.minLength') }} to - {{ getConfigValue('forms.validation.password.maxLength') }} - characters + {{ "REGISTER_PAGE.VALIDATIONS.PASSWORD_SHOULD_CONTAIN" | translate : { + minLength: getConfigValue('forms.validation.password.minLength'), + maxLength: getConfigValue('forms.validation.password.maxLength') + } }}

Register type="password" id="input-re-password" name="rePass" - placeholder="Confirm Password" + [placeholder]=" 'REGISTER_PAGE.PLACEHOLDERS.CONFIRM_PASSWORD' | translate" fullWidth fieldSize="large" [status]="confirmPassword.dirty ? confirmPassword.invalid || password.value != confirmPassword.value ? 'danger' : 'success' : 'basic' " @@ -166,10 +168,10 @@

Register

- Password confirmation is required! + {{ "REGISTER_PAGE.VALIDATIONS.CONFIRM_PASSWORD_REQUIRED" | translate }}

- Password does not match the confirm password. + {{ "REGISTER_PAGE.VALIDATIONS.PASSWORDS_NOT_MATCH" | translate }}

@@ -181,14 +183,7 @@

Register

[(ngModel)]="user.terms" [required]="getConfigValue('forms.register.terms')" > - Agree to - - Terms & Conditions - - and - - Privacy Policy - +
@@ -200,7 +195,7 @@

Register

[disabled]="submitted || !form.valid || !user.terms" [class.btn-pulse]="submitted" > - Register + {{ "BUTTONS.REGISTER" | translate }}
@@ -211,13 +206,17 @@

Register

- Don’t know your workspace? - Find your workspaces + {{ "WORKSPACES.UNKNOWN_WORKSPACE" | translate }} + + {{ "WORKSPACES.FIND_WORKSPACE" | translate }} +
- Already have an account? - Log in + {{ "REGISTER_PAGE.HAVE_AN_ACCOUNT" | translate }} + + {{ "BUTTONS.LOGIN" | translate }} +
diff --git a/apps/gauzy/src/assets/i18n/ar.json b/apps/gauzy/src/assets/i18n/ar.json index 7a892f51a24..4e2dd520b42 100644 --- a/apps/gauzy/src/assets/i18n/ar.json +++ b/apps/gauzy/src/assets/i18n/ar.json @@ -8,6 +8,7 @@ "REGISTER": "تسجيل", "CHANGE_PASSWORD": "تغيير كلمة المرور", "LOGIN": "تسجيل الدخول", + "SIGNIN": "تسجيل الدخول", "SEND_CODE": "تسجيل الدخول بالبريد الإلكتروني", "ADD_NOTE": "أضف ملاحظة", "EDIT": "تعديل", @@ -4397,6 +4398,34 @@ "receipt": "إيصال" } }, + "REGISTER_PAGE": { + "TITLE": "تسجيل", + "HAVE_AN_ACCOUNT": "هل لديك حساب بالفعل؟", + "LABELS": { + "FULL_NAME": " :الاسم الكامل", + "EMAIL": " :عنوان البريد الإلكتروني", + "PASSWORD": " :كلمة المرور", + "CONFIRM_PASSWORD": " :تأكيد كلمة المرور" + }, + "PLACEHOLDERS": { + "FULL_NAME": "الاسم الكامل", + "EMAIL": "عنوان البريد الإلكتروني", + "PASSWORD": "كلمة المرور", + "CONFIRM_PASSWORD": "تأكيد كلمة المرور" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "!الاسم الكامل مطلوب", + "FULL_NAME_SHOULD_CONTAIN": "يجب أن يحتوي الاسم الكامل على عدد من {{ minLength }} إلى {{ maxLength }} حرفًا", + "EMAIL_REQUIRED": "!البريد الإلكتروني مطلوب", + "EMAIL_SHOULD_BE_REAL": "!يجب أن يكون البريد الإلكتروني حقيقيًا", + "PASSWORD_NO_SPACE_EDGES": "!يجب ألا تبدأ أو تنتهي كلمات المرور بمسافات", + "PASSWORD_REQUIRED": "!كلمة المرور مطلوبة", + "PASSWORD_SHOULD_CONTAIN": "يجب أن تحتوي كلمة المرور على عدد من {{ minLength }} إلى {{ maxLength }} حرفًا", + "CONFIRM_PASSWORD_REQUIRED": "!تأكيد كلمة المرور مطلوب", + "PASSWORDS_NOT_MATCH": "!كلمة المرور لا تتطابق مع تأكيد كلمة المرور", + "AGREE_TERMS_PRIVACY": " موافق على الشروط و الأحكام و سياسة الخصوصية " + } + }, "LOGIN_PAGE": { "TITLE": "تسجيل الدخول", "SUB_TITLE": "مرحبًا! قم بتسجيل الدخول باستخدام بريدك الإلكتروني.", @@ -4435,7 +4464,15 @@ }, "DEMO": { "TITLE": "تسجيل الدخول تلقائيًا إلى حسابات التجريبية", - "SUB_TITLE": "يرجى تحديد نوع الحساب أدناه." + "SUB_TITLE": ".يرجى تحديد نوع الحساب أدناه", + "SUPER_ADMIN_TITLE": "مشرف عام", + "ADMIN_TITLE": "مسؤول", + "EMPLOYEE_TITLE": "موظف", + "DEMO_CREDENTIALS_TITLE": "بيانات العرض", + "LABELS": { + "EMAIL": " :البريد الإلكتروني", + "PASSWORD": " :كلمة المرور" + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4503,14 +4540,36 @@ "CREATE_NEW_WORKSPACE": "أنشئ مساحة عمل جديدة", "FIND_WORKSPACE": "ابحث عن مساحة عمل" }, + "LABELS": { + "EMAIL": ":أدخل عنوان بريدك الإلكتروني", + "PASSWORD": ":أدخل كلمة المرور الخاصة بك" + }, + "PLACEHOLDERS": { + "EMAIL": "name@workspace-email.com", + "PASSWORD": "كلمة المرور" + }, + "SIGN_IN_TITLE": "تسجيل الدخول إلى مساحة العمل", + "BACK_TO": "العودة إلى ", "SUCCESS_SIGNIN_TITLE": ".تهانينا! لقد قمت بتسجيل الدخول بنجاح إلى مساحة العمل الخاصة بك", "SUCCESS_SIGNIN_SUB_TITLE": "...يرجى أن تكون صبورًا بينما نقوم بإعداد مساحة العمل", "FAIL_SIGNIN_TITLE": ".خطأ! رمز السحر أو الرابط الذي قدمته منتهي الصلاحية أو غير صالح", "FAIL_SIGNIN_SUB_TITLE": ".يرجى بدء العملية من جديد", - "THANKING_TEXT": ".شكرًا لاختيارك لنا" + "THANKING_TEXT": ".شكرًا لاختيارك لنا", + "UNKNOWN_WORKSPACE": "لا تعرف مساحة العمل الخاصة بك؟", + "FIND_WORKSPACE": "ابحث عن مساحتك الخاصة" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "مشرف عام", + "ADMIN_TITLE": "مسؤول", + "EMPLOYEE_TITLE": "موظف", + "DEMO_CREDENTIALS_TITLE": "بيانات العرض", + "LABELS": { + "EMAIL": ":البريد الإلكتروني", + "PASSWORD": ":كلمة المرور" + } }, "NO_IMAGE": { "ADD_DROP": "أضف أو أزل الصورة", - "AVAILABLE": "الصورة غير متاحة." + "AVAILABLE": "الصورة غير متاحة" } } diff --git a/apps/gauzy/src/assets/i18n/bg.json b/apps/gauzy/src/assets/i18n/bg.json index f3eea21944a..56a20738b90 100644 --- a/apps/gauzy/src/assets/i18n/bg.json +++ b/apps/gauzy/src/assets/i18n/bg.json @@ -8,6 +8,7 @@ "REGISTER": "Регистриране", "CHANGE_PASSWORD": "Промяна на паролата", "LOGIN": "Log In", + "SIGNIN": "Вход", "SEND_CODE": "Вход с имейл", "ADD_NOTE": "Добави бележка", "EDIT": "Редактиране", @@ -4324,6 +4325,34 @@ "receipt": "Receipt" } }, + "REGISTER_PAGE": { + "TITLE": "Регистрация", + "HAVE_AN_ACCOUNT": "Вече имате акаунт?", + "LABELS": { + "FULL_NAME": "Пълно име:", + "EMAIL": "Имейл адрес:", + "PASSWORD": "Парола", + "CONFIRM_PASSWORD": "Потвърдете паролата:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Пълно име", + "EMAIL": "Имейл адрес", + "PASSWORD": "Парола", + "CONFIRM_PASSWORD": "Потвърдете паролата" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Името е задължително!", + "FULL_NAME_SHOULD_CONTAIN": "Името трябва да съдържа от {{ minLength }} до {{ maxLength }} знака", + "EMAIL_REQUIRED": "Имейлът е задължителен!", + "EMAIL_SHOULD_BE_REAL": "Имейлът трябва да е реален!", + "PASSWORD_NO_SPACE_EDGES": "Паролите не трябва да започват или завършват с интервали!", + "PASSWORD_REQUIRED": "Паролата е задължителна!", + "PASSWORD_SHOULD_CONTAIN": "Паролата трябва да съдържа от {{ minLength }} до {{ maxLength }} знака", + "CONFIRM_PASSWORD_REQUIRED": "Изисква се потвърждение на паролата!", + "PASSWORDS_NOT_MATCH": "Паролата не съвпада с потвърждението на паролата!", + "AGREE_TERMS_PRIVACY": "Съгласен съм с Общи условия и правила и Политика за поверителност" + } + }, "LOGIN_PAGE": { "TITLE": "Login", "SUB_TITLE": "Hello! Log in with your email.", @@ -4362,7 +4391,15 @@ }, "DEMO": { "TITLE": "Login Automatically into Demo accounts", - "SUB_TITLE": "Please select account type below." + "SUB_TITLE": "Please select account type below.", + "SUPER_ADMIN_TITLE": "Супер администратор", + "ADMIN_TITLE": "Администратор", + "EMPLOYEE_TITLE": "Служител", + "DEMO_CREDENTIALS_TITLE": "Демо данни", + "LABELS": { + "EMAIL": "Имейл: ", + "PASSWORD": "Парола: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4429,11 +4466,33 @@ "CREATE_NEW_WORKSPACE": "Create a new workspace", "FIND_WORKSPACE": "Find workspace" }, + "LABELS": { + "EMAIL": "Въведете вашия имейл адрес:", + "PASSWORD": "Въведете вашата парола:" + }, + "PLACEHOLDERS": { + "EMAIL": "name@workspace-email.com", + "PASSWORD": "Парола" + }, + "SIGN_IN_TITLE": "Вход в Работното пространство", + "BACK_TO": "Назад към", "SUCCESS_SIGNIN_TITLE": "Поздравления! Влезли сте успешно в работното си пространство.", "SUCCESS_SIGNIN_SUB_TITLE": "Моля, бъдете търпеливи, докато подготвяме работното пространство...", "FAIL_SIGNIN_TITLE": "Грешка! Магическият код или връзката, която предоставихте, е изтекъл или невалиден.", "FAIL_SIGNIN_SUB_TITLE": "Моля, инициирайте процеса отново.", - "THANKING_TEXT": "Благодарим ви, че ни избрахте." + "THANKING_TEXT": "Благодарим ви, че ни избрахте.", + "UNKNOWN_WORKSPACE": "Не знаете работното си пространство?", + "FIND_WORKSPACE": "Намерете вашето работно пространство" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Супер администратор", + "ADMIN_TITLE": "Администратор", + "EMPLOYEE_TITLE": "Служител", + "DEMO_CREDENTIALS_TITLE": "Демо данни", + "LABELS": { + "EMAIL": "Имейл: ", + "PASSWORD": "Парола: " + } }, "NO_IMAGE": { "ADD_DROP": "Add or Drop Image", diff --git a/apps/gauzy/src/assets/i18n/de.json b/apps/gauzy/src/assets/i18n/de.json index 495ac5665dd..f28cd24404a 100644 --- a/apps/gauzy/src/assets/i18n/de.json +++ b/apps/gauzy/src/assets/i18n/de.json @@ -8,6 +8,7 @@ "REGISTER": "Registrieren", "CHANGE_PASSWORD": "Passwort ändern", "LOGIN": "Einloggen", + "SIGNIN": "Anmelden", "SEND_CODE": "Mit E-Mail anmelden", "ADD_NOTE": "Notiz hinzufügen", "EDIT": "Bearbeiten", @@ -4394,6 +4395,34 @@ "receipt": "Quittung" } }, + "REGISTER_PAGE": { + "TITLE": "Registrieren", + "HAVE_AN_ACCOUNT": "Haben Sie bereits ein Konto?", + "LABELS": { + "FULL_NAME": "Vollständiger Name:", + "EMAIL": "E-Mail-Adresse:", + "PASSWORD": "Passwort", + "CONFIRM_PASSWORD": "Passwort bestätigen:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Vollständiger Name", + "EMAIL": "E-Mail-Adresse", + "PASSWORD": "Passwort", + "CONFIRM_PASSWORD": "Passwort bestätigen" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Der Name ist erforderlich!", + "FULL_NAME_SHOULD_CONTAIN": "Der Name sollte zwischen {{ minLength }} und {{ maxLength }} Zeichen enthalten", + "EMAIL_REQUIRED": "Die E-Mail ist erforderlich!", + "EMAIL_SHOULD_BE_REAL": "Die E-Mail sollte echt sein!", + "PASSWORD_NO_SPACE_EDGES": "Passwörter dürfen nicht mit Leerzeichen beginnen oder enden!", + "PASSWORD_REQUIRED": "Das Passwort ist erforderlich!", + "PASSWORD_SHOULD_CONTAIN": "Das Passwort sollte zwischen {{ minLength }} und {{ maxLength }} Zeichen enthalten", + "CONFIRM_PASSWORD_REQUIRED": "Die Bestätigung des Passworts ist erforderlich!", + "PASSWORDS_NOT_MATCH": "Das Passwort stimmt nicht mit der Passwortbestätigung überein!", + "AGREE_TERMS_PRIVACY": "Ich stimme den Allgemeinen Geschäftsbedingungen und der Datenschutzrichtlinie zu" + } + }, "LOGIN_PAGE": { "TITLE": "Anmeldung", "SUB_TITLE": "Hallo! Melde dich mit deiner E-Mail an.", @@ -4432,7 +4461,15 @@ }, "DEMO": { "TITLE": "Automatisch in Demo-Konten einloggen", - "SUB_TITLE": "Bitte wählen Sie unten den Kontotyp aus." + "SUB_TITLE": "Bitte wählen Sie unten den Kontotyp aus.", + "SUPER_ADMIN_TITLE": "Super-Administrator", + "ADMIN_TITLE": "Administrator", + "EMPLOYEE_TITLE": "Mitarbeiter", + "DEMO_CREDENTIALS_TITLE": "Demo Anmeldedaten", + "LABELS": { + "EMAIL": "E-Mail: ", + "PASSWORD": "Passwort: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4500,11 +4537,33 @@ "CREATE_NEW_WORKSPACE": "Erstelle einen neuen Arbeitsbereich", "FIND_WORKSPACE": "Finde Arbeitsplatz" }, + "LABELS": { + "EMAIL": "Geben Sie Ihre E-Mail-Adresse ein:", + "PASSWORD": "Geben Sie Ihr Passwort ein:" + }, + "PLACEHOLDERS": { + "EMAIL": "name@workspace-email.com", + "PASSWORD": "Passwort" + }, + "SIGN_IN_TITLE": "Anmeldung im Arbeitsbereich", + "BACK_TO": "Zurück zu", "SUCCESS_SIGNIN_TITLE": "Herzlichen Glückwunsch! Sie haben sich erfolgreich in Ihren Arbeitsbereich eingeloggt.", "SUCCESS_SIGNIN_SUB_TITLE": "Bitte haben Sie Geduld, während wir den Arbeitsbereich vorbereiten...", "FAIL_SIGNIN_TITLE": "Fehler! Der magische Code oder Link, den Sie bereitgestellt haben, ist abgelaufen oder ungültig.", "FAIL_SIGNIN_SUB_TITLE": "Bitte starten Sie den Prozess erneut.", - "THANKING_TEXT": "Vielen Dank, dass Sie uns gewählt haben." + "THANKING_TEXT": "Vielen Dank, dass Sie uns gewählt haben.", + "UNKNOWN_WORKSPACE": "Kennen Sie Ihren Arbeitsbereich nicht?", + "FIND_WORKSPACE": "Finden Sie Ihren Arbeitsbereich" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Super-Administrator", + "ADMIN_TITLE": "Administrator", + "EMPLOYEE_TITLE": "Mitarbeiter", + "DEMO_CREDENTIALS_TITLE": "Demo Anmeldedaten", + "LABELS": { + "EMAIL": "E-Mail: ", + "PASSWORD": "Passwort: " + } }, "NO_IMAGE": { "ADD_DROP": "Bild hinzufügen oder entfernen", diff --git a/apps/gauzy/src/assets/i18n/en.json b/apps/gauzy/src/assets/i18n/en.json index f8db85e0350..6aa7c242b23 100644 --- a/apps/gauzy/src/assets/i18n/en.json +++ b/apps/gauzy/src/assets/i18n/en.json @@ -10,6 +10,7 @@ "REGISTER": "Register", "CHANGE_PASSWORD": "Change password", "LOGIN": "Log In", + "SIGNIN": "Sign in", "SEND_CODE": "Send code", "SENDING_CODE": "Sending code...", "ADD_NOTE": "Add note", @@ -4479,6 +4480,34 @@ "receipt": "Receipt" } }, + "REGISTER_PAGE": { + "TITLE": "Register", + "HAVE_AN_ACCOUNT": "Already have an account?", + "LABELS": { + "FULL_NAME": "Full name:", + "EMAIL": "Email address:", + "PASSWORD": "Password", + "CONFIRM_PASSWORD":"Confirm Password:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Full name", + "EMAIL": "Email address", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Confirm password" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Full name is required!", + "FULL_NAME_SHOULD_CONTAIN": "Full name should contain from {{ minLength }} to {{ maxLength }} characters", + "EMAIL_REQUIRED": "Email is required!", + "EMAIL_SHOULD_BE_REAL":"Email should be a real one!", + "PASSWORD_NO_SPACE_EDGES": "Passwords must not begin or end with spaces!", + "PASSWORD_REQUIRED": "Password is required!", + "PASSWORD_SHOULD_CONTAIN": "Password should contain from {{ minLength }} to {{ maxLength }} characters!", + "CONFIRM_PASSWORD_REQUIRED": "Password confirmation is required!", + "PASSWORDS_NOT_MATCH": "Password does not match the confirm password!", + "AGREE_TERMS_PRIVACY": "Agree to Terms & Conditions and Privacy Policy" + } + }, "LOGIN_PAGE": { "TITLE": "Login", "SUB_TITLE": "Hello! Log in with your email.", @@ -4517,7 +4546,15 @@ }, "DEMO": { "TITLE": "Login Automatically into Demo accounts", - "SUB_TITLE": "Please select account type below." + "SUB_TITLE": "Please select account type below.", + "SUPER_ADMIN_TITLE": "Super Admin", + "ADMIN_TITLE": "Admin", + "EMPLOYEE_TITLE": "Employee", + "DEMO_CREDENTIALS_TITLE": "Demo Credentials", + "LABELS": { + "EMAIL":"Email: ", + "PASSWORD": "Password: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4585,11 +4622,33 @@ "CREATE_NEW_WORKSPACE": "Create a new workspace", "FIND_WORKSPACE": "Find workspace" }, + "LABELS": { + "EMAIL": "Enter your email address:", + "PASSWORD": "Enter your password:" + }, + "PLACEHOLDERS": { + "EMAIL": "name@workspace-email.com", + "PASSWORD": "Password" + }, + "SIGN_IN_TITLE": "Sign in to Workspace", + "BACK_TO": "Back to ", "SUCCESS_SIGNIN_TITLE": "Congrats! you’ve successfully signed in to your workspace.", "SUCCESS_SIGNIN_SUB_TITLE": "Please be patient while we are preparing the workspace...", "FAIL_SIGNIN_TITLE": "Error! the magic code or link you provided is expired or invalid.", "FAIL_SIGNIN_SUB_TITLE": "Please initiate the process again.", - "THANKING_TEXT": "Thank you for choosing us." + "THANKING_TEXT": "Thank you for choosing us.", + "UNKNOWN_WORKSPACE": "Don't know your workspace?", + "FIND_WORKSPACE": "Find your workspaces" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Super Admin", + "ADMIN_TITLE": "Admin", + "EMPLOYEE_TITLE": "Employee", + "DEMO_CREDENTIALS_TITLE": "Demo Credentials", + "LABELS": { + "EMAIL":"Email: ", + "PASSWORD": "Password: " + } }, "NO_IMAGE": { "ADD_DROP": "Add or Drop Image", diff --git a/apps/gauzy/src/assets/i18n/es.json b/apps/gauzy/src/assets/i18n/es.json index 8c29ec4e674..9d1b2e0f54e 100644 --- a/apps/gauzy/src/assets/i18n/es.json +++ b/apps/gauzy/src/assets/i18n/es.json @@ -8,6 +8,7 @@ "REGISTER": "Registrar", "CHANGE_PASSWORD": "Cambiar contraseña", "LOGIN": "Iniciar sesión", + "SIGNIN": "Iniciar sesión", "SEND_CODE": "Iniciar sesión con correo electrónico", "ADD_NOTE": "Añadir nota", "EDIT": "Editar", @@ -4400,6 +4401,34 @@ "receipt": "Recibo" } }, + "REGISTER_PAGE": { + "TITLE": "Registrarse", + "HAVE_AN_ACCOUNT": "¿Ya tienes una cuenta?", + "LABELS": { + "FULL_NAME": "Nombre completo:", + "EMAIL": "Dirección de correo electrónico:", + "PASSWORD": "Contraseña", + "CONFIRM_PASSWORD": "Confirmar contraseña:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Nombre completo", + "EMAIL": "Dirección de correo electrónico", + "PASSWORD": "Contraseña", + "CONFIRM_PASSWORD": "Confirmar contraseña" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "¡Se requiere el nombre completo!", + "FULL_NAME_SHOULD_CONTAIN": "El nombre completo debe contener entre {{ minLength }} y {{ maxLength }} caracteres", + "EMAIL_REQUIRED": "¡Se requiere el correo electrónico!", + "EMAIL_SHOULD_BE_REAL": "¡El correo electrónico debe ser real!", + "PASSWORD_NO_SPACE_EDGES": "¡Las contraseñas no deben comenzar ni terminar con espacios!", + "PASSWORD_REQUIRED": "¡Se requiere la contraseña!", + "PASSWORD_SHOULD_CONTAIN": "La contraseña debe contener entre {{ minLength }} y {{ maxLength }} caracteres", + "CONFIRM_PASSWORD_REQUIRED": "¡Se requiere la confirmación de la contraseña!", + "PASSWORDS_NOT_MATCH": "La contraseña no coincide con la confirmación de la contraseña!", + "AGREE_TERMS_PRIVACY": "Acepto los Términos y condiciones y la Política de privacidad" + } + }, "LOGIN_PAGE": { "TITLE": "Acceso", "SUB_TITLE": "¡Hola! Inicia sesión con tu correo electrónico.", @@ -4438,7 +4467,15 @@ }, "DEMO": { "TITLE": "Iniciar sesión automáticamente en cuentas de demostración", - "SUB_TITLE": "Por favor, selecciona el tipo de cuenta a continuación." + "SUB_TITLE": "Por favor, selecciona el tipo de cuenta a continuación.", + "SUPER_ADMIN_TITLE": "Superadministrador", + "ADMIN_TITLE": "Administrador", + "EMPLOYEE_TITLE": "Empleado", + "DEMO_CREDENTIALS_TITLE": "Credenciales de demostración", + "LABELS": { + "EMAIL": "Correo electrónico: ", + "PASSWORD": "Contraseña: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4506,11 +4543,33 @@ "CREATE_NEW_WORKSPACE": "Crear un nuevo espacio de trabajo", "FIND_WORKSPACE": "Encuentra espacio de trabajo." }, + "LABELS": { + "EMAIL": "Ingrese su dirección de correo electrónico:", + "PASSWORD": "Ingrese su contraseña:" + }, + "PLACEHOLDERS": { + "EMAIL": "nombre@correo-electronico.com", + "PASSWORD": "Contraseña" + }, + "SIGN_IN_TITLE": "Iniciar sesión en el espacio de trabajo", + "BACK_TO": "Volver a", "SUCCESS_SIGNIN_TITLE": "¡Felicidades! Has iniciado sesión con éxito en tu espacio de trabajo.", "SUCCESS_SIGNIN_SUB_TITLE": "Por favor, ten paciencia mientras preparamos el espacio de trabajo...", "FAIL_SIGNIN_TITLE": "¡Error! El código mágico o el enlace que proporcionaste ha expirado o no es válido.", "FAIL_SIGNIN_SUB_TITLE": "Por favor, inicia el proceso de nuevo.", - "THANKING_TEXT": "Gracias por elegirnos." + "THANKING_TEXT": "Gracias por elegirnos.", + "UNKNOWN_WORKSPACE": "¿No conoces tu espacio de trabajo?", + "FIND_WORKSPACE": "Encuentra tu espacio de trabajo" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Superadministrador", + "ADMIN_TITLE": "Administrador", + "EMPLOYEE_TITLE": "Empleado", + "DEMO_CREDENTIALS_TITLE": "Credenciales de demostración", + "LABELS": { + "EMAIL": "Correo electrónico: ", + "PASSWORD": "Contraseña: " + } }, "NO_IMAGE": { "ADD_DROP": "Agregar o Eliminar Imagen", diff --git a/apps/gauzy/src/assets/i18n/fr.json b/apps/gauzy/src/assets/i18n/fr.json index 45678a6c719..bb97161ff02 100644 --- a/apps/gauzy/src/assets/i18n/fr.json +++ b/apps/gauzy/src/assets/i18n/fr.json @@ -8,6 +8,7 @@ "REGISTER": "S'inscrire", "CHANGE_PASSWORD": "Changer le mot de passe", "LOGIN": "Se connecter", + "SIGNIN": "Se connecter", "SEND_CODE": "Se connecter avec un e-mail", "ADD_NOTE": "Ajouter une note", "EDIT": "Éditer", @@ -4399,6 +4400,34 @@ "receipt": "Reçu" } }, + "REGISTER_PAGE": { + "TITLE": "S'inscrire", + "HAVE_AN_ACCOUNT": "Vous avez déjà un compte ?", + "LABELS": { + "FULL_NAME": "Nom complet :", + "EMAIL": "Adresse e-mail :", + "PASSWORD": "Mot de passe", + "CONFIRM_PASSWORD": "Confirmer le mot de passe :" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Nom complet", + "EMAIL": "Adresse e-mail", + "PASSWORD": "Mot de passe", + "CONFIRM_PASSWORD": "Confirmer le mot de passe" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Le nom complet est requis !", + "FULL_NAME_SHOULD_CONTAIN": "Le nom complet doit contenir entre {{ minLength }} et {{ maxLength }} caractères", + "EMAIL_REQUIRED": "L'e-mail est requis !", + "EMAIL_SHOULD_BE_REAL": "L'e-mail doit être réel !", + "PASSWORD_NO_SPACE_EDGES": "Les mots de passe ne doivent pas commencer ou finir par des espaces !", + "PASSWORD_REQUIRED": "Le mot de passe est requis !", + "PASSWORD_SHOULD_CONTAIN": "Le mot de passe doit contenir entre {{ minLength }} et {{ maxLength }} caractères", + "CONFIRM_PASSWORD_REQUIRED": "La confirmation du mot de passe est requise !", + "PASSWORDS_NOT_MATCH": "Le mot de passe ne correspond pas à la confirmation du mot de passe !", + "AGREE_TERMS_PRIVACY": "J'accepte les Conditions générales et la Politique de confidentialité" + } + }, "LOGIN_PAGE": { "TITLE": "Connexion", "SUB_TITLE": "Salut ! Connectez-vous avec votre adresse e-mail.", @@ -4437,7 +4466,15 @@ }, "DEMO": { "TITLE": "Connectez-vous automatiquement aux comptes de démonstration", - "SUB_TITLE": "Veuillez sélectionner le type de compte ci-dessous." + "SUB_TITLE": "Veuillez sélectionner le type de compte ci-dessous.", + "SUPER_ADMIN_TITLE": "Super administrateur", + "ADMIN_TITLE": "Administrateur", + "EMPLOYEE_TITLE": "Employé", + "DEMO_CREDENTIALS_TITLE": "Identifiants de démonstration", + "LABELS": { + "EMAIL": "E-mail : ", + "PASSWORD": "Mot de passe : " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4505,11 +4542,33 @@ "CREATE_NEW_WORKSPACE": "Créez un nouvel espace de travail.", "FIND_WORKSPACE": "Trouver un espace de travail" }, + "LABELS": { + "EMAIL": "Entrez votre adresse e-mail :", + "PASSWORD": "Entrez votre mot de passe :" + }, + "PLACEHOLDERS": { + "EMAIL": "nom@adresse-mail.com", + "PASSWORD": "Mot de passe" + }, + "SIGN_IN_TITLE": "Se connecter à l'espace de travail", + "BACK_TO": "Retour à", "SUCCESS_SIGNIN_TITLE": "Félicitations ! Vous avez réussi à vous connecter à votre espace de travail.", "SUCCESS_SIGNIN_SUB_TITLE": "Veuillez patienter pendant que nous préparons l'espace de travail...", "FAIL_SIGNIN_TITLE": "Erreur ! Le code magique ou le lien que vous avez fourni a expiré ou n'est pas valide.", "FAIL_SIGNIN_SUB_TITLE": "Veuillez initier le processus à nouveau.", - "THANKING_TEXT": "Merci de nous avoir choisis." + "THANKING_TEXT": "Merci de nous avoir choisis.", + "UNKNOWN_WORKSPACE": "Vous ne connaissez pas votre espace de travail ?", + "FIND_WORKSPACE": "Trouver votre espace de travail" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Super administrateur", + "ADMIN_TITLE": "Administrateur", + "EMPLOYEE_TITLE": "Employé", + "DEMO_CREDENTIALS_TITLE": "Identifiants de démonstration", + "LABELS": { + "EMAIL": "E-mail: ", + "PASSWORD": "Mot de passe: " + } }, "NO_IMAGE": { "ADD_DROP": "Ajouter ou supprimer une image", diff --git a/apps/gauzy/src/assets/i18n/he.json b/apps/gauzy/src/assets/i18n/he.json index 46d042315cd..e70f5d58921 100644 --- a/apps/gauzy/src/assets/i18n/he.json +++ b/apps/gauzy/src/assets/i18n/he.json @@ -8,6 +8,7 @@ "REGISTER": "Register", "CHANGE_PASSWORD": "שנה סיסמה", "LOGIN": "Log In", + "SIGNIN": "התחברות", "SEND_CODE": "התחבר עם דואר אלקטרוני", "ADD_NOTE": "Add note", "EDIT": "ערוך", @@ -4322,6 +4323,34 @@ "receipt": "Receipt" } }, + "REGISTER_PAGE": { + "TITLE": "הרשמה", + "HAVE_AN_ACCOUNT": "כבר יש לך חשבון?", + "LABELS": { + "FULL_NAME": "שם מלא:", + "EMAIL": "כתובת דוא\"ל:", + "PASSWORD": "סיסמה", + "CONFIRM_PASSWORD": "אשר סיסמה:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "שם מלא", + "EMAIL": "כתובת דוא\"ל", + "PASSWORD": "סיסמה", + "CONFIRM_PASSWORD": "אשר סיסמה" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "שם מלא נדרש!", + "FULL_NAME_SHOULD_CONTAIN": "שם מלא צריך להכיל בין {{ minLength }} ל-{{ maxLength }} תווים", + "EMAIL_REQUIRED": "כתובת דוא\"ל נדרשת!", + "EMAIL_SHOULD_BE_REAL": "כתובת דוא\"ל צריכה להיות אמיתית!", + "PASSWORD_NO_SPACE_EDGES": "סיסמאות לא יכולות להתחיל או להסתיים עם רווחים!", + "PASSWORD_REQUIRED": "סיסמה נדרשת!", + "PASSWORD_SHOULD_CONTAIN": "סיסמה צריכה להכיל בין {{ minLength }} ל-{{ maxLength }} תווים", + "CONFIRM_PASSWORD_REQUIRED": "אישור סיסמה נדרש!", + "PASSWORDS_NOT_MATCH": "הסיסמה לא תואמת לאישור הסיסמה!", + "AGREE_TERMS_PRIVACY": "מסכים ל תנאי השימוש ול מדיניות הפרטיות" + } + }, "LOGIN_PAGE": { "TITLE": "Login", "SUB_TITLE": "Hello! Log in with your email.", @@ -4360,7 +4389,15 @@ }, "DEMO": { "TITLE": "Login Automatically into Demo accounts", - "SUB_TITLE": "Please select account type below." + "SUB_TITLE": "Please select account type below.", + "SUPER_ADMIN_TITLE": "מנהל ראשי", + "ADMIN_TITLE": "מנהל", + "EMPLOYEE_TITLE": "עובד", + "DEMO_CREDENTIALS_TITLE": "פרטי דמו", + "LABELS": { + "EMAIL": "אימייל: ", + "PASSWORD": "סיסמה: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4427,11 +4464,33 @@ "CREATE_NEW_WORKSPACE": "Create a new workspace", "FIND_WORKSPACE": "Find workspace" }, + "LABELS": { + "EMAIL": "הזן את כתובת הדוא\"ל שלך:", + "PASSWORD": "הזן את הסיסמה שלך:" + }, + "PLACEHOLDERS": { + "EMAIL": "name@workspace-email.com", + "PASSWORD": "סיסמה" + }, + "SIGN_IN_TITLE": "התחבר למרחב העבודה", + "BACK_TO": "חזרה אל", "SUCCESS_SIGNIN_TITLE": ".מזל טוב! נכנסת למערכת בהצלחה", "SUCCESS_SIGNIN_SUB_TITLE": "...אנא התאזרי בסבלנות בזמן שאנו מכינים את המערכת", "FAIL_SIGNIN_TITLE": ".שגיאה! קוד הקסם או הקישור שסיפקת פג או אינו תקף", "FAIL_SIGNIN_SUB_TITLE": ".אנא התחל/י את התהליך מחדש", - "THANKING_TEXT": ".תודה על בחירתך בנו" + "THANKING_TEXT": ".תודה על בחירתך בנו", + "UNKNOWN_WORKSPACE": "אין לך מושג מה המרחב שלך?", + "FIND_WORKSPACE": "מצא את המרחב שלך" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "מנהל ראשי", + "ADMIN_TITLE": "מנהל", + "EMPLOYEE_TITLE": "עובד", + "DEMO_CREDENTIALS_TITLE": "פרטי דמו", + "LABELS": { + "EMAIL": "אימייל: ", + "PASSWORD": "סיסמה: " + } }, "NO_IMAGE": { "ADD_DROP": "Add or Drop Image", diff --git a/apps/gauzy/src/assets/i18n/it.json b/apps/gauzy/src/assets/i18n/it.json index dcb5f566aa5..f2902cb22a5 100644 --- a/apps/gauzy/src/assets/i18n/it.json +++ b/apps/gauzy/src/assets/i18n/it.json @@ -8,6 +8,7 @@ "REGISTER": "Registrazione", "CHANGE_PASSWORD": "Cambia password", "LOGIN": "Accedi", + "SIGNIN": "Accedi", "SEND_CODE": "Accedi con l'email", "ADD_NOTE": "Aggiungi nota", "EDIT": "Modifica", @@ -4398,6 +4399,34 @@ "receipt": "Ricevuta" } }, + "REGISTER_PAGE": { + "TITLE": "Registra", + "HAVE_AN_ACCOUNT": "Hai già un account?", + "LABELS": { + "FULL_NAME": "Nome completo:", + "EMAIL": "Indirizzo email:", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Conferma password:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Nome completo", + "EMAIL": "Indirizzo email", + "PASSWORD": "Password", + "CONFIRM_PASSWORD": "Conferma password" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Il nome completo è obbligatorio!", + "FULL_NAME_SHOULD_CONTAIN": "Il nome completo deve contenere tra {{ minLength }} e {{ maxLength }} caratteri", + "EMAIL_REQUIRED": "L'indirizzo email è obbligatorio!", + "EMAIL_SHOULD_BE_REAL": "L'indirizzo email deve essere reale!", + "PASSWORD_NO_SPACE_EDGES": "Le password non devono iniziare o finire con spazi!", + "PASSWORD_REQUIRED": "La password è obbligatoria!", + "PASSWORD_SHOULD_CONTAIN": "La password deve contenere tra {{ minLength }} e {{ maxLength }} caratteri", + "CONFIRM_PASSWORD_REQUIRED": "La conferma della password è obbligatoria!", + "PASSWORDS_NOT_MATCH": "La password non corrisponde alla conferma della password!", + "AGREE_TERMS_PRIVACY": "Accetto Termini e Condizioni e Informativa sulla privacy" + } + }, "LOGIN_PAGE": { "TITLE": "Accesso", "SUB_TITLE": "Ciao! Accedi con la tua email", @@ -4436,7 +4465,15 @@ }, "DEMO": { "TITLE": "Accedi automaticamente agli account di prova", - "SUB_TITLE": "Seleziona il tipo di account qui sotto" + "SUB_TITLE": "Seleziona il tipo di account qui sotto", + "SUPER_ADMIN_TITLE": "Super Admin", + "ADMIN_TITLE": "Admin", + "EMPLOYEE_TITLE": "Impiegato", + "DEMO_CREDENTIALS_TITLE": "Credenziali Demo", + "LABELS": { + "EMAIL": "Email: ", + "PASSWORD": "Password: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4504,11 +4541,33 @@ "CREATE_NEW_WORKSPACE": "Crea un nuovo spazio di lavoro", "FIND_WORKSPACE": "Trova uno spazio di lavoro" }, + "LABELS": { + "EMAIL": "Inserisci il tuo indirizzo email:", + "PASSWORD": "Inserisci la tua password:" + }, + "PLACEHOLDERS": { + "EMAIL": "nome@workspace-email.com", + "PASSWORD": "Password" + }, + "SIGN_IN_TITLE": "Accedi a Workspace", + "BACK_TO": "Torna a", "SUCCESS_SIGNIN_TITLE": "Congratulazioni! Hai effettuato l'accesso con successo al tuo spazio di lavoro.", "SUCCESS_SIGNIN_SUB_TITLE": "Per favore, sii paziente mentre prepariamo lo spazio di lavoro...", "FAIL_SIGNIN_TITLE": "Errore! Il codice magico o il link che hai fornito è scaduto o non è valido.", "FAIL_SIGNIN_SUB_TITLE": "Per favore, inizia il processo di nuovo.", - "THANKING_TEXT": "Grazie per averci scelto." + "THANKING_TEXT": "Grazie per averci scelto.", + "UNKNOWN_WORKSPACE": "Non conosci il tuo spazio di lavoro?", + "FIND_WORKSPACE": "Trova i tuoi spazi di lavoro" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Super Admin", + "ADMIN_TITLE": "Admin", + "EMPLOYEE_TITLE": "Impiegato", + "DEMO_CREDENTIALS_TITLE": "Credenziali Demo", + "LABELS": { + "EMAIL": "Email: ", + "PASSWORD": "Password: " + } }, "NO_IMAGE": { "ADD_DROP": "Aggiungi o Rimuovi Immagine", diff --git a/apps/gauzy/src/assets/i18n/nl.json b/apps/gauzy/src/assets/i18n/nl.json index 5080ae749df..6884c568882 100644 --- a/apps/gauzy/src/assets/i18n/nl.json +++ b/apps/gauzy/src/assets/i18n/nl.json @@ -8,6 +8,7 @@ "REGISTER": "Registreren", "CHANGE_PASSWORD": "Wachtwoord wijzigen", "LOGIN": "Inloggen", + "SIGNIN": "Aanmelden", "SEND_CODE": "Inloggen met e-mail", "ADD_NOTE": "Voeg een opmerking toe", "EDIT": "Bewerken", @@ -4398,6 +4399,34 @@ "receipt": "Ontvangstbewijs" } }, + "REGISTER_PAGE": { + "TITLE": "Registreren", + "HAVE_AN_ACCOUNT": "Heb je al een account?", + "LABELS": { + "FULL_NAME": "Volledige naam:", + "EMAIL": "E-mailadres:", + "PASSWORD": "Wachtwoord", + "CONFIRM_PASSWORD": "Bevestig wachtwoord:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Volledige naam", + "EMAIL": "E-mailadres", + "PASSWORD": "Wachtwoord", + "CONFIRM_PASSWORD": "Bevestig wachtwoord" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Volledige naam is verplicht!", + "FULL_NAME_SHOULD_CONTAIN": "Volledige naam moet tussen {{ minLength }} en {{ maxLength }} tekens bevatten", + "EMAIL_REQUIRED": "E-mailadres is verplicht!", + "EMAIL_SHOULD_BE_REAL": "E-mailadres moet echt zijn!", + "PASSWORD_NO_SPACE_EDGES": "Wachtwoorden mogen niet beginnen of eindigen met spaties!", + "PASSWORD_REQUIRED": "Wachtwoord is verplicht!", + "PASSWORD_SHOULD_CONTAIN": "Wachtwoord moet tussen {{ minLength }} en {{ maxLength }} tekens bevatten", + "CONFIRM_PASSWORD_REQUIRED": "Bevestiging van wachtwoord is verplicht!", + "PASSWORDS_NOT_MATCH": "Wachtwoord komt niet overeen met de bevestiging van het wachtwoord!", + "AGREE_TERMS_PRIVACY": "Akkoord met Algemene voorwaarden en Privacybeleid" + } + }, "LOGIN_PAGE": { "TITLE": "Inloggen", "SUB_TITLE": "Hallo! Log in met je e-mail.", @@ -4436,7 +4465,15 @@ }, "DEMO": { "TITLE": "Automatisch inloggen op demorekeningen", - "SUB_TITLE": "Selecteer hieronder het type account." + "SUB_TITLE": "Selecteer hieronder het type account.", + "SUPER_ADMIN_TITLE": "Superbeheerder", + "ADMIN_TITLE": "Beheerder", + "EMPLOYEE_TITLE": "Werknemer", + "DEMO_CREDENTIALS_TITLE": "Demo-inloggegevens", + "LABELS": { + "EMAIL": "E-mail: ", + "PASSWORD": "Wachtwoord: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4504,11 +4541,33 @@ "CREATE_NEW_WORKSPACE": "Maak een nieuwe werkruimte", "FIND_WORKSPACE": "Vind een werkruimte" }, + "LABELS": { + "EMAIL": "Voer je e-mailadres in:", + "PASSWORD": "Voer je wachtwoord in:" + }, + "PLACEHOLDERS": { + "EMAIL": "naam@workspace-email.com", + "PASSWORD": "Wachtwoord" + }, + "SIGN_IN_TITLE": "Aanmelden bij Workspace", + "BACK_TO": "Terug naar", "SUCCESS_SIGNIN_TITLE": "Gefeliciteerd! Je bent succesvol ingelogd op je werkruimte.", "SUCCESS_SIGNIN_SUB_TITLE": "Wees geduldig terwijl we de werkruimte voorbereiden...", "FAIL_SIGNIN_TITLE": "Fout! De magische code of de link die je hebt opgegeven is verlopen of ongeldig.", "FAIL_SIGNIN_SUB_TITLE": "Start het proces opnieuw a.u.b.", - "THANKING_TEXT": "Bedankt dat je voor ons hebt gekozen." + "THANKING_TEXT": "Bedankt dat je voor ons hebt gekozen.", + "UNKNOWN_WORKSPACE": "Weet je niet waar je werkruimte is?", + "FIND_WORKSPACE": "Vind je werkruimtes" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Superbeheerder", + "ADMIN_TITLE": "Beheerder", + "EMPLOYEE_TITLE": "Werknemer", + "DEMO_CREDENTIALS_TITLE": "Demo-inloggegevens", + "LABELS": { + "EMAIL": "E-mail: ", + "PASSWORD": "Wachtwoord: " + } }, "NO_IMAGE": { "ADD_DROP": "Afbeelding toevoegen of verwijderen", diff --git a/apps/gauzy/src/assets/i18n/pl.json b/apps/gauzy/src/assets/i18n/pl.json index b7c867da3a5..164a222b8a0 100644 --- a/apps/gauzy/src/assets/i18n/pl.json +++ b/apps/gauzy/src/assets/i18n/pl.json @@ -8,6 +8,7 @@ "REGISTER": "Rejestracja", "CHANGE_PASSWORD": "Zmień hasło", "LOGIN": "Zaloguj się", + "SIGNIN": "Zaloguj się", "SEND_CODE": "Zaloguj się za pomocą e-maila", "ADD_NOTE": "Dodaj notatkę", "EDIT": "Edytuj", @@ -4398,6 +4399,34 @@ "receipt": "Paragon" } }, + "REGISTER_PAGE": { + "TITLE": "Zarejestruj się", + "HAVE_AN_ACCOUNT": "Masz już konto?", + "LABELS": { + "FULL_NAME": "Pełna nazwa:", + "EMAIL": "Adres e-mail:", + "PASSWORD": "Hasło", + "CONFIRM_PASSWORD": "Potwierdź hasło:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Pełna nazwa", + "EMAIL": "Adres e-mail", + "PASSWORD": "Hasło", + "CONFIRM_PASSWORD": "Potwierdź hasło" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Pełna nazwa jest wymagana!", + "FULL_NAME_SHOULD_CONTAIN": "Pełna nazwa powinna zawierać od {{ minLength }} do {{ maxLength }} znaków", + "EMAIL_REQUIRED": "Adres e-mail jest wymagany!", + "EMAIL_SHOULD_BE_REAL": "Adres e-mail powinien być prawdziwy!", + "PASSWORD_NO_SPACE_EDGES": "Hasła nie mogą zaczynać się ani kończyć spacjami!", + "PASSWORD_REQUIRED": "Hasło jest wymagane!", + "PASSWORD_SHOULD_CONTAIN": "Hasło powinno zawierać od {{ minLength }} do {{ maxLength }} znaków", + "CONFIRM_PASSWORD_REQUIRED": "Potwierdzenie hasła jest wymagane!", + "PASSWORDS_NOT_MATCH": "Hasło nie pasuje do potwierdzenia hasła!", + "AGREE_TERMS_PRIVACY": "Zgadzam się z Warunki korzystania oraz Polityką prywatności" + } + }, "LOGIN_PAGE": { "TITLE": "Logowanie", "SUB_TITLE": "Cześć! Zaloguj się za pomocą swojego adresu e-mail", @@ -4436,7 +4465,15 @@ }, "DEMO": { "TITLE": "Logowanie automatyczne do kont demo", - "SUB_TITLE": "Proszę wybrać typ konta poniżej" + "SUB_TITLE": "Proszę wybrać typ konta poniżej", + "SUPER_ADMIN_TITLE": "Superadministrator", + "ADMIN_TITLE": "Administrator", + "EMPLOYEE_TITLE": "Pracownik", + "DEMO_CREDENTIALS_TITLE": "Dane do logowania w wersji demonstracyjnej", + "LABELS": { + "EMAIL": "E-mail: ", + "PASSWORD": "Hasło: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4504,11 +4541,33 @@ "CREATE_NEW_WORKSPACE": "Utwórz nową przestrzeń roboczą", "FIND_WORKSPACE": "Znajdź miejsce do pracy" }, + "LABELS": { + "EMAIL": "Wprowadź swój adres e-mail:", + "PASSWORD": "Wprowadź swoje hasło:" + }, + "PLACEHOLDERS": { + "EMAIL": "nazwa@adres-email-firmy.com", + "PASSWORD": "Hasło" + }, + "SIGN_IN_TITLE": "Zaloguj się do Przestrzeni Roboczej", + "BACK_TO": "Powrót do", "SUCCESS_SIGNIN_TITLE": "Gratulacje! Pomyślnie zalogowałeś się do swojej przestrzeni roboczej.", "SUCCESS_SIGNIN_SUB_TITLE": "Proszę o cierpliwość podczas przygotowywania przestrzeni roboczej...", "FAIL_SIGNIN_TITLE": "Błąd! Magiczny kod lub link, który podałeś, jest przeterminowany lub nieprawidłowy.", "FAIL_SIGNIN_SUB_TITLE": "Proszę rozpocznij proces ponownie.", - "THANKING_TEXT": "Dziękujemy, że nas wybrałeś." + "THANKING_TEXT": "Dziękujemy, że nas wybrałeś.", + "UNKNOWN_WORKSPACE": "Nie wiesz, gdzie jest twoja przestrzeń robocza?", + "FIND_WORKSPACE": "Znajdź swoje przestrzenie robocze" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Superadministrator", + "ADMIN_TITLE": "Administrator", + "EMPLOYEE_TITLE": "Pracownik", + "DEMO_CREDENTIALS_TITLE": "Dane do logowania w wersji demonstracyjnej", + "LABELS": { + "EMAIL": "E-mail: ", + "PASSWORD": "Hasło: " + } }, "NO_IMAGE": { "ADD_DROP": "Dodaj lub usuń obraz", diff --git a/apps/gauzy/src/assets/i18n/pt.json b/apps/gauzy/src/assets/i18n/pt.json index 02a330fd194..c554ca0bba0 100644 --- a/apps/gauzy/src/assets/i18n/pt.json +++ b/apps/gauzy/src/assets/i18n/pt.json @@ -8,6 +8,7 @@ "REGISTER": "Registre-se.", "CHANGE_PASSWORD": "Alterar Senha", "LOGIN": "Entrar", + "SIGNIN": "Entrar", "SEND_CODE": "Entrar com e-mail", "ADD_NOTE": "Adicione uma nota", "EDIT": "Editar", @@ -4398,6 +4399,34 @@ "receipt": "Recibo" } }, + "REGISTER_PAGE": { + "TITLE": "Registrar", + "HAVE_AN_ACCOUNT": "Já tem uma conta?", + "LABELS": { + "FULL_NAME": "Nome completo:", + "EMAIL": "Endereço de e-mail:", + "PASSWORD": "Senha", + "CONFIRM_PASSWORD": "Confirmar senha:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Nome completo", + "EMAIL": "Endereço de e-mail", + "PASSWORD": "Senha", + "CONFIRM_PASSWORD": "Confirmar senha" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Nome completo é obrigatório!", + "FULL_NAME_SHOULD_CONTAIN": "O nome completo deve conter de {{ minLength }} a {{ maxLength }} caracteres", + "EMAIL_REQUIRED": "E-mail é obrigatório!", + "EMAIL_SHOULD_BE_REAL": "O e-mail deve ser real!", + "PASSWORD_NO_SPACE_EDGES": "As senhas não devem começar nem terminar com espaços!", + "PASSWORD_REQUIRED": "Senha é obrigatória!", + "PASSWORD_SHOULD_CONTAIN": "A senha deve conter de {{ minLength }} a {{ maxLength }} caracteres", + "CONFIRM_PASSWORD_REQUIRED": "Confirmação de senha é obrigatória!", + "PASSWORDS_NOT_MATCH": "A senha não coincide com a confirmação de senha!", + "AGREE_TERMS_PRIVACY": "Concordo com Termos de Uso e Política de Privacidade" + } + }, "LOGIN_PAGE": { "TITLE": "Acessar", "SUB_TITLE": "Olá! Faça login com seu e-mail.", @@ -4436,7 +4465,15 @@ }, "DEMO": { "TITLE": "Faça login automaticamente nas contas de demonstração.", - "SUB_TITLE": "Por favor, selecione o tipo de conta abaixo." + "SUB_TITLE": "Por favor, selecione o tipo de conta abaixo.", + "SUPER_ADMIN_TITLE": "Super Administrador", + "ADMIN_TITLE": "Administrador", + "EMPLOYEE_TITLE": "Funcionário", + "DEMO_CREDENTIALS_TITLE": "Credenciais de Demonstração", + "LABELS": { + "EMAIL": "E-mail: ", + "PASSWORD": "Senha: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4504,11 +4541,33 @@ "CREATE_NEW_WORKSPACE": "Criar um novo espaço de trabalho", "FIND_WORKSPACE": "Encontrar espaço de trabalho" }, + "LABELS": { + "EMAIL": "Insira seu endereço de e-mail:", + "PASSWORD": "Insira sua senha:" + }, + "PLACEHOLDERS": { + "EMAIL": "nome@e-mail-da-empresa.com", + "PASSWORD": "Senha" + }, + "SIGN_IN_TITLE": "Entrar na Área de Trabalho", + "BACK_TO": "Voltar para", "SUCCESS_SIGNIN_TITLE": "Parabéns! Você fez login com sucesso em seu espaço de trabalho.", "SUCCESS_SIGNIN_SUB_TITLE": "Por favor, seja paciente enquanto preparamos o espaço de trabalho...", "FAIL_SIGNIN_TITLE": "Erro! O código mágico ou o link fornecido expirou ou é inválido.", "FAIL_SIGNIN_SUB_TITLE": "Por favor, inicie o processo novamente.", - "THANKING_TEXT": "Obrigado por nos escolher." + "THANKING_TEXT": "Obrigado por nos escolher.", + "UNKNOWN_WORKSPACE": "Não conhece a sua área de trabalho?", + "FIND_WORKSPACE": "Encontre suas áreas de trabalho" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Super Administrador", + "ADMIN_TITLE": "Administrador", + "EMPLOYEE_TITLE": "Funcionário", + "DEMO_CREDENTIALS_TITLE": "Credenciais de Demonstração", + "LABELS": { + "EMAIL": "E-mail: ", + "PASSWORD": "Senha: " + } }, "NO_IMAGE": { "ADD_DROP": "Adicionar ou Remover Imagem", diff --git a/apps/gauzy/src/assets/i18n/ru.json b/apps/gauzy/src/assets/i18n/ru.json index 7ea01e7b035..1b43ccff12e 100644 --- a/apps/gauzy/src/assets/i18n/ru.json +++ b/apps/gauzy/src/assets/i18n/ru.json @@ -8,6 +8,7 @@ "REGISTER": "Регистрация", "CHANGE_PASSWORD": "Изменить пароль", "LOGIN": "Войти", + "SIGNIN": "Вход", "SEND_CODE": "Войти по электронной почте", "ADD_NOTE": "Добавить заметку", "EDIT": "Редактировать", @@ -4323,6 +4324,34 @@ "receipt": "Квитанция" } }, + "REGISTER_PAGE": { + "TITLE": "Регистрация", + "HAVE_AN_ACCOUNT": "Уже есть аккаунт?", + "LABELS": { + "FULL_NAME": "Полное имя:", + "EMAIL": "Адрес электронной почты:", + "PASSWORD": "Пароль", + "CONFIRM_PASSWORD": "Подтвердите пароль:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "Полное имя", + "EMAIL": "Адрес электронной почты", + "PASSWORD": "Пароль", + "CONFIRM_PASSWORD": "Подтвердите пароль" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "Полное имя обязательно!", + "FULL_NAME_SHOULD_CONTAIN": "Полное имя должно содержать от {{ minLength }} до {{ maxLength }} символов", + "EMAIL_REQUIRED": "Требуется адрес электронной почты!", + "EMAIL_SHOULD_BE_REAL": "Адрес электронной почты должен быть реальным!", + "PASSWORD_NO_SPACE_EDGES": "Пароль не должен начинаться или заканчиваться пробелами!", + "PASSWORD_REQUIRED": "Требуется пароль!", + "PASSWORD_SHOULD_CONTAIN": "Пароль должен содержать от {{ minLength }} до {{ maxLength }} символов", + "CONFIRM_PASSWORD_REQUIRED": "Требуется подтверждение пароля!", + "PASSWORDS_NOT_MATCH": "Пароли не совпадают!", + "AGREE_TERMS_PRIVACY": "Соглашаюсь с Условиями использования и Политикой конфиденциальности" + } + }, "LOGIN_PAGE": { "TITLE": "Логин", "SUB_TITLE": "Привет! Войдите с помощью электронной почты.", @@ -4361,7 +4390,15 @@ }, "DEMO": { "TITLE": "Автоматически входить в демо-аккаунты", - "SUB_TITLE": "Пожалуйста, выберите тип счета ниже." + "SUB_TITLE": "Пожалуйста, выберите тип счета ниже.", + "SUPER_ADMIN_TITLE": "Супер Администратор", + "ADMIN_TITLE": "Администратор", + "EMPLOYEE_TITLE": "Сотрудник", + "DEMO_CREDENTIALS_TITLE": "Демонстрационные учетные данные", + "LABELS": { + "EMAIL": "Электронная почта: ", + "PASSWORD": "Пароль: " + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4428,11 +4465,33 @@ "CREATE_NEW_WORKSPACE": "Создать новую рабочую область", "FIND_WORKSPACE": "Найти рабочую область" }, + "LABELS": { + "EMAIL": "Введите ваш адрес электронной почты:", + "PASSWORD": "Введите ваш пароль:" + }, + "PLACEHOLDERS": { + "EMAIL": "name@workspace-email.com", + "PASSWORD": "Пароль" + }, + "SIGN_IN_TITLE": "Вход в Рабочее пространство", + "BACK_TO": "Назад к", "SUCCESS_SIGNIN_TITLE": "Поздравляю! Вы успешно вошли в свое рабочее пространство.", "SUCCESS_SIGNIN_SUB_TITLE": "Пожалуйста, будьте терпеливы, пока мы готовим рабочее пространство...", "FAIL_SIGNIN_TITLE": "Ошибка! Магический код или ссылка, которую вы предоставили, устарели или недействительны.", "FAIL_SIGNIN_SUB_TITLE": "Пожалуйста, начните процесс заново.", - "THANKING_TEXT": "Спасибо, что выбрали нас." + "THANKING_TEXT": "Спасибо, что выбрали нас.", + "UNKNOWN_WORKSPACE": "Не знаете своего рабочего пространства?", + "FIND_WORKSPACE": "Найти ваши рабочие пространства" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "Супер Администратор", + "ADMIN_TITLE": "Администратор", + "EMPLOYEE_TITLE": "Сотрудник", + "DEMO_CREDENTIALS_TITLE": "Демонстрационные учетные данные", + "LABELS": { + "EMAIL": "Электронная почта: ", + "PASSWORD": "Пароль: " + } }, "NO_IMAGE": { "ADD_DROP": "Добавить или выложить изображение", diff --git a/apps/gauzy/src/assets/i18n/zh.json b/apps/gauzy/src/assets/i18n/zh.json index afe6330cb47..864c9980577 100644 --- a/apps/gauzy/src/assets/i18n/zh.json +++ b/apps/gauzy/src/assets/i18n/zh.json @@ -8,6 +8,7 @@ "REGISTER": "注册", "CHANGE_PASSWORD": "更改密码", "LOGIN": "登录", + "SIGNIN": "登录", "SEND_CODE": "使用电子邮件登录", "ADD_NOTE": "添加笔记", "EDIT": "编辑", @@ -4398,6 +4399,34 @@ "receipt": "收据" } }, + "REGISTER_PAGE": { + "TITLE": "注册", + "HAVE_AN_ACCOUNT": "已经有账户?", + "LABELS": { + "FULL_NAME": "全名:", + "EMAIL": "电子邮件地址:", + "PASSWORD": "密码", + "CONFIRM_PASSWORD": "确认密码:" + }, + "PLACEHOLDERS": { + "FULL_NAME": "全名", + "EMAIL": "电子邮件地址", + "PASSWORD": "密码", + "CONFIRM_PASSWORD": "确认密码" + }, + "VALIDATIONS": { + "FULL_NAME_REQUIRED": "需要全名!", + "FULL_NAME_SHOULD_CONTAIN": "全名应包含 {{ minLength }} 到 {{ maxLength }} 个字符", + "EMAIL_REQUIRED": "需要电子邮件地址!", + "EMAIL_SHOULD_BE_REAL": "电子邮件地址应为真实的!", + "PASSWORD_NO_SPACE_EDGES": "密码不能以空格开头或结尾!", + "PASSWORD_REQUIRED": "需要密码!", + "PASSWORD_SHOULD_CONTAIN": "密码应包含 {{ minLength }} 到 {{ maxLength }} 个字符", + "CONFIRM_PASSWORD_REQUIRED": "需要确认密码!", + "PASSWORDS_NOT_MATCH": "密码与确认密码不匹配!", + "AGREE_TERMS_PRIVACY": "同意 条款和条件 以及 隐私政策" + } + }, "LOGIN_PAGE": { "TITLE": "登录", "SUB_TITLE": "你好!使用你的邮箱登录。", @@ -4436,7 +4465,15 @@ }, "DEMO": { "TITLE": "自动登录到演示账户。", - "SUB_TITLE": "请在下方选择帐户类型。" + "SUB_TITLE": "请在下方选择帐户类型。", + "SUPER_ADMIN_TITLE": "超级管理员", + "ADMIN_TITLE": "管理员", + "EMPLOYEE_TITLE": "员工", + "DEMO_CREDENTIALS_TITLE": "演示凭证", + "LABELS": { + "EMAIL": "电子邮件:", + "PASSWORD": "密码:" + } } }, "FORGOT_PASSWORD_PAGE": { @@ -4504,11 +4541,33 @@ "CREATE_NEW_WORKSPACE": "创建一个新的工作空间", "FIND_WORKSPACE": "寻找工作空间" }, + "LABELS": { + "EMAIL": "输入您的电子邮件地址:", + "PASSWORD": "输入您的密码:" + }, + "PLACEHOLDERS": { + "EMAIL": "name@workspace-email.com", + "PASSWORD": "密码" + }, + "SIGN_IN_TITLE": "登录工作区", + "BACK_TO": "返回", "SUCCESS_SIGNIN_TITLE": "恭喜!您已成功登录到您的工作区。", "SUCCESS_SIGNIN_SUB_TITLE": "请耐心等待,我们正在准备工作区...", "FAIL_SIGNIN_TITLE": "错误!您提供的魔法代码或链接已过期或无效。", "FAIL_SIGNIN_SUB_TITLE": "请重新启动流程。", - "THANKING_TEXT": "感谢您选择我们。" + "THANKING_TEXT": "感谢您选择我们。", + "UNKNOWN_WORKSPACE": "不知道您的工作区?", + "FIND_WORKSPACE": "查找您的工作区" + }, + "DEMO": { + "SUPER_ADMIN_TITLE": "超级管理员", + "ADMIN_TITLE": "管理员", + "EMPLOYEE_TITLE": "员工", + "DEMO_CREDENTIALS_TITLE": "演示凭证", + "LABELS": { + "EMAIL": "电子邮件:", + "PASSWORD": "密码:" + } }, "NO_IMAGE": { "ADD_DROP": "添加或删除图像", From c3e88882bc22bc4125ce60f85e278e739a5ed145 Mon Sep 17 00:00:00 2001 From: RAHUL RATHORE <41804588+rahul-rocket@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:25:53 +0530 Subject: [PATCH 03/34] fix: added Open AI Key Secret option in Gauzy AI integration --- .../authorization.component.html | 4 +- .../authorization/authorization.component.ts | 56 ++++++++++++++++--- apps/gauzy/src/assets/i18n/bg.json | 12 +++- apps/gauzy/src/assets/i18n/en.json | 3 +- apps/gauzy/src/assets/i18n/he.json | 12 +++- apps/gauzy/src/assets/i18n/ru.json | 12 +++- .../gauzy-ai/integration-ai.service.ts | 8 ++- .../src/integration/integration.entity.ts | 1 + 8 files changed, 91 insertions(+), 17 deletions(-) diff --git a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/authorization/authorization.component.html b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/authorization/authorization.component.html index bb62b58a1c6..11cd592740c 100644 --- a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/authorization/authorization.component.html +++ b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/authorization/authorization.component.html @@ -13,7 +13,7 @@
-
+
-
- + + + + + + + + diff --git a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.scss b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.scss index e69de29bb2d..15c43715364 100644 --- a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.scss +++ b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.scss @@ -0,0 +1,11 @@ +:host { + .tabset { + padding: 0; + } + header { + font-size: 18px; + font-weight: 600; + line-height: 30px; + letter-spacing: 0em; + } +} diff --git a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.ts b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.ts index eb064cb7cfc..c070fc9fb46 100644 --- a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.ts +++ b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.ts @@ -1,9 +1,13 @@ import { Component, OnInit } from '@angular/core'; import { TitleCasePipe } from '@angular/common'; -import { Router } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; +import { filter, tap } from 'rxjs/operators'; +import { Observable } from 'rxjs/internal/Observable'; import { TranslateService } from '@ngx-translate/core'; -import { UntilDestroy } from '@ngneat/until-destroy'; +import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; +import { IIntegrationSetting, IOrganization } from '@gauzy/contracts'; import { TranslationBaseComponent } from './../../../../../@shared/language-base'; +import { Store } from './../../../../../@core/services'; @UntilDestroy({ checkProperties: true }) @Component({ @@ -13,14 +17,36 @@ import { TranslationBaseComponent } from './../../../../../@shared/language-base }) export class GauzyAIViewComponent extends TranslationBaseComponent implements OnInit { + public organization$: Observable; // Observable to hold the selected organization + public settings$: Observable; + public settings: IIntegrationSetting[] = []; + constructor( - public readonly _translateService: TranslateService, - private readonly _router: Router + private readonly _router: Router, + private readonly _activatedRoute: ActivatedRoute, + public readonly translateService: TranslateService, + private readonly _store: Store, ) { - super(_translateService); + super(translateService); } - ngOnInit(): void { } + ngOnInit(): void { + // Setting up the organization$ observable pipeline + this.organization$ = this._store.selectedOrganization$.pipe( + // Exclude falsy values from the emitted values + filter((organization: IOrganization) => !!organization), + // Handle component lifecycle to avoid memory leaks + untilDestroyed(this) + ); + this.settings$ = this._activatedRoute.data.pipe( + // Update component state with fetched issues + tap((settings: IIntegrationSetting[]) => { + this.settings = settings; + }), + // Handle component lifecycle to avoid memory leaks + untilDestroyed(this), + ); + } /** * Navigate to the "Integrations" page. diff --git a/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai-routing.module.ts b/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai-routing.module.ts index 08b89d7811c..e0c45190b51 100644 --- a/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai-routing.module.ts +++ b/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai-routing.module.ts @@ -5,6 +5,7 @@ import { IntegrationResolver } from '../integration.resolver'; import { GauzyAIAuthorizationComponent } from './components/authorization/authorization.component'; import { GauzyAILayoutComponent } from './gauzy-ai.layout.component'; import { GauzyAIViewComponent } from './components/view/view.component'; +import { IntegrationSettingResolver } from '../integration-setting.resolver'; const routes: Routes = [ { @@ -31,6 +32,9 @@ const routes: Routes = [ { path: ':id', // Child route with a parameter (id) component: GauzyAIViewComponent, // Component for the route with an id parameter + resolve: { + settings: IntegrationSettingResolver, // Resolver to fetch data before activating the route + }, }, ] }, diff --git a/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai.module.ts b/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai.module.ts index 0ca8fcbb2d2..a75a09a460b 100644 --- a/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai.module.ts +++ b/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { NbButtonModule, NbCardModule, NbIconModule, NbInputModule, NbTooltipModule } from '@nebular/theme'; +import { NbButtonModule, NbCardModule, NbIconModule, NbInputModule, NbTabsetModule, NbTooltipModule } from '@nebular/theme'; import { TranslateModule } from './../../../@shared/translate/translate.module'; import { BackNavigationModule } from './../../../@shared/back-navigation'; import { GauzyAIRoutingModule } from './gauzy-ai-routing.module'; @@ -24,6 +24,7 @@ import { WorkInProgressModule } from '../../work-in-progress/work-in-progress.mo NbCardModule, NbIconModule, NbInputModule, + NbTabsetModule, NbTooltipModule, GauzyAIRoutingModule, TranslateModule, diff --git a/apps/gauzy/src/app/pages/integrations/integration-setting.resolver.ts b/apps/gauzy/src/app/pages/integrations/integration-setting.resolver.ts new file mode 100644 index 00000000000..b5db0ee9687 --- /dev/null +++ b/apps/gauzy/src/app/pages/integrations/integration-setting.resolver.ts @@ -0,0 +1,47 @@ +import { Injectable } from '@angular/core'; +import { Resolve, ActivatedRouteSnapshot, Router } from '@angular/router'; +import { Observable, EMPTY, map } from 'rxjs'; +import { catchError } from 'rxjs/operators'; +import { IIntegrationSetting, IIntegrationTenant } from '@gauzy/contracts'; +import { IntegrationsService } from '../../@core/services'; + +@Injectable({ + providedIn: 'root' +}) +export class IntegrationSettingResolver implements Resolve> { + constructor( + private readonly _router: Router, + private readonly _integrationsService: IntegrationsService + ) { } + + /** + * Resolves integration settings before activating the route. + * + * @param route - The activated route snapshot. + * @returns An observable that emits integration settings or a boolean value. + */ + resolve(route: ActivatedRouteSnapshot): Observable { + try { + const integrationId = route.paramMap.get('id'); + + return this._integrationsService.getIntegrationTenant(integrationId, { relations: ['settings'] }).pipe( + map(({ settings }: IIntegrationTenant) => settings), + catchError((error: any) => { + // Navigate to the new integration page in case of an error + this._router.navigate(['/pages/integrations/new']); + // Log the error for debugging purposes + console.error('Error while fetching integration settings:', error); + // Returning EMPTY as a placeholder; adjust this based on your needs + return EMPTY; + }) + ); + } catch (error) { + // Handle synchronous errors (if any) + console.error('Error in IntegrationSettingsResolver:', error); + // Navigate to the new integration page in case of an error + this._router.navigate(['/pages/integrations/new']); + // Returning EMPTY as a placeholder; adjust this based on your needs + return EMPTY; + } + } +} diff --git a/apps/gauzy/src/app/pages/integrations/integration.resolver.ts b/apps/gauzy/src/app/pages/integrations/integration.resolver.ts index d57b97a3233..9e426366577 100644 --- a/apps/gauzy/src/app/pages/integrations/integration.resolver.ts +++ b/apps/gauzy/src/app/pages/integrations/integration.resolver.ts @@ -19,7 +19,7 @@ export class IntegrationResolver implements Resolve} The fetched IntegrationTenant entity. + * @throws {InternalServerErrorException} If an error occurs during the fetching process. */ @Get(':id') async findById( @@ -92,10 +93,10 @@ export class IntegrationTenantController extends CrudController { try { + const { relations } = query; + // Attempt to find the IntegrationTenant entity in the database - return await this._integrationTenantService.findOneByIdString(integrationId, { - relations: query.relations, - }); + return await this._integrationTenantService.findOneByIdString(integrationId, { relations }); } catch (error) { // Handle and log any errors that occur console.error(`Error while finding IntegrationTenant: ${error.message}`); From 6eeb1b164be24d7a81ab71af78391c287c5adc52 Mon Sep 17 00:00:00 2001 From: RAHUL RATHORE <41804588+rahul-rocket@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:37:31 +0530 Subject: [PATCH 05/34] chore: console migration each file --- .../1638541848595-SwitchToMigration.ts | 15 +- .../1638793919144-KnowledgeBasePlugin.ts | 3 + .../1638797573521-ChangelogPlugin.ts | 13 +- .../1639729354753-CreatePasswordResetTable.ts | 151 +++++++++--------- .../1640007378352-AddColumnToRoleTable.ts | 11 +- .../1640784835692-AlterActivityTable.ts | 3 + ...42411409517-AlterCandidateEmployeeTable.ts | 3 + .../1642770124831-AlterEmailHistoryTable.ts | 3 + .../1643201180573-AlterTaskTable.ts | 13 +- .../1643807301083-AlterRolePermissionTable.ts | 3 + ...1643809486960-MigrateEmailTemplatesData.ts | 2 +- .../1644312012849-RolePermissionsReload.ts | 5 +- .../1644491785525-AdjustTimeLogStopDate.ts | 61 +++---- .../1644568289509-AlterTimeLogTable.ts | 3 + .../1644915598578-AlterEmployeeTable.ts | 3 + .../1645012749640-AlterPaymentTable.ts | 7 +- .../1645087150917-AlterEmailTable.ts | 3 + .../1645179275947-AlterInvoiceTable.ts | 3 + ...7-AddTimeTrackingFeatureToEmployeeTable.ts | 3 + .../1645726031706-AlterIntegrationTable.ts | 3 + ...9050-AlterEmployeeRecurringExpenseTable.ts | 3 + .../1646117679347-AlterScreenshotTable.ts | 3 + .../1646206946845-AlterExpenseTable.ts | 3 + .../1647417832147-AlterActivityTable.ts | 3 + .../1648899149818-AlterTenantTable.ts | 3 + .../1650532321598-AlterOrganizationProject.ts | 15 +- .../1650704972412-AlterChangelogTable.ts | 3 + .../1652270907163-AlterTimeOffRequestTable.ts | 3 + .../1652703299052-AlterTaskTableColumns.ts | 3 + .../1652936174625-ReportTableIconSeed.ts | 13 +- .../1653482244724-AlterExpenseTable.ts | 7 +- ...742570167-AlterOrganizationContactTable.ts | 3 + .../1654675304373-SeedChangeLogFeature.ts | 5 +- ...885355508-OrganizationProjectAlterTable.ts | 3 + .../1656833636109-AlterUserTable.ts | 3 + ...59618978087-AlterInvoiceEstimateHistory.ts | 3 + .../1659684413063-AlterContactTable.ts | 3 + .../1659696180759-AlterTenantTable.ts | 7 +- ...660988196279-AlterWarehouseProductTable.ts | 4 +- .../1661599336316-AlterWarehouseMerchant.ts | 4 +- .../1661853087396-AlterTimesheetTable.ts | 4 +- .../1662994539197-AlterInvoiceTable.ts | 4 +- ...64869127437-AlterCandidateFeedbackTable.ts | 8 +- ...5044607000-AlterCandidateInterviewTable.ts | 4 +- .../1665388204010-AlterWarehouseTable.ts | 4 +- .../1665399395983-AlterOrganizationTable.ts | 4 +- .../1665767813286-AltereInviteTable.ts | 4 +- .../1666007548644-AlterEmployeeTable.ts | 4 +- .../1666181221327-AlterOrganizationTable.ts | 4 +- .../1666780716428-AlterEmployeeTable.ts | 4 +- .../1668064327561-AlterOrganizationTable.ts | 4 +- ...1668084518509-AlterEmployeeTableColumns.ts | 4 +- .../1668256889786-AlterCustomSmtpTable.ts | 4 +- ...68446646237-AlterTableRelationCascading.ts | 6 +- .../1668502997873-AlterUserTable.ts | 4 +- ...68504932478-AlterTableRelationCascading.ts | 4 +- ...-AlterUserTableEmailVerificationColumns.ts | 4 +- .../1669280426592-AlterInviteTable.ts | 8 +- .../1669453028914-AlterUserInviteTable.ts | 8 +- ...670313962263-AlterOrganizationTeamTable.ts | 4 +- ...058-AlterInviteAllowedOrganizationTable.ts | 4 +- ...671706727549-AlterOrganizationTeamTable.ts | 4 +- .../1672211594766-AlterCandidateTable.ts | 4 +- .../1673005639130-AlterTimeLogTable.ts | 4 +- .../1673423542165-AlterTaskTable.ts | 4 +- .../1673589923548-CreateStatusTable.ts | 3 + .../1673946248066-AlterTaskTable.ts | 4 +- ...74044473393-SeedDefaultGlobalTaskStatus.ts | 6 +- .../1674109138954-AlterEmailSentTable.ts | 4 +- .../1674535367176-CreateTaskPriorityTable.ts | 4 +- .../1674538040466-CreateTaskSizeTable.ts | 4 +- ...88-SeedDefaultGlobalTaskPriorityAndSize.ts | 6 +- .../1674749291896-RenamedTaskStatusTable.ts | 4 +- .../1675186090641-AlterTaskStatusTable.ts | 4 +- .../1675240711524-CreateEmployeePhoneTable.ts | 3 + .../1675241589518-AlterUserTable.ts | 3 + .../1675410785835-AlterTaskTable.ts | 4 +- ...5687502784-AddTimeZoneColumnToUserTable.ts | 4 +- ...676351186923-AlterOrganizationTeamTable.ts | 4 +- ...ngColumnToOrganizationTeamEmployeeTable.ts | 4 +- ...30369336-AddLogoToOrganizationTeamTable.ts | 4 +- .../1676827319035-AlterEmployeeTable.ts | 4 +- ...41-SeedTaskPriorityAndSizeAndStatusIcon.ts | 28 ++-- .../1676978573552-AlterOrganizationTable.ts | 4 +- ...677063195155-AlterOrganizationTeamTable.ts | 4 +- .../migrations/1677142065591-AlterTagTable.ts | 4 +- .../1677156446733-AlterTaskTable.ts | 4 +- .../1677313663312-AlterEmployeeTable.ts | 4 +- .../1677508195152-AlterScreenshotTable.ts | 4 +- ...-CreateOrganizationTeamJoinRequestTable.ts | 3 + .../1678190791247-CreateEmailResetTable.ts | 4 +- ...678436030249-AlterOrganizationTeamTable.ts | 4 +- .../1678461100447-AlterEmailResetTable.ts | 4 +- .../1678876700413-EmailTemplateReader.ts | 4 +- ...atusTableTaskSizeTableTaskPriorityTable.ts | 4 +- ...4-AlterOrganizationTeamJoinRequestTable.ts | 4 +- .../1679308324164-AlterImageAssetTable.ts | 4 +- ...79406665415-AddImageAssetColumnToTables.ts | 4 +- ...dImageAssetColumnToTheOrganizationTable.ts | 4 +- ...ageAssetColumnToTheProductCategoryTable.ts | 4 +- .../1679765443208-MigrateRolePermisisons.ts | 7 +- .../1680071714132-CreateIssueTypeTable.ts | 4 +- ...411434-AddIssueTypeColumnToTheTaskTable.ts | 4 +- ...586-AddIndexesColumnsToTheTimeSlotTable.ts | 4 +- ...9-AddIndexesColumnsToTheScreenshotTable.ts | 4 +- ...492-AddIndexesColumnsToTheActivityTable.ts | 4 +- ...93-AddIndexesColumnsToTheTimesheetTable.ts | 4 +- ...2764-AddIndexesColumnsToTheTimeLogTable.ts | 3 + ...30165590-AlterJobSearchRelationalTables.ts | 4 +- .../1680539459969-UpdateEmailTemplates.ts | 4 +- ...680622389221-SeedDafaultGlobalIssueType.ts | 3 + ...orkOrganizationIdToTheOrganizationTable.ts | 4 +- .../1680692867660-AlterEmployeeTable.ts | 4 +- ...setColumnToTheOrganizationDocumentTable.ts | 4 +- ...mentAssetColumnToTheTimeOffRequestTable.ts | 4 +- ...EmployeeStatusColumnsToTheEmployeeTable.ts | 3 + ...ganizationTeamIdColumnToTheTimeLogTable.ts | 4 +- ...686195290990-AlterOrganizationTeamTable.ts | 3 + ...MinimumBillingRateColumnToEmployeeTable.ts | 3 + ...inimumBillingRateColumnToCandidateTable.ts | 4 +- .../1687974863736-CreateTaskVersionTable.ts | 3 + .../1688122296981-AlterTableEmployee.ts | 4 +- ...88168798377-CreateRelatedIssueTypeTable.ts | 8 +- ...8886388219-AddParentIdColumnToTaskTable.ts | 4 +- ...2457-AddRelatedIssueRelationToTaskTable.ts | 3 + ...689150247379-CreateTaskLinkedIssueTable.ts | 4 +- ...1441-CreateOrganizationTaskSettingTable.ts | 4 +- ...689611487195-DropTaskRelatedIssuesTable.ts | 32 ++-- ...1689670799675-CreateTaskEstimationTable.ts | 8 +- .../1690040638765-AlterReportTable.ts | 4 +- ...iveTaskColumnToOrganizationTeamEmployee.ts | 6 +- ...kOrganizationNameToTheOrganizationTable.ts | 4 +- .../1691493358068-AlterIntegrationTable.ts | 3 +- .../1691494801748-SeedIntegrationTable.ts | 3 +- ...691756595248-AddUserIdColumnToUserTable.ts | 3 +- .../1692171665427-SeedIntegrationTable.ts | 3 +- ...1607-AddOrganizationProjectTeamRelation.ts | 3 +- ...-AlterIntegrationTableRelationCascading.ts | 3 +- ...92433732267-AlterIntegrationTenantTable.ts | 3 +- ...547294428-AlterCodeToAlphaNumericFormat.ts | 3 +- ...1-AlterOrganizationTeamJoinRequestTable.ts | 4 +- ...3907817-AddColumnsToTheIntegrationTable.ts | 2 +- ...783-AddColumnsToTheIntegrationTypeTable.ts | 3 +- ...840-SeedIntegrationsAndIntegrationTypes.ts | 3 +- .../1695570009125-AlterTableTask.ts | 3 + ...1695958130201-AddedArchivedColumnToUser.ts | 4 +- ...-AddedActiveArchivedColumnsToBaseEntity.ts | 4 +- .../migrations/1696704276300-AddLanguage.ts | 2 +- ...ingColumnsToTheOrganizationProjectTable.ts | 3 +- ...cTagColumnToTheOrganizationProjectTable.ts | 3 +- ...546-AddedEmailStatusToEmailHistoryTable.ts | 4 +- ...691682-AlterTableInvoiceEstimateHistory.ts | 3 +- ...rationOrganizationGithubRepositoryTable.ts | 4 +- ...ncedAtColumnToTheIntegrationTenantTable.ts | 4 +- ...rationOrganizationGithubRepositoryTable.ts | 4 +- ...nOrganizationGithubRepositoryIssueTable.ts | 4 +- ...3745-AddSoftDeleteFeatureToTheAllTables.ts | 4 +- ...rationOrganizationGithubRepositoryTable.ts | 4 +- .../1699353179526-AlterPasswordResetTable.ts | 4 +- .../1700123233258-AlterTableOrganization.ts | 3 +- ...ddMultiTenantResetPasswordEmailTemplate.ts | 3 +- ...AtFeatureToTheTimesheetAndTimeLogTables.ts | 3 +- .../1701081154869-AlterScreenshotTable.ts | 4 +- .../1701353754397-MigrateEmailTemplates.ts | 3 +- 164 files changed, 636 insertions(+), 315 deletions(-) diff --git a/packages/core/src/database/migrations/1638541848595-SwitchToMigration.ts b/packages/core/src/database/migrations/1638541848595-SwitchToMigration.ts index a4903e4cfa5..3bbeb287e3f 100644 --- a/packages/core/src/database/migrations/1638541848595-SwitchToMigration.ts +++ b/packages/core/src/database/migrations/1638541848595-SwitchToMigration.ts @@ -1,9 +1,12 @@ -import {MigrationInterface, QueryRunner} from "typeorm"; +import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class SwitchToMigration1638541848595 implements MigrationInterface { name = 'SwitchToMigration1638541848595' public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -5358,11 +5361,11 @@ export class SwitchToMigration1638541848595 implements MigrationInterface { await queryRunner.query(`CREATE INDEX "IDX_3557d514afd3794d40128e0542" ON "tag_warehouse" ("tagId") `); } - /** - * SqliteDB Down Migration - * - * @param queryRunner - */ + /** + * SqliteDB Down Migration + * + * @param queryRunner + */ private async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_3557d514afd3794d40128e0542"`); await queryRunner.query(`DROP INDEX "IDX_08385e1e045b83d25978568743"`); diff --git a/packages/core/src/database/migrations/1638793919144-KnowledgeBasePlugin.ts b/packages/core/src/database/migrations/1638793919144-KnowledgeBasePlugin.ts index 832fd85fca5..ac934a1e00e 100644 --- a/packages/core/src/database/migrations/1638793919144-KnowledgeBasePlugin.ts +++ b/packages/core/src/database/migrations/1638793919144-KnowledgeBasePlugin.ts @@ -1,9 +1,12 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class KnowledgeBasePlugin1638793919144 implements MigrationInterface { name = 'KnowledgeBasePlugin1638793919144'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1638797573521-ChangelogPlugin.ts b/packages/core/src/database/migrations/1638797573521-ChangelogPlugin.ts index c44ee25541a..5d7f07bc0a3 100644 --- a/packages/core/src/database/migrations/1638797573521-ChangelogPlugin.ts +++ b/packages/core/src/database/migrations/1638797573521-ChangelogPlugin.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class ChangelogPlugin1638797573521 implements MigrationInterface { name = 'ChangelogPlugin1638797573521'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -77,11 +80,11 @@ export class ChangelogPlugin1638797573521 implements MigrationInterface { await queryRunner.query(`CREATE INDEX "IDX_c2037b621d2e8023898aee4ac7" ON "changelog" ("organizationId") `); } - /** - * SqliteDB Down Migration - * - * @param queryRunner - */ + /** + * SqliteDB Down Migration + * + * @param queryRunner + */ public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_c2037b621d2e8023898aee4ac7"`); await queryRunner.query(`DROP INDEX "IDX_744268ee0ec6073883267bc3b6"`); diff --git a/packages/core/src/database/migrations/1639729354753-CreatePasswordResetTable.ts b/packages/core/src/database/migrations/1639729354753-CreatePasswordResetTable.ts index 9683c6ac19c..8c7819f188d 100644 --- a/packages/core/src/database/migrations/1639729354753-CreatePasswordResetTable.ts +++ b/packages/core/src/database/migrations/1639729354753-CreatePasswordResetTable.ts @@ -1,86 +1,89 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; - export class CreatePasswordResetTable1639729354753 implements MigrationInterface { +export class CreatePasswordResetTable1639729354753 implements MigrationInterface { - name = 'CreatePasswordResetTable1639729354753'; + name = 'CreatePasswordResetTable1639729354753'; - public async up(queryRunner: QueryRunner): Promise { - if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { - await this.sqliteUpQueryRunner(queryRunner); - } else { - await this.postgresUpQueryRunner(queryRunner); - } - } + public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); - public async down(queryRunner: QueryRunner): Promise { - if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { - await this.sqliteDownQueryRunner(queryRunner); - } else { - await this.postgresDownQueryRunner(queryRunner); - } + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { + await this.sqliteUpQueryRunner(queryRunner); + } else { + await this.postgresUpQueryRunner(queryRunner); } + } - /** - * PostgresDB Up Migration - * - * @param queryRunner - */ - public async postgresUpQueryRunner(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE "password_reset" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "email" character varying NOT NULL, "token" character varying NOT NULL, CONSTRAINT "PK_8515e60a2cc41584fa4784f52ce" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_1c88db6e50f0704688d1f1978c" ON "password_reset" ("email") `); - await queryRunner.query(`CREATE INDEX "IDX_36e929b98372d961bb63bd4b4e" ON "password_reset" ("token") `); - await queryRunner.query(`ALTER TABLE "contact" ALTER COLUMN "latitude" TYPE double precision`); - await queryRunner.query(`ALTER TABLE "contact" ALTER COLUMN "longitude" TYPE double precision`); + public async down(queryRunner: QueryRunner): Promise { + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { + await this.sqliteDownQueryRunner(queryRunner); + } else { + await this.postgresDownQueryRunner(queryRunner); } + } - /** - * PostgresDB Down Migration - * - * @param queryRunner - */ - public async postgresDownQueryRunner(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE "contact" ALTER COLUMN "longitude" TYPE double precision`); - await queryRunner.query(`ALTER TABLE "contact" ALTER COLUMN "latitude" TYPE double precision`); - await queryRunner.query(`DROP INDEX "public"."IDX_36e929b98372d961bb63bd4b4e"`); - await queryRunner.query(`DROP INDEX "public"."IDX_1c88db6e50f0704688d1f1978c"`); - await queryRunner.query(`DROP TABLE "password_reset"`); - } + /** + * PostgresDB Up Migration + * + * @param queryRunner + */ + public async postgresUpQueryRunner(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE "password_reset" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "email" character varying NOT NULL, "token" character varying NOT NULL, CONSTRAINT "PK_8515e60a2cc41584fa4784f52ce" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE INDEX "IDX_1c88db6e50f0704688d1f1978c" ON "password_reset" ("email") `); + await queryRunner.query(`CREATE INDEX "IDX_36e929b98372d961bb63bd4b4e" ON "password_reset" ("token") `); + await queryRunner.query(`ALTER TABLE "contact" ALTER COLUMN "latitude" TYPE double precision`); + await queryRunner.query(`ALTER TABLE "contact" ALTER COLUMN "longitude" TYPE double precision`); + } - /** - * SqliteDB Up Migration - * - * @param queryRunner - */ - public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE "password_reset" ("id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "email" varchar NOT NULL, "token" varchar NOT NULL)`); - await queryRunner.query(`CREATE INDEX "IDX_1c88db6e50f0704688d1f1978c" ON "password_reset" ("email") `); - await queryRunner.query(`CREATE INDEX "IDX_36e929b98372d961bb63bd4b4e" ON "password_reset" ("token") `); - await queryRunner.query(`DROP INDEX "IDX_7719d73cd16a9f57ecc6ac24b3"`); - await queryRunner.query(`DROP INDEX "IDX_60468af1ce34043a900809c84f"`); - await queryRunner.query(`CREATE TABLE "temporary_contact" ("id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "tenantId" varchar, "organizationId" varchar, "name" varchar, "firstName" varchar, "lastName" varchar, "country" varchar, "city" varchar, "address" varchar, "address2" varchar, "postcode" varchar, "latitude" float, "longitude" float, "regionCode" varchar, "fax" varchar, "fiscalInformation" varchar, "website" varchar, CONSTRAINT "FK_7719d73cd16a9f57ecc6ac24b3d" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_60468af1ce34043a900809c84f2" FOREIGN KEY ("tenantId") REFERENCES "tenant" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_contact"("id", "createdAt", "updatedAt", "tenantId", "organizationId", "name", "firstName", "lastName", "country", "city", "address", "address2", "postcode", "latitude", "longitude", "regionCode", "fax", "fiscalInformation", "website") SELECT "id", "createdAt", "updatedAt", "tenantId", "organizationId", "name", "firstName", "lastName", "country", "city", "address", "address2", "postcode", "latitude", "longitude", "regionCode", "fax", "fiscalInformation", "website" FROM "contact"`); - await queryRunner.query(`DROP TABLE "contact"`); - await queryRunner.query(`ALTER TABLE "temporary_contact" RENAME TO "contact"`); - await queryRunner.query(`CREATE INDEX "IDX_7719d73cd16a9f57ecc6ac24b3" ON "contact" ("organizationId") `); - await queryRunner.query(`CREATE INDEX "IDX_60468af1ce34043a900809c84f" ON "contact" ("tenantId") `); - } + /** + * PostgresDB Down Migration + * + * @param queryRunner + */ + public async postgresDownQueryRunner(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "contact" ALTER COLUMN "longitude" TYPE double precision`); + await queryRunner.query(`ALTER TABLE "contact" ALTER COLUMN "latitude" TYPE double precision`); + await queryRunner.query(`DROP INDEX "public"."IDX_36e929b98372d961bb63bd4b4e"`); + await queryRunner.query(`DROP INDEX "public"."IDX_1c88db6e50f0704688d1f1978c"`); + await queryRunner.query(`DROP TABLE "password_reset"`); + } - /** - * SqliteDB Down Migration - * - * @param queryRunner - */ - public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise { - await queryRunner.query(`DROP INDEX "IDX_60468af1ce34043a900809c84f"`); - await queryRunner.query(`DROP INDEX "IDX_7719d73cd16a9f57ecc6ac24b3"`); - await queryRunner.query(`ALTER TABLE "contact" RENAME TO "temporary_contact"`); - await queryRunner.query(`CREATE TABLE "contact" ("id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "tenantId" varchar, "organizationId" varchar, "name" varchar, "firstName" varchar, "lastName" varchar, "country" varchar, "city" varchar, "address" varchar, "address2" varchar, "postcode" varchar, "latitude" float, "longitude" float, "regionCode" varchar, "fax" varchar, "fiscalInformation" varchar, "website" varchar, CONSTRAINT "FK_7719d73cd16a9f57ecc6ac24b3d" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_60468af1ce34043a900809c84f2" FOREIGN KEY ("tenantId") REFERENCES "tenant" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "contact"("id", "createdAt", "updatedAt", "tenantId", "organizationId", "name", "firstName", "lastName", "country", "city", "address", "address2", "postcode", "latitude", "longitude", "regionCode", "fax", "fiscalInformation", "website") SELECT "id", "createdAt", "updatedAt", "tenantId", "organizationId", "name", "firstName", "lastName", "country", "city", "address", "address2", "postcode", "latitude", "longitude", "regionCode", "fax", "fiscalInformation", "website" FROM "temporary_contact"`); - await queryRunner.query(`DROP TABLE "temporary_contact"`); - await queryRunner.query(`CREATE INDEX "IDX_60468af1ce34043a900809c84f" ON "contact" ("tenantId") `); - await queryRunner.query(`CREATE INDEX "IDX_7719d73cd16a9f57ecc6ac24b3" ON "contact" ("organizationId") `); - await queryRunner.query(`DROP INDEX "IDX_36e929b98372d961bb63bd4b4e"`); - await queryRunner.query(`DROP INDEX "IDX_1c88db6e50f0704688d1f1978c"`); - await queryRunner.query(`DROP TABLE "password_reset"`); - } + /** + * SqliteDB Up Migration + * + * @param queryRunner + */ + public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE "password_reset" ("id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "email" varchar NOT NULL, "token" varchar NOT NULL)`); + await queryRunner.query(`CREATE INDEX "IDX_1c88db6e50f0704688d1f1978c" ON "password_reset" ("email") `); + await queryRunner.query(`CREATE INDEX "IDX_36e929b98372d961bb63bd4b4e" ON "password_reset" ("token") `); + await queryRunner.query(`DROP INDEX "IDX_7719d73cd16a9f57ecc6ac24b3"`); + await queryRunner.query(`DROP INDEX "IDX_60468af1ce34043a900809c84f"`); + await queryRunner.query(`CREATE TABLE "temporary_contact" ("id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "tenantId" varchar, "organizationId" varchar, "name" varchar, "firstName" varchar, "lastName" varchar, "country" varchar, "city" varchar, "address" varchar, "address2" varchar, "postcode" varchar, "latitude" float, "longitude" float, "regionCode" varchar, "fax" varchar, "fiscalInformation" varchar, "website" varchar, CONSTRAINT "FK_7719d73cd16a9f57ecc6ac24b3d" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_60468af1ce34043a900809c84f2" FOREIGN KEY ("tenantId") REFERENCES "tenant" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_contact"("id", "createdAt", "updatedAt", "tenantId", "organizationId", "name", "firstName", "lastName", "country", "city", "address", "address2", "postcode", "latitude", "longitude", "regionCode", "fax", "fiscalInformation", "website") SELECT "id", "createdAt", "updatedAt", "tenantId", "organizationId", "name", "firstName", "lastName", "country", "city", "address", "address2", "postcode", "latitude", "longitude", "regionCode", "fax", "fiscalInformation", "website" FROM "contact"`); + await queryRunner.query(`DROP TABLE "contact"`); + await queryRunner.query(`ALTER TABLE "temporary_contact" RENAME TO "contact"`); + await queryRunner.query(`CREATE INDEX "IDX_7719d73cd16a9f57ecc6ac24b3" ON "contact" ("organizationId") `); + await queryRunner.query(`CREATE INDEX "IDX_60468af1ce34043a900809c84f" ON "contact" ("tenantId") `); + } + + /** + * SqliteDB Down Migration + * + * @param queryRunner + */ + public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX "IDX_60468af1ce34043a900809c84f"`); + await queryRunner.query(`DROP INDEX "IDX_7719d73cd16a9f57ecc6ac24b3"`); + await queryRunner.query(`ALTER TABLE "contact" RENAME TO "temporary_contact"`); + await queryRunner.query(`CREATE TABLE "contact" ("id" varchar PRIMARY KEY NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "tenantId" varchar, "organizationId" varchar, "name" varchar, "firstName" varchar, "lastName" varchar, "country" varchar, "city" varchar, "address" varchar, "address2" varchar, "postcode" varchar, "latitude" float, "longitude" float, "regionCode" varchar, "fax" varchar, "fiscalInformation" varchar, "website" varchar, CONSTRAINT "FK_7719d73cd16a9f57ecc6ac24b3d" FOREIGN KEY ("organizationId") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_60468af1ce34043a900809c84f2" FOREIGN KEY ("tenantId") REFERENCES "tenant" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "contact"("id", "createdAt", "updatedAt", "tenantId", "organizationId", "name", "firstName", "lastName", "country", "city", "address", "address2", "postcode", "latitude", "longitude", "regionCode", "fax", "fiscalInformation", "website") SELECT "id", "createdAt", "updatedAt", "tenantId", "organizationId", "name", "firstName", "lastName", "country", "city", "address", "address2", "postcode", "latitude", "longitude", "regionCode", "fax", "fiscalInformation", "website" FROM "temporary_contact"`); + await queryRunner.query(`DROP TABLE "temporary_contact"`); + await queryRunner.query(`CREATE INDEX "IDX_60468af1ce34043a900809c84f" ON "contact" ("tenantId") `); + await queryRunner.query(`CREATE INDEX "IDX_7719d73cd16a9f57ecc6ac24b3" ON "contact" ("organizationId") `); + await queryRunner.query(`DROP INDEX "IDX_36e929b98372d961bb63bd4b4e"`); + await queryRunner.query(`DROP INDEX "IDX_1c88db6e50f0704688d1f1978c"`); + await queryRunner.query(`DROP TABLE "password_reset"`); } +} diff --git a/packages/core/src/database/migrations/1640007378352-AddColumnToRoleTable.ts b/packages/core/src/database/migrations/1640007378352-AddColumnToRoleTable.ts index 383efe7c637..246412fa408 100644 --- a/packages/core/src/database/migrations/1640007378352-AddColumnToRoleTable.ts +++ b/packages/core/src/database/migrations/1640007378352-AddColumnToRoleTable.ts @@ -1,14 +1,17 @@ import { MigrationInterface, QueryRunner } from "typeorm"; - +import * as chalk from "chalk"; + export class AddColumnToRoleTable1640007378352 implements MigrationInterface { name = 'AddColumnToRoleTable1640007378352'; - + public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + await queryRunner.query(`ALTER TABLE "role" ADD "isSystem" boolean NOT NULL DEFAULT false`); } - + public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "role" DROP COLUMN "isSystem"`); } -} \ No newline at end of file +} diff --git a/packages/core/src/database/migrations/1640784835692-AlterActivityTable.ts b/packages/core/src/database/migrations/1640784835692-AlterActivityTable.ts index aeb88e62c40..c8efd7149eb 100644 --- a/packages/core/src/database/migrations/1640784835692-AlterActivityTable.ts +++ b/packages/core/src/database/migrations/1640784835692-AlterActivityTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterActivityTable1640784835692 implements MigrationInterface { name = 'AlterActivityTable1640784835692'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1642411409517-AlterCandidateEmployeeTable.ts b/packages/core/src/database/migrations/1642411409517-AlterCandidateEmployeeTable.ts index d5568f2ccfe..8df8885d493 100644 --- a/packages/core/src/database/migrations/1642411409517-AlterCandidateEmployeeTable.ts +++ b/packages/core/src/database/migrations/1642411409517-AlterCandidateEmployeeTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterCandidateEmployeeTable1642411409517 implements MigrationInterface { name = 'AlterCandidateEmployeeTable1642411409517'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1642770124831-AlterEmailHistoryTable.ts b/packages/core/src/database/migrations/1642770124831-AlterEmailHistoryTable.ts index 6a9d8f0848f..9cb1caff25d 100644 --- a/packages/core/src/database/migrations/1642770124831-AlterEmailHistoryTable.ts +++ b/packages/core/src/database/migrations/1642770124831-AlterEmailHistoryTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmailHistoryTable1642770124831 implements MigrationInterface { name = 'AlterEmailHistoryTable1642770124831'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1643201180573-AlterTaskTable.ts b/packages/core/src/database/migrations/1643201180573-AlterTaskTable.ts index 8219e8dc3be..4865fb0be0f 100644 --- a/packages/core/src/database/migrations/1643201180573-AlterTaskTable.ts +++ b/packages/core/src/database/migrations/1643201180573-AlterTaskTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTaskTable1643201180573 implements MigrationInterface { name = 'AlterTaskTable1643201180573'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -20,11 +23,11 @@ export class AlterTaskTable1643201180573 implements MigrationInterface { } } - /** - * PostgresDB Up Migration - * - * @param queryRunner - */ + /** + * PostgresDB Up Migration + * + * @param queryRunner + */ public async postgresUpQueryRunner(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "task" ALTER COLUMN "status" SET DEFAULT 'Todo'`); } diff --git a/packages/core/src/database/migrations/1643807301083-AlterRolePermissionTable.ts b/packages/core/src/database/migrations/1643807301083-AlterRolePermissionTable.ts index 6df714fff5a..7955b54fbb3 100644 --- a/packages/core/src/database/migrations/1643807301083-AlterRolePermissionTable.ts +++ b/packages/core/src/database/migrations/1643807301083-AlterRolePermissionTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterRolePermissionTable1643807301083 implements MigrationInterface { name = 'AlterRolePermissionTable1643807301083'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1643809486960-MigrateEmailTemplatesData.ts b/packages/core/src/database/migrations/1643809486960-MigrateEmailTemplatesData.ts index f69c4ef6c08..274f55139cb 100644 --- a/packages/core/src/database/migrations/1643809486960-MigrateEmailTemplatesData.ts +++ b/packages/core/src/database/migrations/1643809486960-MigrateEmailTemplatesData.ts @@ -13,7 +13,7 @@ export class MigrateEmailTemplatesData1643809486960 implements MigrationInterfac * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); const templates = Object.values(EmailTemplateEnum); await Promise.all( diff --git a/packages/core/src/database/migrations/1644312012849-RolePermissionsReload.ts b/packages/core/src/database/migrations/1644312012849-RolePermissionsReload.ts index eeec33609c5..ec19b6d4aff 100644 --- a/packages/core/src/database/migrations/1644312012849-RolePermissionsReload.ts +++ b/packages/core/src/database/migrations/1644312012849-RolePermissionsReload.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; import { RolePermissionUtils } from './../../role-permission/utils'; export class RolePermissionsReload1644312012849 implements MigrationInterface { name = 'RolePermissionsReload1644312012849'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + try { await RolePermissionUtils.migrateRolePermissions(queryRunner); } catch (error) { @@ -12,5 +15,5 @@ export class RolePermissionsReload1644312012849 implements MigrationInterface { } } - public async down(queryRunner: QueryRunner): Promise {} + public async down(queryRunner: QueryRunner): Promise { } } diff --git a/packages/core/src/database/migrations/1644491785525-AdjustTimeLogStopDate.ts b/packages/core/src/database/migrations/1644491785525-AdjustTimeLogStopDate.ts index 3e84113ca8b..c6ca8767d7b 100644 --- a/packages/core/src/database/migrations/1644491785525-AdjustTimeLogStopDate.ts +++ b/packages/core/src/database/migrations/1644491785525-AdjustTimeLogStopDate.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; import { chain } from 'underscore'; import * as moment from 'moment'; import { isEmpty, isNotEmpty } from "@gauzy/common"; @@ -8,10 +9,12 @@ export class AdjustTimeLogStopDate1644491785525 implements MigrationInterface { name = 'AdjustTimeLogStopDate1644491785525'; public async up(queryRunner: QueryRunner): Promise { - const isSqlite = ['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type); - const timeSlots = await queryRunner.connection.manager.query( - isSqlite - ? ` + console.log(chalk.yellow(this.name + ' start running!')); + + const isSqlite = ['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type); + const timeSlots = await queryRunner.connection.manager.query( + isSqlite + ? ` SELECT * FROM "time_slot" WHERE @@ -20,7 +23,7 @@ export class AdjustTimeLogStopDate1644491785525 implements MigrationInterface { "time_slot"."mouse" < ? OR "time_slot"."duration" > ?; ` - : ` + : ` SELECT * FROM "time_slot" WHERE @@ -29,16 +32,16 @@ export class AdjustTimeLogStopDate1644491785525 implements MigrationInterface { "time_slot"."mouse" < $3 OR "time_slot"."duration" > $4; `, - [0, 0, 0, 600] - ); + [0, 0, 0, 600] + ); for await (const timeSlot of timeSlots) { const duration = (timeSlot.duration < 0) ? 0 : (timeSlot.duration > 600) ? 600 : timeSlot.duration; const overall = (timeSlot.overall < 0) ? 0 : (timeSlot.overall > 600) ? 600 : timeSlot.overall; const keyboard = (timeSlot.keyboard < 0) ? 0 : (timeSlot.keyboard > 600) ? 600 : timeSlot.keyboard; const mouse = (timeSlot.mouse < 0) ? 0 : (timeSlot.mouse > 600) ? 600 : timeSlot.mouse; await queryRunner.connection.manager.query( - isSqlite - ? ` + isSqlite + ? ` UPDATE "time_slot" SET "duration" = ?, "overall" = ?, @@ -46,7 +49,7 @@ export class AdjustTimeLogStopDate1644491785525 implements MigrationInterface { "mouse" = ? WHERE "id" IN(?)` - : ` + : ` UPDATE "time_slot" SET "duration" = $1, "overall" = $2, @@ -54,8 +57,8 @@ export class AdjustTimeLogStopDate1644491785525 implements MigrationInterface { "mouse" = $4 WHERE "id" IN($5)`, - [duration, overall, keyboard, mouse, timeSlot.id] - ); + [duration, overall, keyboard, mouse, timeSlot.id] + ); } const timelogs = await queryRunner.connection.manager.query(` @@ -78,11 +81,11 @@ export class AdjustTimeLogStopDate1644491785525 implements MigrationInterface { ) .filter(Boolean); const [timeLog] = await queryRunner.connection.manager.query( - isSqlite - ? `SELECT * FROM "time_log" WHERE "time_log"."id" = ? LIMIT 1` - : `SELECT * FROM "time_log" WHERE "time_log"."id" = $1 LIMIT 1`, - [timeLogId] - ); + isSqlite + ? `SELECT * FROM "time_log" WHERE "time_log"."id" = ? LIMIT 1` + : `SELECT * FROM "time_log" WHERE "time_log"."id" = $1 LIMIT 1`, + [timeLogId] + ); const logDifference = moment().diff(moment.utc(timeLog.startedAt), 'minutes'); if ( @@ -90,19 +93,19 @@ export class AdjustTimeLogStopDate1644491785525 implements MigrationInterface { logDifference > 10 ) { await queryRunner.connection.manager.query( - isSqlite - ? ` + isSqlite + ? ` UPDATE "time_log" SET "stoppedAt" = ? WHERE "id" IN(?)` - : ` + : ` UPDATE "time_log" SET "stoppedAt" = $1 WHERE "id" IN($2)`, - [timeLog.startedAt, timeLog.id] - ); + [timeLog.startedAt, timeLog.id] + ); } else if (isNotEmpty(timeSlotsIds)) { const timeSlots = await queryRunner.connection.manager.query(` SELECT * FROM @@ -132,24 +135,24 @@ export class AdjustTimeLogStopDate1644491785525 implements MigrationInterface { slotDifference = moment().diff(moment.utc(stoppedAt), 'minutes'); } if (slotDifference > 10) { - await queryRunner.connection.manager.query( - isSqlite - ? ` + await queryRunner.connection.manager.query( + isSqlite + ? ` UPDATE "time_log" SET "stoppedAt" = ? WHERE "id" IN(?)` - : ` + : ` UPDATE "time_log" SET "stoppedAt" = $1 WHERE "id" IN($2)`, - [stoppedAt, timeLog.id] - ); + [stoppedAt, timeLog.id] + ); } } } } - public async down(queryRunner: QueryRunner): Promise {} + public async down(queryRunner: QueryRunner): Promise { } } diff --git a/packages/core/src/database/migrations/1644568289509-AlterTimeLogTable.ts b/packages/core/src/database/migrations/1644568289509-AlterTimeLogTable.ts index 8cacf5fdb65..58310bc79e1 100644 --- a/packages/core/src/database/migrations/1644568289509-AlterTimeLogTable.ts +++ b/packages/core/src/database/migrations/1644568289509-AlterTimeLogTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTimeLogTable1644568289509 implements MigrationInterface { name = 'AlterTimeLogTable1644568289509'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1644915598578-AlterEmployeeTable.ts b/packages/core/src/database/migrations/1644915598578-AlterEmployeeTable.ts index 6113dc48a10..3b78f3007c3 100644 --- a/packages/core/src/database/migrations/1644915598578-AlterEmployeeTable.ts +++ b/packages/core/src/database/migrations/1644915598578-AlterEmployeeTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmployeeTable1644915598578 implements MigrationInterface { name = 'AlterEmployeeTable1644915598578'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1645012749640-AlterPaymentTable.ts b/packages/core/src/database/migrations/1645012749640-AlterPaymentTable.ts index a9601f61f11..ba137bfb09b 100644 --- a/packages/core/src/database/migrations/1645012749640-AlterPaymentTable.ts +++ b/packages/core/src/database/migrations/1645012749640-AlterPaymentTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterPaymentTable1645012749640 implements MigrationInterface { name = 'AlterPaymentTable1645012749640'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -47,12 +50,12 @@ export class AlterPaymentTable1645012749640 implements MigrationInterface { * * @param queryRunner */ - public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise {} + public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise { } /** * SqliteDB Down Migration * * @param queryRunner */ - public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise {} + public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise { } } diff --git a/packages/core/src/database/migrations/1645087150917-AlterEmailTable.ts b/packages/core/src/database/migrations/1645087150917-AlterEmailTable.ts index 3fe921e3b16..ceaa5464409 100644 --- a/packages/core/src/database/migrations/1645087150917-AlterEmailTable.ts +++ b/packages/core/src/database/migrations/1645087150917-AlterEmailTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmailTable1645087150917 implements MigrationInterface { name = 'AlterEmailTable1645087150917'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1645179275947-AlterInvoiceTable.ts b/packages/core/src/database/migrations/1645179275947-AlterInvoiceTable.ts index 27f36f11422..a0bcacf06b8 100644 --- a/packages/core/src/database/migrations/1645179275947-AlterInvoiceTable.ts +++ b/packages/core/src/database/migrations/1645179275947-AlterInvoiceTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterInvoiceTable1645179275947 implements MigrationInterface { name = 'AlterInvoiceTable1645179275947'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1645441629137-AddTimeTrackingFeatureToEmployeeTable.ts b/packages/core/src/database/migrations/1645441629137-AddTimeTrackingFeatureToEmployeeTable.ts index a46fe1af74f..0addaff0844 100644 --- a/packages/core/src/database/migrations/1645441629137-AddTimeTrackingFeatureToEmployeeTable.ts +++ b/packages/core/src/database/migrations/1645441629137-AddTimeTrackingFeatureToEmployeeTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddTimeTrackingFeatureToEmployeeTable1645441629137 implements MigrationInterface { name = 'AddTimeTrackingFeatureToEmployeeTable1645441629137'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1645726031706-AlterIntegrationTable.ts b/packages/core/src/database/migrations/1645726031706-AlterIntegrationTable.ts index b45e568ab29..0119f870bf0 100644 --- a/packages/core/src/database/migrations/1645726031706-AlterIntegrationTable.ts +++ b/packages/core/src/database/migrations/1645726031706-AlterIntegrationTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterIntegrationTable1645726031706 implements MigrationInterface { name = 'AlterIntegrationTable1645726031706'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1646056129050-AlterEmployeeRecurringExpenseTable.ts b/packages/core/src/database/migrations/1646056129050-AlterEmployeeRecurringExpenseTable.ts index 9fe69a5956c..735e46ee25e 100644 --- a/packages/core/src/database/migrations/1646056129050-AlterEmployeeRecurringExpenseTable.ts +++ b/packages/core/src/database/migrations/1646056129050-AlterEmployeeRecurringExpenseTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmployeeRecurringExpenseTable1646056129050 implements MigrationInterface { name = 'AlterEmployeeRecurringExpenseTable1646056129050'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1646117679347-AlterScreenshotTable.ts b/packages/core/src/database/migrations/1646117679347-AlterScreenshotTable.ts index 8c8c96e4dc0..2eb5c816f6f 100644 --- a/packages/core/src/database/migrations/1646117679347-AlterScreenshotTable.ts +++ b/packages/core/src/database/migrations/1646117679347-AlterScreenshotTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterScreenshotTable1646117679347 implements MigrationInterface { name = 'AlterScreenshotTable1646117679347'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1646206946845-AlterExpenseTable.ts b/packages/core/src/database/migrations/1646206946845-AlterExpenseTable.ts index 1e41ae74ee7..3853c5f3571 100644 --- a/packages/core/src/database/migrations/1646206946845-AlterExpenseTable.ts +++ b/packages/core/src/database/migrations/1646206946845-AlterExpenseTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterExpenseTable1646206946845 implements MigrationInterface { name = 'AlterExpenseTable1646206946845'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1647417832147-AlterActivityTable.ts b/packages/core/src/database/migrations/1647417832147-AlterActivityTable.ts index e3d12eb5241..25c782f4eec 100644 --- a/packages/core/src/database/migrations/1647417832147-AlterActivityTable.ts +++ b/packages/core/src/database/migrations/1647417832147-AlterActivityTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterActivityTable1647417832147 implements MigrationInterface { name = 'AlterActivityTable1647417832147'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1648899149818-AlterTenantTable.ts b/packages/core/src/database/migrations/1648899149818-AlterTenantTable.ts index e4888a25f51..7c7098aca71 100644 --- a/packages/core/src/database/migrations/1648899149818-AlterTenantTable.ts +++ b/packages/core/src/database/migrations/1648899149818-AlterTenantTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTenantTable1648899149818 implements MigrationInterface { name = 'AlterTenantTable1648899149818'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1650532321598-AlterOrganizationProject.ts b/packages/core/src/database/migrations/1650532321598-AlterOrganizationProject.ts index 61de3104c42..cc93384626c 100644 --- a/packages/core/src/database/migrations/1650532321598-AlterOrganizationProject.ts +++ b/packages/core/src/database/migrations/1650532321598-AlterOrganizationProject.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; import { seedProjectMembersCount } from "./../../organization-project/organization-project.seed"; export class AlterOrganizationProject1650532321598 implements MigrationInterface { @@ -6,6 +7,8 @@ export class AlterOrganizationProject1650532321598 implements MigrationInterface name = 'AlterOrganizationProject1650532321598'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -90,21 +93,21 @@ export class AlterOrganizationProject1650532321598 implements MigrationInterface // And such Seed method basically update qty of members per project when we create initial data in DB private async _calculateProjectMembersCount(queryRunner: QueryRunner) { - console.log('_calculateProjectMembersCount called'); + console.log('_calculateProjectMembersCount called'); /** * GET all tenants in the system */ - const tenants = await queryRunner.connection.manager.query(`SELECT * FROM tenant`); + const tenants = await queryRunner.connection.manager.query(`SELECT * FROM tenant`); - console.log(`found ${tenants.length} tenants in DB`); + console.log(`found ${tenants.length} tenants in DB`); - await seedProjectMembersCount( + await seedProjectMembersCount( queryRunner.connection, tenants - ); + ); - console.log('_calculateProjectMembersCount called'); + console.log('_calculateProjectMembersCount called'); } } diff --git a/packages/core/src/database/migrations/1650704972412-AlterChangelogTable.ts b/packages/core/src/database/migrations/1650704972412-AlterChangelogTable.ts index b4086f932b8..6c22dbbec8d 100644 --- a/packages/core/src/database/migrations/1650704972412-AlterChangelogTable.ts +++ b/packages/core/src/database/migrations/1650704972412-AlterChangelogTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterChangelogTable1650704972412 implements MigrationInterface { name = 'AlterChangelogTable1650704972412'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1652270907163-AlterTimeOffRequestTable.ts b/packages/core/src/database/migrations/1652270907163-AlterTimeOffRequestTable.ts index 3343d0a2889..e5b76f2663d 100644 --- a/packages/core/src/database/migrations/1652270907163-AlterTimeOffRequestTable.ts +++ b/packages/core/src/database/migrations/1652270907163-AlterTimeOffRequestTable.ts @@ -1,9 +1,12 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTimeOffRequestTable1652270907163 implements MigrationInterface { name = 'AlterTimeOffRequestTable1652270907163'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1652703299052-AlterTaskTableColumns.ts b/packages/core/src/database/migrations/1652703299052-AlterTaskTableColumns.ts index 0aee8568ca1..a5269c4f308 100644 --- a/packages/core/src/database/migrations/1652703299052-AlterTaskTableColumns.ts +++ b/packages/core/src/database/migrations/1652703299052-AlterTaskTableColumns.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTaskTableColumns1652703299052 implements MigrationInterface { name = 'AlterTaskTableColumns1652703299052'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1652936174625-ReportTableIconSeed.ts b/packages/core/src/database/migrations/1652936174625-ReportTableIconSeed.ts index 0b4b1240f48..7333041d64c 100644 --- a/packages/core/src/database/migrations/1652936174625-ReportTableIconSeed.ts +++ b/packages/core/src/database/migrations/1652936174625-ReportTableIconSeed.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class ReportTableIconSeed1652936174625 implements MigrationInterface { - name = 'ReportTableIconSeed1652936174625'; + name = 'ReportTableIconSeed1652936174625'; + + public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); - public async up(queryRunner: QueryRunner): Promise { const isSqlite = ['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type); if (isSqlite) { await queryRunner.connection.query(`UPDATE "report" SET "iconClass" = ? WHERE "slug" = ?`, ['far fa-clock', 'time-activity']); @@ -31,9 +34,9 @@ export class ReportTableIconSeed1652936174625 implements MigrationInterface { await queryRunner.connection.query(`UPDATE "report" SET "iconClass" = $1 WHERE "slug" = $2`, ['far fa-credit-card', 'project-budgets']); await queryRunner.connection.query(`UPDATE "report" SET "iconClass" = $1 WHERE "slug" = $2`, ['far fa-credit-card', 'client-budgets']); } - } + } - public async down(queryRunner: QueryRunner): Promise { + public async down(queryRunner: QueryRunner): Promise { const isSqlite = ['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type); if (isSqlite) { await queryRunner.connection.query(`UPDATE "report" SET "iconClass" = ? WHERE "slug" = ?`, ['clock-outline', 'time-activity']); @@ -60,5 +63,5 @@ export class ReportTableIconSeed1652936174625 implements MigrationInterface { await queryRunner.connection.query(`UPDATE "report" SET "iconClass" = $1 WHERE "slug" = $2`, ['credit-card-outline', 'project-budgets']); await queryRunner.connection.query(`UPDATE "report" SET "iconClass" = $1 WHERE "slug" = $2`, ['credit-card-outline', 'client-budgets']); } - } + } } diff --git a/packages/core/src/database/migrations/1653482244724-AlterExpenseTable.ts b/packages/core/src/database/migrations/1653482244724-AlterExpenseTable.ts index 8b5c7977373..f81620e887b 100644 --- a/packages/core/src/database/migrations/1653482244724-AlterExpenseTable.ts +++ b/packages/core/src/database/migrations/1653482244724-AlterExpenseTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterExpenseTable1653482244724 implements MigrationInterface { name = 'AlterExpenseTable1653482244724'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -61,12 +64,12 @@ export class AlterExpenseTable1653482244724 implements MigrationInterface { * * @param queryRunner */ - public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise {} + public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise { } /** * SqliteDB Down Migration * * @param queryRunner */ - public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise {} + public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise { } } diff --git a/packages/core/src/database/migrations/1653742570167-AlterOrganizationContactTable.ts b/packages/core/src/database/migrations/1653742570167-AlterOrganizationContactTable.ts index ed69fd2e046..771b2c83105 100644 --- a/packages/core/src/database/migrations/1653742570167-AlterOrganizationContactTable.ts +++ b/packages/core/src/database/migrations/1653742570167-AlterOrganizationContactTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationContactTable1653742570167 implements MigrationInterface { name = 'AlterOrganizationContactTable1653742570167'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1654675304373-SeedChangeLogFeature.ts b/packages/core/src/database/migrations/1654675304373-SeedChangeLogFeature.ts index 2d1818b1e73..dd927c8032a 100644 --- a/packages/core/src/database/migrations/1654675304373-SeedChangeLogFeature.ts +++ b/packages/core/src/database/migrations/1654675304373-SeedChangeLogFeature.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; import { v4 as uuidV4 } from 'uuid'; export class SeedChangeLogFeature1654675304373 implements MigrationInterface { @@ -6,7 +7,9 @@ export class SeedChangeLogFeature1654675304373 implements MigrationInterface { name = 'SeedChangeLogFeature1654675304373'; public async up(queryRunner: QueryRunner): Promise { - const date = ['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type) ? Date.now() : new Date(); + console.log(chalk.yellow(this.name + ' start running!')); + + const date = ['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type) ? Date.now() : new Date(); const features = [ { icon: 'cube-outline', diff --git a/packages/core/src/database/migrations/1655885355508-OrganizationProjectAlterTable.ts b/packages/core/src/database/migrations/1655885355508-OrganizationProjectAlterTable.ts index f4ebc0e0206..65e3e9802fa 100644 --- a/packages/core/src/database/migrations/1655885355508-OrganizationProjectAlterTable.ts +++ b/packages/core/src/database/migrations/1655885355508-OrganizationProjectAlterTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class OrganizationProjectAlterTable1655885355508 implements MigrationInterface { name = 'OrganizationProjectAlterTable1655885355508'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1656833636109-AlterUserTable.ts b/packages/core/src/database/migrations/1656833636109-AlterUserTable.ts index 78a81817570..0f384cd0465 100644 --- a/packages/core/src/database/migrations/1656833636109-AlterUserTable.ts +++ b/packages/core/src/database/migrations/1656833636109-AlterUserTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterUserTable1656833636109 implements MigrationInterface { name = 'AlterUserTable1656833636109'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1659618978087-AlterInvoiceEstimateHistory.ts b/packages/core/src/database/migrations/1659618978087-AlterInvoiceEstimateHistory.ts index cfb0698d4a0..0d8c21634e1 100644 --- a/packages/core/src/database/migrations/1659618978087-AlterInvoiceEstimateHistory.ts +++ b/packages/core/src/database/migrations/1659618978087-AlterInvoiceEstimateHistory.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterInvoiceEstimateHistory1659618978087 implements MigrationInterface { name = 'AlterInvoiceEstimateHistory1659618978087'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1659684413063-AlterContactTable.ts b/packages/core/src/database/migrations/1659684413063-AlterContactTable.ts index 42743a85f01..4d2e8261412 100644 --- a/packages/core/src/database/migrations/1659684413063-AlterContactTable.ts +++ b/packages/core/src/database/migrations/1659684413063-AlterContactTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterContactTable1659684413063 implements MigrationInterface { name = 'AlterContactTable1659684413063'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1659696180759-AlterTenantTable.ts b/packages/core/src/database/migrations/1659696180759-AlterTenantTable.ts index b9ba7321ae0..00e2b7a1913 100644 --- a/packages/core/src/database/migrations/1659696180759-AlterTenantTable.ts +++ b/packages/core/src/database/migrations/1659696180759-AlterTenantTable.ts @@ -1,10 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTenantTable1659696180759 implements MigrationInterface { name = 'AlterTenantTable1659696180759'; public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -25,14 +28,14 @@ export class AlterTenantTable1659696180759 implements MigrationInterface { * * @param queryRunner */ - public async postgresUpQueryRunner(queryRunner: QueryRunner): Promise {} + public async postgresUpQueryRunner(queryRunner: QueryRunner): Promise { } /** * PostgresDB Down Migration * * @param queryRunner */ - public async postgresDownQueryRunner(queryRunner: QueryRunner): Promise {} + public async postgresDownQueryRunner(queryRunner: QueryRunner): Promise { } /** * SqliteDB Up Migration diff --git a/packages/core/src/database/migrations/1660988196279-AlterWarehouseProductTable.ts b/packages/core/src/database/migrations/1660988196279-AlterWarehouseProductTable.ts index 79c69965364..9f287d562af 100644 --- a/packages/core/src/database/migrations/1660988196279-AlterWarehouseProductTable.ts +++ b/packages/core/src/database/migrations/1660988196279-AlterWarehouseProductTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterWarehouseProductTable1660988196279 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterWarehouseProductTable1660988196279 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1661599336316-AlterWarehouseMerchant.ts b/packages/core/src/database/migrations/1661599336316-AlterWarehouseMerchant.ts index 06355e75439..32d3c6ee668 100644 --- a/packages/core/src/database/migrations/1661599336316-AlterWarehouseMerchant.ts +++ b/packages/core/src/database/migrations/1661599336316-AlterWarehouseMerchant.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterWarehouseMerchant1661599336316 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterWarehouseMerchant1661599336316 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1661853087396-AlterTimesheetTable.ts b/packages/core/src/database/migrations/1661853087396-AlterTimesheetTable.ts index 9fc858979dd..d83e0d902ad 100644 --- a/packages/core/src/database/migrations/1661853087396-AlterTimesheetTable.ts +++ b/packages/core/src/database/migrations/1661853087396-AlterTimesheetTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTimesheetTable1661853087396 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTimesheetTable1661853087396 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1662994539197-AlterInvoiceTable.ts b/packages/core/src/database/migrations/1662994539197-AlterInvoiceTable.ts index 79f96fc3f7b..c2fbdf5ff58 100644 --- a/packages/core/src/database/migrations/1662994539197-AlterInvoiceTable.ts +++ b/packages/core/src/database/migrations/1662994539197-AlterInvoiceTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterInvoiceTable1662994539197 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterInvoiceTable1662994539197 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1664869127437-AlterCandidateFeedbackTable.ts b/packages/core/src/database/migrations/1664869127437-AlterCandidateFeedbackTable.ts index 8d89b6ad28d..e94f193d0b5 100644 --- a/packages/core/src/database/migrations/1664869127437-AlterCandidateFeedbackTable.ts +++ b/packages/core/src/database/migrations/1664869127437-AlterCandidateFeedbackTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterCandidateFeedbackTable1664869127437 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterCandidateFeedbackTable1664869127437 implements MigrationInterf * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -58,12 +60,12 @@ export class AlterCandidateFeedbackTable1664869127437 implements MigrationInterf * * @param queryRunner */ - public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise {} + public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise { } /** * SqliteDB Down Migration * * @param queryRunner */ - public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise {} + public async sqliteDownQueryRunner(queryRunner: QueryRunner): Promise { } } diff --git a/packages/core/src/database/migrations/1665044607000-AlterCandidateInterviewTable.ts b/packages/core/src/database/migrations/1665044607000-AlterCandidateInterviewTable.ts index 9b30f411ec7..f82458fecdc 100644 --- a/packages/core/src/database/migrations/1665044607000-AlterCandidateInterviewTable.ts +++ b/packages/core/src/database/migrations/1665044607000-AlterCandidateInterviewTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterCandidateInterviewTable1665044607000 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterCandidateInterviewTable1665044607000 implements MigrationInter * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1665388204010-AlterWarehouseTable.ts b/packages/core/src/database/migrations/1665388204010-AlterWarehouseTable.ts index 458d1c7e1e0..fd6322cc0cc 100644 --- a/packages/core/src/database/migrations/1665388204010-AlterWarehouseTable.ts +++ b/packages/core/src/database/migrations/1665388204010-AlterWarehouseTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterWarehouseTable1665388204010 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterWarehouseTable1665388204010 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1665399395983-AlterOrganizationTable.ts b/packages/core/src/database/migrations/1665399395983-AlterOrganizationTable.ts index 1596755ae7d..df5ec9e3c46 100644 --- a/packages/core/src/database/migrations/1665399395983-AlterOrganizationTable.ts +++ b/packages/core/src/database/migrations/1665399395983-AlterOrganizationTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTable1665399395983 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTable1665399395983 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1665767813286-AltereInviteTable.ts b/packages/core/src/database/migrations/1665767813286-AltereInviteTable.ts index 5d973123799..55b983a0948 100644 --- a/packages/core/src/database/migrations/1665767813286-AltereInviteTable.ts +++ b/packages/core/src/database/migrations/1665767813286-AltereInviteTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AltereInviteTable1665767813286 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AltereInviteTable1665767813286 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1666007548644-AlterEmployeeTable.ts b/packages/core/src/database/migrations/1666007548644-AlterEmployeeTable.ts index a5f46134a96..851a536c11d 100644 --- a/packages/core/src/database/migrations/1666007548644-AlterEmployeeTable.ts +++ b/packages/core/src/database/migrations/1666007548644-AlterEmployeeTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmployeeTable1666007548644 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterEmployeeTable1666007548644 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1666181221327-AlterOrganizationTable.ts b/packages/core/src/database/migrations/1666181221327-AlterOrganizationTable.ts index 161df4c1e72..0a2abb102ae 100644 --- a/packages/core/src/database/migrations/1666181221327-AlterOrganizationTable.ts +++ b/packages/core/src/database/migrations/1666181221327-AlterOrganizationTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTable1666181221327 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTable1666181221327 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1666780716428-AlterEmployeeTable.ts b/packages/core/src/database/migrations/1666780716428-AlterEmployeeTable.ts index 45a6e55c0ca..565e4453cfa 100644 --- a/packages/core/src/database/migrations/1666780716428-AlterEmployeeTable.ts +++ b/packages/core/src/database/migrations/1666780716428-AlterEmployeeTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmployeeTable1666780716428 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterEmployeeTable1666780716428 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1668064327561-AlterOrganizationTable.ts b/packages/core/src/database/migrations/1668064327561-AlterOrganizationTable.ts index cc641c39406..20cfac01b94 100644 --- a/packages/core/src/database/migrations/1668064327561-AlterOrganizationTable.ts +++ b/packages/core/src/database/migrations/1668064327561-AlterOrganizationTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTable1668064327561 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTable1668064327561 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1668084518509-AlterEmployeeTableColumns.ts b/packages/core/src/database/migrations/1668084518509-AlterEmployeeTableColumns.ts index 20cb17ab3f6..5bf61daae56 100644 --- a/packages/core/src/database/migrations/1668084518509-AlterEmployeeTableColumns.ts +++ b/packages/core/src/database/migrations/1668084518509-AlterEmployeeTableColumns.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmployeeTableColumns1668084518509 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterEmployeeTableColumns1668084518509 implements MigrationInterfac * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1668256889786-AlterCustomSmtpTable.ts b/packages/core/src/database/migrations/1668256889786-AlterCustomSmtpTable.ts index d46d0cb7fc5..44b743b28c9 100644 --- a/packages/core/src/database/migrations/1668256889786-AlterCustomSmtpTable.ts +++ b/packages/core/src/database/migrations/1668256889786-AlterCustomSmtpTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterCustomSmtpTable1668256889786 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterCustomSmtpTable1668256889786 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1668446646237-AlterTableRelationCascading.ts b/packages/core/src/database/migrations/1668446646237-AlterTableRelationCascading.ts index 81dee5ec6ab..8344c225b05 100644 --- a/packages/core/src/database/migrations/1668446646237-AlterTableRelationCascading.ts +++ b/packages/core/src/database/migrations/1668446646237-AlterTableRelationCascading.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTableRelationCascading1668446646237 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTableRelationCascading1668446646237 implements MigrationInterf * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -72,7 +74,7 @@ export class AlterTableRelationCascading1668446646237 implements MigrationInterf * * @param queryRunner */ - public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise { + public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_760034f54e598d519b5f0c4ece"`); await queryRunner.query(`DROP INDEX "IDX_e699b50ca468e75bbd36913dcc"`); await queryRunner.query(`CREATE TABLE "temporary_skill_employee" ("skillId" varchar NOT NULL, "employeeId" varchar NOT NULL, PRIMARY KEY ("skillId", "employeeId"))`); diff --git a/packages/core/src/database/migrations/1668502997873-AlterUserTable.ts b/packages/core/src/database/migrations/1668502997873-AlterUserTable.ts index 6a8c2f8e75d..305139b9683 100644 --- a/packages/core/src/database/migrations/1668502997873-AlterUserTable.ts +++ b/packages/core/src/database/migrations/1668502997873-AlterUserTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterUserTable1668502997873 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterUserTable1668502997873 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1668504932478-AlterTableRelationCascading.ts b/packages/core/src/database/migrations/1668504932478-AlterTableRelationCascading.ts index fe8ae9de9f9..e4b4be975c5 100644 --- a/packages/core/src/database/migrations/1668504932478-AlterTableRelationCascading.ts +++ b/packages/core/src/database/migrations/1668504932478-AlterTableRelationCascading.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTableRelationCascading1668504932478 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTableRelationCascading1668504932478 implements MigrationInterf * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1669033406667-AlterUserTableEmailVerificationColumns.ts b/packages/core/src/database/migrations/1669033406667-AlterUserTableEmailVerificationColumns.ts index 1885755bee0..05ecda91105 100644 --- a/packages/core/src/database/migrations/1669033406667-AlterUserTableEmailVerificationColumns.ts +++ b/packages/core/src/database/migrations/1669033406667-AlterUserTableEmailVerificationColumns.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterUserTableEmailVerificationColumns1669033406667 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterUserTableEmailVerificationColumns1669033406667 implements Migr * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1669280426592-AlterInviteTable.ts b/packages/core/src/database/migrations/1669280426592-AlterInviteTable.ts index a33b70906c7..612da9310f1 100644 --- a/packages/core/src/database/migrations/1669280426592-AlterInviteTable.ts +++ b/packages/core/src/database/migrations/1669280426592-AlterInviteTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterInviteTable1669280426592 implements MigrationInterface { @@ -10,8 +10,10 @@ export class AlterInviteTable1669280426592 implements MigrationInterface { * * @param queryRunner */ - public async up(queryRunner: QueryRunner): Promise { - if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { + public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { await this.postgresUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1669453028914-AlterUserInviteTable.ts b/packages/core/src/database/migrations/1669453028914-AlterUserInviteTable.ts index 3747f255539..54c254d7eb7 100644 --- a/packages/core/src/database/migrations/1669453028914-AlterUserInviteTable.ts +++ b/packages/core/src/database/migrations/1669453028914-AlterUserInviteTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterUserInviteTable1669453028914 implements MigrationInterface { @@ -10,8 +10,10 @@ export class AlterUserInviteTable1669453028914 implements MigrationInterface { * * @param queryRunner */ - public async up(queryRunner: QueryRunner): Promise { - if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { + public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { await this.postgresUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1670313962263-AlterOrganizationTeamTable.ts b/packages/core/src/database/migrations/1670313962263-AlterOrganizationTeamTable.ts index a0a2a66f0c2..e4c53939fbe 100644 --- a/packages/core/src/database/migrations/1670313962263-AlterOrganizationTeamTable.ts +++ b/packages/core/src/database/migrations/1670313962263-AlterOrganizationTeamTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTeamTable1670313962263 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTeamTable1670313962263 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1671107860058-AlterInviteAllowedOrganizationTable.ts b/packages/core/src/database/migrations/1671107860058-AlterInviteAllowedOrganizationTable.ts index c2a75400495..563ce0949a1 100644 --- a/packages/core/src/database/migrations/1671107860058-AlterInviteAllowedOrganizationTable.ts +++ b/packages/core/src/database/migrations/1671107860058-AlterInviteAllowedOrganizationTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterInviteAllowedOrganizationTable1671107860058 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterInviteAllowedOrganizationTable1671107860058 implements Migrati * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1671706727549-AlterOrganizationTeamTable.ts b/packages/core/src/database/migrations/1671706727549-AlterOrganizationTeamTable.ts index 6b6d051c36e..801aabaf8f7 100644 --- a/packages/core/src/database/migrations/1671706727549-AlterOrganizationTeamTable.ts +++ b/packages/core/src/database/migrations/1671706727549-AlterOrganizationTeamTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTeamTable1671706727549 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTeamTable1671706727549 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1672211594766-AlterCandidateTable.ts b/packages/core/src/database/migrations/1672211594766-AlterCandidateTable.ts index 67ce8269da8..0f0269a8312 100644 --- a/packages/core/src/database/migrations/1672211594766-AlterCandidateTable.ts +++ b/packages/core/src/database/migrations/1672211594766-AlterCandidateTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterCandidateTable1672211594766 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterCandidateTable1672211594766 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1673005639130-AlterTimeLogTable.ts b/packages/core/src/database/migrations/1673005639130-AlterTimeLogTable.ts index 43bbcf8741f..5cd1268d4af 100644 --- a/packages/core/src/database/migrations/1673005639130-AlterTimeLogTable.ts +++ b/packages/core/src/database/migrations/1673005639130-AlterTimeLogTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTimeLogTable1673005639130 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTimeLogTable1673005639130 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1673423542165-AlterTaskTable.ts b/packages/core/src/database/migrations/1673423542165-AlterTaskTable.ts index 9f04d53f641..042d384061c 100644 --- a/packages/core/src/database/migrations/1673423542165-AlterTaskTable.ts +++ b/packages/core/src/database/migrations/1673423542165-AlterTaskTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTaskTable1673423542165 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTaskTable1673423542165 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1673589923548-CreateStatusTable.ts b/packages/core/src/database/migrations/1673589923548-CreateStatusTable.ts index 67b58301692..5ad701a56f5 100644 --- a/packages/core/src/database/migrations/1673589923548-CreateStatusTable.ts +++ b/packages/core/src/database/migrations/1673589923548-CreateStatusTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class CreateStatusTable1673589923548 implements MigrationInterface { name = 'CreateStatusTable1673589923548'; @@ -9,6 +10,8 @@ export class CreateStatusTable1673589923548 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1673946248066-AlterTaskTable.ts b/packages/core/src/database/migrations/1673946248066-AlterTaskTable.ts index f29d2c84a60..cf13188cbb0 100644 --- a/packages/core/src/database/migrations/1673946248066-AlterTaskTable.ts +++ b/packages/core/src/database/migrations/1673946248066-AlterTaskTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTaskTable1673946248066 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTaskTable1673946248066 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1674044473393-SeedDefaultGlobalTaskStatus.ts b/packages/core/src/database/migrations/1674044473393-SeedDefaultGlobalTaskStatus.ts index 8e901d0d3e3..4c1306ce52d 100644 --- a/packages/core/src/database/migrations/1674044473393-SeedDefaultGlobalTaskStatus.ts +++ b/packages/core/src/database/migrations/1674044473393-SeedDefaultGlobalTaskStatus.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; import { v4 as uuidV4 } from 'uuid'; import { DEFAULT_GLOBAL_STATUSES } from "./../../tasks/statuses/default-global-statuses"; @@ -13,6 +13,8 @@ export class SeedDefaultGlobalTaskStatus1674044473393 implements MigrationInterf * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + try { for await (const status of DEFAULT_GLOBAL_STATUSES) { const payload = Object.values(status); @@ -36,5 +38,5 @@ export class SeedDefaultGlobalTaskStatus1674044473393 implements MigrationInterf * * @param queryRunner */ - public async down(queryRunner: QueryRunner): Promise {} + public async down(queryRunner: QueryRunner): Promise { } } diff --git a/packages/core/src/database/migrations/1674109138954-AlterEmailSentTable.ts b/packages/core/src/database/migrations/1674109138954-AlterEmailSentTable.ts index 1cd078988be..5a5a4eecabf 100644 --- a/packages/core/src/database/migrations/1674109138954-AlterEmailSentTable.ts +++ b/packages/core/src/database/migrations/1674109138954-AlterEmailSentTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmailSentTable1674109138954 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterEmailSentTable1674109138954 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1674535367176-CreateTaskPriorityTable.ts b/packages/core/src/database/migrations/1674535367176-CreateTaskPriorityTable.ts index 7f459e0664c..88baee671ca 100644 --- a/packages/core/src/database/migrations/1674535367176-CreateTaskPriorityTable.ts +++ b/packages/core/src/database/migrations/1674535367176-CreateTaskPriorityTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class CreateTaskPriorityTable1674535367176 implements MigrationInterface { @@ -11,6 +11,8 @@ export class CreateTaskPriorityTable1674535367176 implements MigrationInterface * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1674538040466-CreateTaskSizeTable.ts b/packages/core/src/database/migrations/1674538040466-CreateTaskSizeTable.ts index 44842f206c4..ea5e80a7e26 100644 --- a/packages/core/src/database/migrations/1674538040466-CreateTaskSizeTable.ts +++ b/packages/core/src/database/migrations/1674538040466-CreateTaskSizeTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class CreateTaskSizeTable1674538040466 implements MigrationInterface { @@ -11,6 +11,8 @@ export class CreateTaskSizeTable1674538040466 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1674638501088-SeedDefaultGlobalTaskPriorityAndSize.ts b/packages/core/src/database/migrations/1674638501088-SeedDefaultGlobalTaskPriorityAndSize.ts index 1cfb0475e90..efaf084326e 100644 --- a/packages/core/src/database/migrations/1674638501088-SeedDefaultGlobalTaskPriorityAndSize.ts +++ b/packages/core/src/database/migrations/1674638501088-SeedDefaultGlobalTaskPriorityAndSize.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; import { v4 as uuidV4 } from 'uuid'; import { DEFAULT_GLOBAL_PRIORITIES } from "./../../tasks/priorities/default-global-priorities"; import { DEFAULT_GLOBAL_SIZES } from "./../../tasks/sizes/default-global-sizes"; @@ -14,6 +14,8 @@ export class SeedDefaultGlobalTaskPriorityAndSize1674638501088 implements Migrat * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + await this.seedDefaultTaskPriorities(queryRunner); await this.seedDefaultTaskSizes(queryRunner); } @@ -23,7 +25,7 @@ export class SeedDefaultGlobalTaskPriorityAndSize1674638501088 implements Migrat * * @param queryRunner */ - public async down(queryRunner: QueryRunner): Promise {} + public async down(queryRunner: QueryRunner): Promise { } /** * Default global task priorities diff --git a/packages/core/src/database/migrations/1674749291896-RenamedTaskStatusTable.ts b/packages/core/src/database/migrations/1674749291896-RenamedTaskStatusTable.ts index 2bfab6739cb..e6101bd7d14 100644 --- a/packages/core/src/database/migrations/1674749291896-RenamedTaskStatusTable.ts +++ b/packages/core/src/database/migrations/1674749291896-RenamedTaskStatusTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class RenamedTaskStatusTable1674749291896 implements MigrationInterface { @@ -11,6 +11,8 @@ export class RenamedTaskStatusTable1674749291896 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + await queryRunner.query(`ALTER TABLE "status" RENAME TO "task_status"`); } diff --git a/packages/core/src/database/migrations/1675186090641-AlterTaskStatusTable.ts b/packages/core/src/database/migrations/1675186090641-AlterTaskStatusTable.ts index 03b5fe29254..49632903748 100644 --- a/packages/core/src/database/migrations/1675186090641-AlterTaskStatusTable.ts +++ b/packages/core/src/database/migrations/1675186090641-AlterTaskStatusTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTaskStatusTable1675186090641 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTaskStatusTable1675186090641 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1675240711524-CreateEmployeePhoneTable.ts b/packages/core/src/database/migrations/1675240711524-CreateEmployeePhoneTable.ts index da29021d053..3d90836814f 100644 --- a/packages/core/src/database/migrations/1675240711524-CreateEmployeePhoneTable.ts +++ b/packages/core/src/database/migrations/1675240711524-CreateEmployeePhoneTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class CreateEmployeePhoneTable1675240711524 implements MigrationInterface { name = 'CreateEmployeePhoneTable1675240711524'; @@ -9,6 +10,8 @@ export class CreateEmployeePhoneTable1675240711524 implements MigrationInterface * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1675241589518-AlterUserTable.ts b/packages/core/src/database/migrations/1675241589518-AlterUserTable.ts index ab701043850..f3e04c1d39f 100644 --- a/packages/core/src/database/migrations/1675241589518-AlterUserTable.ts +++ b/packages/core/src/database/migrations/1675241589518-AlterUserTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class AlterUserTable1675241589518 implements MigrationInterface { name = 'AlterUserTable1675241589518'; @@ -9,6 +10,8 @@ export class AlterUserTable1675241589518 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1675410785835-AlterTaskTable.ts b/packages/core/src/database/migrations/1675410785835-AlterTaskTable.ts index 684217e8cc8..6d2189a822e 100644 --- a/packages/core/src/database/migrations/1675410785835-AlterTaskTable.ts +++ b/packages/core/src/database/migrations/1675410785835-AlterTaskTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTaskTable1675410785835 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTaskTable1675410785835 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1675687502784-AddTimeZoneColumnToUserTable.ts b/packages/core/src/database/migrations/1675687502784-AddTimeZoneColumnToUserTable.ts index a47d9a50f4f..5bed53fbbe4 100644 --- a/packages/core/src/database/migrations/1675687502784-AddTimeZoneColumnToUserTable.ts +++ b/packages/core/src/database/migrations/1675687502784-AddTimeZoneColumnToUserTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddTimeZoneColumnToUserTable1675687502784 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddTimeZoneColumnToUserTable1675687502784 implements MigrationInter * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1676351186923-AlterOrganizationTeamTable.ts b/packages/core/src/database/migrations/1676351186923-AlterOrganizationTeamTable.ts index 65e9f518e0f..3c723b27574 100644 --- a/packages/core/src/database/migrations/1676351186923-AlterOrganizationTeamTable.ts +++ b/packages/core/src/database/migrations/1676351186923-AlterOrganizationTeamTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTeamTable1676351186923 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTeamTable1676351186923 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1676477607906-AddTimeTrackingColumnToOrganizationTeamEmployeeTable.ts b/packages/core/src/database/migrations/1676477607906-AddTimeTrackingColumnToOrganizationTeamEmployeeTable.ts index 90ccca59881..2d3eff79bcc 100644 --- a/packages/core/src/database/migrations/1676477607906-AddTimeTrackingColumnToOrganizationTeamEmployeeTable.ts +++ b/packages/core/src/database/migrations/1676477607906-AddTimeTrackingColumnToOrganizationTeamEmployeeTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddTimeTrackingColumnToOrganizationTeamEmployeeTable1676477607906 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddTimeTrackingColumnToOrganizationTeamEmployeeTable1676477607906 i * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1676630369336-AddLogoToOrganizationTeamTable.ts b/packages/core/src/database/migrations/1676630369336-AddLogoToOrganizationTeamTable.ts index ccb6c80db2f..c2974bdbd68 100644 --- a/packages/core/src/database/migrations/1676630369336-AddLogoToOrganizationTeamTable.ts +++ b/packages/core/src/database/migrations/1676630369336-AddLogoToOrganizationTeamTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddLogoToOrganizationTeamTable1676630369336 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddLogoToOrganizationTeamTable1676630369336 implements MigrationInt * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1676827319035-AlterEmployeeTable.ts b/packages/core/src/database/migrations/1676827319035-AlterEmployeeTable.ts index 1e0df6cbd52..30026c41e1e 100644 --- a/packages/core/src/database/migrations/1676827319035-AlterEmployeeTable.ts +++ b/packages/core/src/database/migrations/1676827319035-AlterEmployeeTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmployeeTable1676827319035 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterEmployeeTable1676827319035 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1676870424741-SeedTaskPriorityAndSizeAndStatusIcon.ts b/packages/core/src/database/migrations/1676870424741-SeedTaskPriorityAndSizeAndStatusIcon.ts index 34883581ceb..a3ddff31e55 100644 --- a/packages/core/src/database/migrations/1676870424741-SeedTaskPriorityAndSizeAndStatusIcon.ts +++ b/packages/core/src/database/migrations/1676870424741-SeedTaskPriorityAndSizeAndStatusIcon.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; import { getConfig } from "@gauzy/config"; import { copyAssets } from "./../../core/seeds/utils"; import { DEFAULT_GLOBAL_PRIORITIES } from "./../../tasks/priorities/default-global-priorities"; @@ -17,6 +17,8 @@ export class SeedTaskPriorityAndSizeAndStatusIcon1676870424741 implements Migrat * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + await this.seedTaskStatusIcon(queryRunner); await this.seedTaskPriorityIcon(queryRunner); await this.seedTaskSizeIcon(queryRunner); @@ -38,10 +40,10 @@ export class SeedTaskPriorityAndSizeAndStatusIcon1676870424741 implements Migrat for await (const status of DEFAULT_GLOBAL_STATUSES) { const { name, value, icon, color } = status; const filepath = `ever-icons/${icon}`; - let query = `UPDATE "task_status" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = $1 AND "value" = $2) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; - if(['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { - query = `UPDATE "task_status" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = ? AND "value" = ?) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; - } + let query = `UPDATE "task_status" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = $1 AND "value" = $2) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { + query = `UPDATE "task_status" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = ? AND "value" = ?) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; + } await queryRunner.connection.manager.query(query, [name, value]); copyAssets(status.icon, this.config); } @@ -60,10 +62,10 @@ export class SeedTaskPriorityAndSizeAndStatusIcon1676870424741 implements Migrat for await (const priority of DEFAULT_GLOBAL_PRIORITIES) { const { name, value, icon, color } = priority; const filepath = `ever-icons/${icon}`; - let query = `UPDATE "task_priority" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = $1 AND "value" = $2) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; - if(['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { - query = `UPDATE "task_priority" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = ? AND "value" = ?) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; - } + let query = `UPDATE "task_priority" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = $1 AND "value" = $2) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { + query = `UPDATE "task_priority" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = ? AND "value" = ?) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; + } await queryRunner.connection.manager.query(query, [name, value]); copyAssets(priority.icon, this.config); } @@ -82,10 +84,10 @@ export class SeedTaskPriorityAndSizeAndStatusIcon1676870424741 implements Migrat for await (const size of DEFAULT_GLOBAL_SIZES) { const { name, value, icon, color } = size; const filepath = `ever-icons/${icon}`; - let query = `UPDATE "task_size" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = $1 AND "value" = $2) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; - if(['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { - query = `UPDATE "task_size" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = ? AND "value" = ?) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; - } + let query = `UPDATE "task_size" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = $1 AND "value" = $2) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { + query = `UPDATE "task_size" SET "icon" = '${filepath}', "color" = '${color}' WHERE ("name" = ? AND "value" = ?) AND ("tenantId" IS NULL AND "organizationId" IS NULL)`; + } await queryRunner.connection.manager.query(query, [name, value]); copyAssets(size.icon, this.config); } diff --git a/packages/core/src/database/migrations/1676978573552-AlterOrganizationTable.ts b/packages/core/src/database/migrations/1676978573552-AlterOrganizationTable.ts index 3924b61f0d3..68f77ee1d0d 100644 --- a/packages/core/src/database/migrations/1676978573552-AlterOrganizationTable.ts +++ b/packages/core/src/database/migrations/1676978573552-AlterOrganizationTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTable1676828580883 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTable1676828580883 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1677063195155-AlterOrganizationTeamTable.ts b/packages/core/src/database/migrations/1677063195155-AlterOrganizationTeamTable.ts index 23e78aca41a..e45b8a12894 100644 --- a/packages/core/src/database/migrations/1677063195155-AlterOrganizationTeamTable.ts +++ b/packages/core/src/database/migrations/1677063195155-AlterOrganizationTeamTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTeamTable1677063195155 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTeamTable1677063195155 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1677142065591-AlterTagTable.ts b/packages/core/src/database/migrations/1677142065591-AlterTagTable.ts index 1f385dd25f3..69e72a91e00 100644 --- a/packages/core/src/database/migrations/1677142065591-AlterTagTable.ts +++ b/packages/core/src/database/migrations/1677142065591-AlterTagTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTagTable1677142065591 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTagTable1677142065591 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1677156446733-AlterTaskTable.ts b/packages/core/src/database/migrations/1677156446733-AlterTaskTable.ts index 4e276a35a81..ae63ddc59fa 100644 --- a/packages/core/src/database/migrations/1677156446733-AlterTaskTable.ts +++ b/packages/core/src/database/migrations/1677156446733-AlterTaskTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTaskTable1677156446733 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTaskTable1677156446733 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1677313663312-AlterEmployeeTable.ts b/packages/core/src/database/migrations/1677313663312-AlterEmployeeTable.ts index 1efa8e45eb9..698d2a1ac5a 100644 --- a/packages/core/src/database/migrations/1677313663312-AlterEmployeeTable.ts +++ b/packages/core/src/database/migrations/1677313663312-AlterEmployeeTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmployeeTable1677313663312 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterEmployeeTable1677313663312 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1677508195152-AlterScreenshotTable.ts b/packages/core/src/database/migrations/1677508195152-AlterScreenshotTable.ts index 87784ff768f..dcc97762dcb 100644 --- a/packages/core/src/database/migrations/1677508195152-AlterScreenshotTable.ts +++ b/packages/core/src/database/migrations/1677508195152-AlterScreenshotTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterScreenshotTable1677508195152 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterScreenshotTable1677508195152 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1678187685289-CreateOrganizationTeamJoinRequestTable.ts b/packages/core/src/database/migrations/1678187685289-CreateOrganizationTeamJoinRequestTable.ts index 6b3a99dfcc2..5612936d642 100644 --- a/packages/core/src/database/migrations/1678187685289-CreateOrganizationTeamJoinRequestTable.ts +++ b/packages/core/src/database/migrations/1678187685289-CreateOrganizationTeamJoinRequestTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class CreateOrganizationTeamJoinRequestTable1678187685289 implements MigrationInterface { name = 'CreateOrganizationTeamJoinRequestTable1678187685289'; @@ -9,6 +10,8 @@ export class CreateOrganizationTeamJoinRequestTable1678187685289 implements Migr * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1678190791247-CreateEmailResetTable.ts b/packages/core/src/database/migrations/1678190791247-CreateEmailResetTable.ts index cb536e26438..98f157bcb2c 100644 --- a/packages/core/src/database/migrations/1678190791247-CreateEmailResetTable.ts +++ b/packages/core/src/database/migrations/1678190791247-CreateEmailResetTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class CreateEmailResetTable1678190791247 implements MigrationInterface { @@ -11,6 +11,8 @@ export class CreateEmailResetTable1678190791247 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1678436030249-AlterOrganizationTeamTable.ts b/packages/core/src/database/migrations/1678436030249-AlterOrganizationTeamTable.ts index cfba65adc22..34fda4efa29 100644 --- a/packages/core/src/database/migrations/1678436030249-AlterOrganizationTeamTable.ts +++ b/packages/core/src/database/migrations/1678436030249-AlterOrganizationTeamTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTeamTable1678436030249 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTeamTable1678436030249 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1678461100447-AlterEmailResetTable.ts b/packages/core/src/database/migrations/1678461100447-AlterEmailResetTable.ts index 19b0238aa18..3a7ff2e51d0 100644 --- a/packages/core/src/database/migrations/1678461100447-AlterEmailResetTable.ts +++ b/packages/core/src/database/migrations/1678461100447-AlterEmailResetTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmailResetTable1678461100447 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterEmailResetTable1678461100447 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1678876700413-EmailTemplateReader.ts b/packages/core/src/database/migrations/1678876700413-EmailTemplateReader.ts index a73b587ac81..6012adfc828 100644 --- a/packages/core/src/database/migrations/1678876700413-EmailTemplateReader.ts +++ b/packages/core/src/database/migrations/1678876700413-EmailTemplateReader.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; import { EmailTemplateEnum } from '@gauzy/contracts'; import { EmailTemplateUtils } from './../../email-template/utils'; @@ -13,6 +13,8 @@ export class EmailTemplateReader1678876700413 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + try { await EmailTemplateUtils.migrateEmailTemplates( queryRunner, diff --git a/packages/core/src/database/migrations/1679055440296-AlterTaskStatusTableTaskSizeTableTaskPriorityTable.ts b/packages/core/src/database/migrations/1679055440296-AlterTaskStatusTableTaskSizeTableTaskPriorityTable.ts index 9e113c4bae1..b0a064e1e34 100644 --- a/packages/core/src/database/migrations/1679055440296-AlterTaskStatusTableTaskSizeTableTaskPriorityTable.ts +++ b/packages/core/src/database/migrations/1679055440296-AlterTaskStatusTableTaskSizeTableTaskPriorityTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTaskStatusTableTaskSizeTableTaskPriorityTable1679055440296 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTaskStatusTableTaskSizeTableTaskPriorityTable1679055440296 imp * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1679119603264-AlterOrganizationTeamJoinRequestTable.ts b/packages/core/src/database/migrations/1679119603264-AlterOrganizationTeamJoinRequestTable.ts index 0d129fba1f0..4e1acaa3d6e 100644 --- a/packages/core/src/database/migrations/1679119603264-AlterOrganizationTeamJoinRequestTable.ts +++ b/packages/core/src/database/migrations/1679119603264-AlterOrganizationTeamJoinRequestTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTeamJoinRequestTable1679119603264 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTeamJoinRequestTable1679119603264 implements Migra * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1679308324164-AlterImageAssetTable.ts b/packages/core/src/database/migrations/1679308324164-AlterImageAssetTable.ts index 316c4c6070c..a94f84bbb10 100644 --- a/packages/core/src/database/migrations/1679308324164-AlterImageAssetTable.ts +++ b/packages/core/src/database/migrations/1679308324164-AlterImageAssetTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterImageAssetTable1679308324164 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterImageAssetTable1679308324164 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1679406665415-AddImageAssetColumnToTables.ts b/packages/core/src/database/migrations/1679406665415-AddImageAssetColumnToTables.ts index fe53b2e80b8..e2a8acfc655 100644 --- a/packages/core/src/database/migrations/1679406665415-AddImageAssetColumnToTables.ts +++ b/packages/core/src/database/migrations/1679406665415-AddImageAssetColumnToTables.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddImageAssetColumnToTables1679406665415 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddImageAssetColumnToTables1679406665415 implements MigrationInterf * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1679676292810-AddImageAssetColumnToTheOrganizationTable.ts b/packages/core/src/database/migrations/1679676292810-AddImageAssetColumnToTheOrganizationTable.ts index 5de65ba3377..1017eadb428 100644 --- a/packages/core/src/database/migrations/1679676292810-AddImageAssetColumnToTheOrganizationTable.ts +++ b/packages/core/src/database/migrations/1679676292810-AddImageAssetColumnToTheOrganizationTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddImageAssetColumnToTheOrganizationTable1679676292810 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddImageAssetColumnToTheOrganizationTable1679676292810 implements M * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1679724221071-AddImageAssetColumnToTheProductCategoryTable.ts b/packages/core/src/database/migrations/1679724221071-AddImageAssetColumnToTheProductCategoryTable.ts index a081d93539a..c294923daf4 100644 --- a/packages/core/src/database/migrations/1679724221071-AddImageAssetColumnToTheProductCategoryTable.ts +++ b/packages/core/src/database/migrations/1679724221071-AddImageAssetColumnToTheProductCategoryTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddImageAssetColumnToTheProductCategoryTable1679724221071 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddImageAssetColumnToTheProductCategoryTable1679724221071 implement * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1679765443208-MigrateRolePermisisons.ts b/packages/core/src/database/migrations/1679765443208-MigrateRolePermisisons.ts index c925b6fafa2..e3b3c5fbaed 100644 --- a/packages/core/src/database/migrations/1679765443208-MigrateRolePermisisons.ts +++ b/packages/core/src/database/migrations/1679765443208-MigrateRolePermisisons.ts @@ -1,5 +1,6 @@ -import { RolePermissionUtils } from './../../role-permission/utils'; import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; +import { RolePermissionUtils } from './../../role-permission/utils'; export class MigrateRolePermisisons1679765443208 implements MigrationInterface { name = 'MigrateRolePermisisons1679765443208'; @@ -10,6 +11,8 @@ export class MigrateRolePermisisons1679765443208 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + try { await RolePermissionUtils.migrateRolePermissions(queryRunner); } catch (error) { @@ -22,5 +25,5 @@ export class MigrateRolePermisisons1679765443208 implements MigrationInterface { * * @param queryRunner */ - public async down(queryRunner: QueryRunner): Promise {} + public async down(queryRunner: QueryRunner): Promise { } } diff --git a/packages/core/src/database/migrations/1680071714132-CreateIssueTypeTable.ts b/packages/core/src/database/migrations/1680071714132-CreateIssueTypeTable.ts index eac3e717d95..3a3163cd4d7 100644 --- a/packages/core/src/database/migrations/1680071714132-CreateIssueTypeTable.ts +++ b/packages/core/src/database/migrations/1680071714132-CreateIssueTypeTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class CreateIssueTypeTable1680071714132 implements MigrationInterface { @@ -11,6 +11,8 @@ export class CreateIssueTypeTable1680071714132 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680082411434-AddIssueTypeColumnToTheTaskTable.ts b/packages/core/src/database/migrations/1680082411434-AddIssueTypeColumnToTheTaskTable.ts index 23ed7ac16fa..e427ba5152d 100644 --- a/packages/core/src/database/migrations/1680082411434-AddIssueTypeColumnToTheTaskTable.ts +++ b/packages/core/src/database/migrations/1680082411434-AddIssueTypeColumnToTheTaskTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddIssueTypeColumnToTheTaskTable1680082411434 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddIssueTypeColumnToTheTaskTable1680082411434 implements MigrationI * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680108987586-AddIndexesColumnsToTheTimeSlotTable.ts b/packages/core/src/database/migrations/1680108987586-AddIndexesColumnsToTheTimeSlotTable.ts index 21e0e3073ba..ceef395d819 100644 --- a/packages/core/src/database/migrations/1680108987586-AddIndexesColumnsToTheTimeSlotTable.ts +++ b/packages/core/src/database/migrations/1680108987586-AddIndexesColumnsToTheTimeSlotTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddIndexesColumnsToTheTimeSlotTable1680108987586 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddIndexesColumnsToTheTimeSlotTable1680108987586 implements Migrati * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680110810109-AddIndexesColumnsToTheScreenshotTable.ts b/packages/core/src/database/migrations/1680110810109-AddIndexesColumnsToTheScreenshotTable.ts index 42b1978824f..920c5904cf2 100644 --- a/packages/core/src/database/migrations/1680110810109-AddIndexesColumnsToTheScreenshotTable.ts +++ b/packages/core/src/database/migrations/1680110810109-AddIndexesColumnsToTheScreenshotTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddIndexesColumnsToTheScreenshotTable1680110810109 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddIndexesColumnsToTheScreenshotTable1680110810109 implements Migra * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680154573492-AddIndexesColumnsToTheActivityTable.ts b/packages/core/src/database/migrations/1680154573492-AddIndexesColumnsToTheActivityTable.ts index 234fe73a2fc..72478887b34 100644 --- a/packages/core/src/database/migrations/1680154573492-AddIndexesColumnsToTheActivityTable.ts +++ b/packages/core/src/database/migrations/1680154573492-AddIndexesColumnsToTheActivityTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddIndexesColumnsToTheActivityTable1680154573492 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddIndexesColumnsToTheActivityTable1680154573492 implements Migrati * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680164421193-AddIndexesColumnsToTheTimesheetTable.ts b/packages/core/src/database/migrations/1680164421193-AddIndexesColumnsToTheTimesheetTable.ts index 49f58e5300d..df7aae18a7f 100644 --- a/packages/core/src/database/migrations/1680164421193-AddIndexesColumnsToTheTimesheetTable.ts +++ b/packages/core/src/database/migrations/1680164421193-AddIndexesColumnsToTheTimesheetTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddIndexesColumnsToTheTimesheetTable1680164421193 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddIndexesColumnsToTheTimesheetTable1680164421193 implements Migrat * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680172332764-AddIndexesColumnsToTheTimeLogTable.ts b/packages/core/src/database/migrations/1680172332764-AddIndexesColumnsToTheTimeLogTable.ts index 2ecb630367c..b285d7c942a 100644 --- a/packages/core/src/database/migrations/1680172332764-AddIndexesColumnsToTheTimeLogTable.ts +++ b/packages/core/src/database/migrations/1680172332764-AddIndexesColumnsToTheTimeLogTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class AddIndexesColumnsToTheTimeLogTable1680172332764 implements MigrationInterface { name = 'AddIndexesColumnsToTheTimeLogTable1680172332764'; @@ -9,6 +10,8 @@ export class AddIndexesColumnsToTheTimeLogTable1680172332764 implements Migratio * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680530165590-AlterJobSearchRelationalTables.ts b/packages/core/src/database/migrations/1680530165590-AlterJobSearchRelationalTables.ts index 26f8c1ec58d..b09618f1832 100644 --- a/packages/core/src/database/migrations/1680530165590-AlterJobSearchRelationalTables.ts +++ b/packages/core/src/database/migrations/1680530165590-AlterJobSearchRelationalTables.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterJobSearchRelationalTables1680530165590 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterJobSearchRelationalTables1680530165590 implements MigrationInt * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680539459969-UpdateEmailTemplates.ts b/packages/core/src/database/migrations/1680539459969-UpdateEmailTemplates.ts index 75173cea8f0..1f070619871 100644 --- a/packages/core/src/database/migrations/1680539459969-UpdateEmailTemplates.ts +++ b/packages/core/src/database/migrations/1680539459969-UpdateEmailTemplates.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; import { EmailTemplateEnum } from '@gauzy/contracts'; import { EmailTemplateUtils } from './../../email-template/utils'; @@ -13,6 +13,8 @@ export class UpdateEmailTemplates1680539459969 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + const templates = Object.values(EmailTemplateEnum); await Promise.all( templates.map( diff --git a/packages/core/src/database/migrations/1680622389221-SeedDafaultGlobalIssueType.ts b/packages/core/src/database/migrations/1680622389221-SeedDafaultGlobalIssueType.ts index 74f82019ad7..e0ce0a073ea 100644 --- a/packages/core/src/database/migrations/1680622389221-SeedDafaultGlobalIssueType.ts +++ b/packages/core/src/database/migrations/1680622389221-SeedDafaultGlobalIssueType.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; import { v4 as uuidv4 } from 'uuid'; import * as path from 'path'; import * as fs from 'fs'; @@ -19,6 +20,8 @@ export class SeedDafaultGlobalIssueType1680622389221 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + await this.seedDefaultIssueTypes(queryRunner); } diff --git a/packages/core/src/database/migrations/1680688280325-AddUpworkOrganizationIdToTheOrganizationTable.ts b/packages/core/src/database/migrations/1680688280325-AddUpworkOrganizationIdToTheOrganizationTable.ts index 15644143c3a..ae6575fa4df 100644 --- a/packages/core/src/database/migrations/1680688280325-AddUpworkOrganizationIdToTheOrganizationTable.ts +++ b/packages/core/src/database/migrations/1680688280325-AddUpworkOrganizationIdToTheOrganizationTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddUpworkOrganizationIdToTheOrganizationTable1680688280325 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddUpworkOrganizationIdToTheOrganizationTable1680688280325 implemen * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680692867660-AlterEmployeeTable.ts b/packages/core/src/database/migrations/1680692867660-AlterEmployeeTable.ts index ab374b9d996..000f4075e78 100644 --- a/packages/core/src/database/migrations/1680692867660-AlterEmployeeTable.ts +++ b/packages/core/src/database/migrations/1680692867660-AlterEmployeeTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterEmployeeTable1680692867660 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterEmployeeTable1680692867660 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680866279166-AddDocumentAssetColumnToTheOrganizationDocumentTable.ts b/packages/core/src/database/migrations/1680866279166-AddDocumentAssetColumnToTheOrganizationDocumentTable.ts index 46764826600..883433f19fa 100644 --- a/packages/core/src/database/migrations/1680866279166-AddDocumentAssetColumnToTheOrganizationDocumentTable.ts +++ b/packages/core/src/database/migrations/1680866279166-AddDocumentAssetColumnToTheOrganizationDocumentTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddDocumentAssetColumnToTheOrganizationDocumentTable1680866279166 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddDocumentAssetColumnToTheOrganizationDocumentTable1680866279166 i * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1680871419966-AddDocumentAssetColumnToTheTimeOffRequestTable.ts b/packages/core/src/database/migrations/1680871419966-AddDocumentAssetColumnToTheTimeOffRequestTable.ts index ed6ea27b611..ef598fd2eb1 100644 --- a/packages/core/src/database/migrations/1680871419966-AddDocumentAssetColumnToTheTimeOffRequestTable.ts +++ b/packages/core/src/database/migrations/1680871419966-AddDocumentAssetColumnToTheTimeOffRequestTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddDocumentAssetColumnToTheTimeOffRequestTable1680871419966 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddDocumentAssetColumnToTheTimeOffRequestTable1680871419966 impleme * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1681132031905-AddEmployeeStatusColumnsToTheEmployeeTable.ts b/packages/core/src/database/migrations/1681132031905-AddEmployeeStatusColumnsToTheEmployeeTable.ts index 36f50d3ff46..6255083614e 100644 --- a/packages/core/src/database/migrations/1681132031905-AddEmployeeStatusColumnsToTheEmployeeTable.ts +++ b/packages/core/src/database/migrations/1681132031905-AddEmployeeStatusColumnsToTheEmployeeTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddEmployeeStatusColumnsToTheEmployeeTable1681132031905 implements MigrationInterface { @@ -10,6 +11,8 @@ export class AddEmployeeStatusColumnsToTheEmployeeTable1681132031905 implements * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1681455351186-AddOrganizationTeamIdColumnToTheTimeLogTable.ts b/packages/core/src/database/migrations/1681455351186-AddOrganizationTeamIdColumnToTheTimeLogTable.ts index 552cff5af94..2614b8eef18 100644 --- a/packages/core/src/database/migrations/1681455351186-AddOrganizationTeamIdColumnToTheTimeLogTable.ts +++ b/packages/core/src/database/migrations/1681455351186-AddOrganizationTeamIdColumnToTheTimeLogTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddOrganizationTeamIdColumnToTheTimeLogTable1681455351186 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddOrganizationTeamIdColumnToTheTimeLogTable1681455351186 implement * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1686195290990-AlterOrganizationTeamTable.ts b/packages/core/src/database/migrations/1686195290990-AlterOrganizationTeamTable.ts index 00024302f2b..94adf4bbd8f 100644 --- a/packages/core/src/database/migrations/1686195290990-AlterOrganizationTeamTable.ts +++ b/packages/core/src/database/migrations/1686195290990-AlterOrganizationTeamTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class AlterOrganizationTeamTable1686195290990 implements MigrationInterface { name = 'AlterOrganizationTeamTable1686195290990'; @@ -9,6 +10,8 @@ export class AlterOrganizationTeamTable1686195290990 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1687967010243-AddMinimumBillingRateColumnToEmployeeTable.ts b/packages/core/src/database/migrations/1687967010243-AddMinimumBillingRateColumnToEmployeeTable.ts index 8bbcd1eb663..f87b1e7dc0d 100644 --- a/packages/core/src/database/migrations/1687967010243-AddMinimumBillingRateColumnToEmployeeTable.ts +++ b/packages/core/src/database/migrations/1687967010243-AddMinimumBillingRateColumnToEmployeeTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class AddMinimumBillingRateColumnToEmployeeTable1687967010243 implements MigrationInterface { name = 'AddMinimumBillingRateColumnToEmployeeTable1687967010243'; @@ -9,6 +10,8 @@ export class AddMinimumBillingRateColumnToEmployeeTable1687967010243 implements * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1687967919076-AddMinimumBillingRateColumnToCandidateTable.ts b/packages/core/src/database/migrations/1687967919076-AddMinimumBillingRateColumnToCandidateTable.ts index 401b71d46f6..5cb7bc4aaba 100644 --- a/packages/core/src/database/migrations/1687967919076-AddMinimumBillingRateColumnToCandidateTable.ts +++ b/packages/core/src/database/migrations/1687967919076-AddMinimumBillingRateColumnToCandidateTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddMinimumBillingRateColumnToCandidateTable1687967919076 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddMinimumBillingRateColumnToCandidateTable1687967919076 implements * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1687974863736-CreateTaskVersionTable.ts b/packages/core/src/database/migrations/1687974863736-CreateTaskVersionTable.ts index 3b40219b27a..31a5a1d738d 100644 --- a/packages/core/src/database/migrations/1687974863736-CreateTaskVersionTable.ts +++ b/packages/core/src/database/migrations/1687974863736-CreateTaskVersionTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class CreateTaskVersionTable1687974863736 implements MigrationInterface { name = 'CreateTaskVersionTable1687974863736'; @@ -9,6 +10,8 @@ export class CreateTaskVersionTable1687974863736 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1688122296981-AlterTableEmployee.ts b/packages/core/src/database/migrations/1688122296981-AlterTableEmployee.ts index 7111d4f8205..97b39f486b5 100644 --- a/packages/core/src/database/migrations/1688122296981-AlterTableEmployee.ts +++ b/packages/core/src/database/migrations/1688122296981-AlterTableEmployee.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterTableEmployee1688122296981 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterTableEmployee1688122296981 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1688168798377-CreateRelatedIssueTypeTable.ts b/packages/core/src/database/migrations/1688168798377-CreateRelatedIssueTypeTable.ts index 3f2fba0efa6..84d203b2079 100644 --- a/packages/core/src/database/migrations/1688168798377-CreateRelatedIssueTypeTable.ts +++ b/packages/core/src/database/migrations/1688168798377-CreateRelatedIssueTypeTable.ts @@ -1,8 +1,8 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; + +export class CreateRelatedIssueTypeTable1688168798377 implements MigrationInterface { -export class CreateRelatedIssueTypeTable1688168798377 - implements MigrationInterface -{ name = 'CreateRelatedIssueTypeTable1688168798377'; /** @@ -11,6 +11,8 @@ export class CreateRelatedIssueTypeTable1688168798377 * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1688886388219-AddParentIdColumnToTaskTable.ts b/packages/core/src/database/migrations/1688886388219-AddParentIdColumnToTaskTable.ts index bd3da2a89c4..3e60bc308c1 100644 --- a/packages/core/src/database/migrations/1688886388219-AddParentIdColumnToTaskTable.ts +++ b/packages/core/src/database/migrations/1688886388219-AddParentIdColumnToTaskTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddParentIdColumnToTaskTable1688886388219 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddParentIdColumnToTaskTable1688886388219 implements MigrationInter * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1688966032457-AddRelatedIssueRelationToTaskTable.ts b/packages/core/src/database/migrations/1688966032457-AddRelatedIssueRelationToTaskTable.ts index 1c9c4ff1372..e6af026329a 100644 --- a/packages/core/src/database/migrations/1688966032457-AddRelatedIssueRelationToTaskTable.ts +++ b/packages/core/src/database/migrations/1688966032457-AddRelatedIssueRelationToTaskTable.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class AddRelatedIssueRelationToTaskTable1688966032457 implements MigrationInterface { name = 'AddRelatedIssueRelationToTaskTable1688966032457'; @@ -9,6 +10,8 @@ export class AddRelatedIssueRelationToTaskTable1688966032457 implements Migratio * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1689150247379-CreateTaskLinkedIssueTable.ts b/packages/core/src/database/migrations/1689150247379-CreateTaskLinkedIssueTable.ts index b39e0150e92..bd7c19a6487 100644 --- a/packages/core/src/database/migrations/1689150247379-CreateTaskLinkedIssueTable.ts +++ b/packages/core/src/database/migrations/1689150247379-CreateTaskLinkedIssueTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class CreateTaskLinkedIssueTable1689150247379 implements MigrationInterface { @@ -11,6 +11,8 @@ export class CreateTaskLinkedIssueTable1689150247379 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1689181881441-CreateOrganizationTaskSettingTable.ts b/packages/core/src/database/migrations/1689181881441-CreateOrganizationTaskSettingTable.ts index b600e5e81f3..0d02fcbcf6b 100644 --- a/packages/core/src/database/migrations/1689181881441-CreateOrganizationTaskSettingTable.ts +++ b/packages/core/src/database/migrations/1689181881441-CreateOrganizationTaskSettingTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class CreateOrganizationTaskSettingTable1689181881441 implements MigrationInterface { @@ -11,6 +11,8 @@ export class CreateOrganizationTaskSettingTable1689181881441 implements Migratio * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1689611487195-DropTaskRelatedIssuesTable.ts b/packages/core/src/database/migrations/1689611487195-DropTaskRelatedIssuesTable.ts index d616a34c67d..5bb1e67cb6b 100644 --- a/packages/core/src/database/migrations/1689611487195-DropTaskRelatedIssuesTable.ts +++ b/packages/core/src/database/migrations/1689611487195-DropTaskRelatedIssuesTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class DropTaskRelatedIssuesTable1689611487195 implements MigrationInterface { @@ -11,6 +11,8 @@ export class DropTaskRelatedIssuesTable1689611487195 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { @@ -38,10 +40,10 @@ export class DropTaskRelatedIssuesTable1689611487195 implements MigrationInterfa */ public async postgresUpQueryRunner(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "task_related_issues" DROP CONSTRAINT "FK_425ec34e019f63336fe8d2940ce"`); - await queryRunner.query(`ALTER TABLE "task_related_issues" DROP CONSTRAINT "FK_c93e2e6d5d0e3a1d7af2725f9fc"`); - await queryRunner.query(`DROP INDEX "public"."IDX_425ec34e019f63336fe8d2940c"`); - await queryRunner.query(`DROP INDEX "public"."IDX_c93e2e6d5d0e3a1d7af2725f9f"`); - await queryRunner.query(`DROP TABLE "task_related_issues"`); + await queryRunner.query(`ALTER TABLE "task_related_issues" DROP CONSTRAINT "FK_c93e2e6d5d0e3a1d7af2725f9fc"`); + await queryRunner.query(`DROP INDEX "public"."IDX_425ec34e019f63336fe8d2940c"`); + await queryRunner.query(`DROP INDEX "public"."IDX_c93e2e6d5d0e3a1d7af2725f9f"`); + await queryRunner.query(`DROP TABLE "task_related_issues"`); } /** @@ -60,16 +62,16 @@ export class DropTaskRelatedIssuesTable1689611487195 implements MigrationInterfa */ public async sqliteUpQueryRunner(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX "IDX_425ec34e019f63336fe8d2940c"`); - await queryRunner.query(`DROP INDEX "IDX_c93e2e6d5d0e3a1d7af2725f9f"`); - await queryRunner.query(`ALTER TABLE "task_related_issues" RENAME TO "temporary_task_related_issues"`); - await queryRunner.query(`CREATE TABLE "task_related_issues" ("taskId_1" varchar NOT NULL, "taskId_2" varchar NOT NULL, PRIMARY KEY ("taskId_1", "taskId_2"))`); - await queryRunner.query(`INSERT INTO "task_related_issues"("taskId_1", "taskId_2") SELECT "taskId_1", "taskId_2" FROM "temporary_task_related_issues"`); - await queryRunner.query(`DROP TABLE "temporary_task_related_issues"`); - await queryRunner.query(`CREATE INDEX "IDX_425ec34e019f63336fe8d2940c" ON "task_related_issues" ("taskId_2")`); - await queryRunner.query(`CREATE INDEX "IDX_c93e2e6d5d0e3a1d7af2725f9f" ON "task_related_issues" ("taskId_1")`); - await queryRunner.query(`DROP INDEX "IDX_425ec34e019f63336fe8d2940c"`); - await queryRunner.query(`DROP INDEX "IDX_c93e2e6d5d0e3a1d7af2725f9f"`); - await queryRunner.query(`DROP TABLE "task_related_issues"`); + await queryRunner.query(`DROP INDEX "IDX_c93e2e6d5d0e3a1d7af2725f9f"`); + await queryRunner.query(`ALTER TABLE "task_related_issues" RENAME TO "temporary_task_related_issues"`); + await queryRunner.query(`CREATE TABLE "task_related_issues" ("taskId_1" varchar NOT NULL, "taskId_2" varchar NOT NULL, PRIMARY KEY ("taskId_1", "taskId_2"))`); + await queryRunner.query(`INSERT INTO "task_related_issues"("taskId_1", "taskId_2") SELECT "taskId_1", "taskId_2" FROM "temporary_task_related_issues"`); + await queryRunner.query(`DROP TABLE "temporary_task_related_issues"`); + await queryRunner.query(`CREATE INDEX "IDX_425ec34e019f63336fe8d2940c" ON "task_related_issues" ("taskId_2")`); + await queryRunner.query(`CREATE INDEX "IDX_c93e2e6d5d0e3a1d7af2725f9f" ON "task_related_issues" ("taskId_1")`); + await queryRunner.query(`DROP INDEX "IDX_425ec34e019f63336fe8d2940c"`); + await queryRunner.query(`DROP INDEX "IDX_c93e2e6d5d0e3a1d7af2725f9f"`); + await queryRunner.query(`DROP TABLE "task_related_issues"`); } /** diff --git a/packages/core/src/database/migrations/1689670799675-CreateTaskEstimationTable.ts b/packages/core/src/database/migrations/1689670799675-CreateTaskEstimationTable.ts index 8becb60f917..13fdc14e836 100644 --- a/packages/core/src/database/migrations/1689670799675-CreateTaskEstimationTable.ts +++ b/packages/core/src/database/migrations/1689670799675-CreateTaskEstimationTable.ts @@ -1,8 +1,8 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; + +export class CreateTaskEstimationTable1689670799675 implements MigrationInterface { -export class CreateTaskEstimationTable1689670799675 - implements MigrationInterface -{ name = 'CreateTaskEstimationTable1689670799675'; /** @@ -11,6 +11,8 @@ export class CreateTaskEstimationTable1689670799675 * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1690040638765-AlterReportTable.ts b/packages/core/src/database/migrations/1690040638765-AlterReportTable.ts index 84ec429ba70..db7a895d4e3 100644 --- a/packages/core/src/database/migrations/1690040638765-AlterReportTable.ts +++ b/packages/core/src/database/migrations/1690040638765-AlterReportTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterReportTable1690040638765 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterReportTable1690040638765 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1690167501143-AddActiveTaskColumnToOrganizationTeamEmployee.ts b/packages/core/src/database/migrations/1690167501143-AddActiveTaskColumnToOrganizationTeamEmployee.ts index f704f302695..921bcf2e0d3 100644 --- a/packages/core/src/database/migrations/1690167501143-AddActiveTaskColumnToOrganizationTeamEmployee.ts +++ b/packages/core/src/database/migrations/1690167501143-AddActiveTaskColumnToOrganizationTeamEmployee.ts @@ -1,8 +1,8 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class AddActiveTaskColumnToOrganizationTeamEmployee1690167501143 - implements MigrationInterface -{ + implements MigrationInterface { name = 'AddActiveTaskColumnToOrganizationTeamEmployee1690167501143'; /** @@ -11,6 +11,8 @@ export class AddActiveTaskColumnToOrganizationTeamEmployee1690167501143 * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1690527506095-AddUpworkOrganizationNameToTheOrganizationTable.ts b/packages/core/src/database/migrations/1690527506095-AddUpworkOrganizationNameToTheOrganizationTable.ts index 5776077e30a..6dcae7607fe 100644 --- a/packages/core/src/database/migrations/1690527506095-AddUpworkOrganizationNameToTheOrganizationTable.ts +++ b/packages/core/src/database/migrations/1690527506095-AddUpworkOrganizationNameToTheOrganizationTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddUpworkOrganizationNameToTheOrganizationTable1690527506095 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddUpworkOrganizationNameToTheOrganizationTable1690527506095 implem * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1691493358068-AlterIntegrationTable.ts b/packages/core/src/database/migrations/1691493358068-AlterIntegrationTable.ts index 144806767a9..19647ed125d 100644 --- a/packages/core/src/database/migrations/1691493358068-AlterIntegrationTable.ts +++ b/packages/core/src/database/migrations/1691493358068-AlterIntegrationTable.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; @@ -12,7 +11,7 @@ export class AlterIntegrationTable1691493358068 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1691494801748-SeedIntegrationTable.ts b/packages/core/src/database/migrations/1691494801748-SeedIntegrationTable.ts index 3c40fdf8ff3..c59267e03c7 100644 --- a/packages/core/src/database/migrations/1691494801748-SeedIntegrationTable.ts +++ b/packages/core/src/database/migrations/1691494801748-SeedIntegrationTable.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import { v4 as uuidv4 } from 'uuid'; import * as chalk from 'chalk'; @@ -17,7 +16,7 @@ export class SeedIntegrationTable1691494801748 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); await this.upsertIntegrationsAndIntegrationTypes(queryRunner); } diff --git a/packages/core/src/database/migrations/1691756595248-AddUserIdColumnToUserTable.ts b/packages/core/src/database/migrations/1691756595248-AddUserIdColumnToUserTable.ts index c06dd68ac58..424b892bab2 100644 --- a/packages/core/src/database/migrations/1691756595248-AddUserIdColumnToUserTable.ts +++ b/packages/core/src/database/migrations/1691756595248-AddUserIdColumnToUserTable.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; @@ -12,7 +11,7 @@ export class AddUserIdColumnToUserTable1691756595248 implements MigrationInterfa * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1692171665427-SeedIntegrationTable.ts b/packages/core/src/database/migrations/1692171665427-SeedIntegrationTable.ts index 65b5db6c5f9..acaa9d12760 100644 --- a/packages/core/src/database/migrations/1692171665427-SeedIntegrationTable.ts +++ b/packages/core/src/database/migrations/1692171665427-SeedIntegrationTable.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import { v4 as uuidv4 } from 'uuid'; import { getConfig } from "@gauzy/config"; @@ -17,7 +16,7 @@ export class SeedIntegrationTable1692171665427 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`SeedIntegrationTable1692171665427 start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); await this.upsertIntegrationsAndIntegrationTypes(queryRunner); } diff --git a/packages/core/src/database/migrations/1692256031607-AddOrganizationProjectTeamRelation.ts b/packages/core/src/database/migrations/1692256031607-AddOrganizationProjectTeamRelation.ts index 3e3f1ff80bc..34b12bd5a7d 100644 --- a/packages/core/src/database/migrations/1692256031607-AddOrganizationProjectTeamRelation.ts +++ b/packages/core/src/database/migrations/1692256031607-AddOrganizationProjectTeamRelation.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; @@ -12,7 +11,7 @@ export class AddOrganizationProjectTeamRelation1692256031607 implements Migratio * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1692275997367-AlterIntegrationTableRelationCascading.ts b/packages/core/src/database/migrations/1692275997367-AlterIntegrationTableRelationCascading.ts index ca042bea7cd..8540fb9e2c3 100644 --- a/packages/core/src/database/migrations/1692275997367-AlterIntegrationTableRelationCascading.ts +++ b/packages/core/src/database/migrations/1692275997367-AlterIntegrationTableRelationCascading.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; @@ -12,7 +11,7 @@ export class AlterIntegrationTableRelationCascading1692275997367 implements Migr * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`AlterIntegrationTableRelationCascading1692275997367 start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1692433732267-AlterIntegrationTenantTable.ts b/packages/core/src/database/migrations/1692433732267-AlterIntegrationTenantTable.ts index e789ba78452..0a71a82e66a 100644 --- a/packages/core/src/database/migrations/1692433732267-AlterIntegrationTenantTable.ts +++ b/packages/core/src/database/migrations/1692433732267-AlterIntegrationTenantTable.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; @@ -12,7 +11,7 @@ export class AlterIntegrationTenantTable1692433732267 implements MigrationInterf * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1693547294428-AlterCodeToAlphaNumericFormat.ts b/packages/core/src/database/migrations/1693547294428-AlterCodeToAlphaNumericFormat.ts index c02991a1a0a..3019528eae1 100644 --- a/packages/core/src/database/migrations/1693547294428-AlterCodeToAlphaNumericFormat.ts +++ b/packages/core/src/database/migrations/1693547294428-AlterCodeToAlphaNumericFormat.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; @@ -12,7 +11,7 @@ export class AlterCodeToAlphaNumericFormat1693547294428 implements MigrationInte * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1694427247661-AlterOrganizationTeamJoinRequestTable.ts b/packages/core/src/database/migrations/1694427247661-AlterOrganizationTeamJoinRequestTable.ts index 4fa010dfc27..c87051e7124 100644 --- a/packages/core/src/database/migrations/1694427247661-AlterOrganizationTeamJoinRequestTable.ts +++ b/packages/core/src/database/migrations/1694427247661-AlterOrganizationTeamJoinRequestTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterOrganizationTeamJoinRequestTable1694427247661 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterOrganizationTeamJoinRequestTable1694427247661 implements Migra * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1695023907817-AddColumnsToTheIntegrationTable.ts b/packages/core/src/database/migrations/1695023907817-AddColumnsToTheIntegrationTable.ts index 0898c14dad7..0edcb06c4db 100644 --- a/packages/core/src/database/migrations/1695023907817-AddColumnsToTheIntegrationTable.ts +++ b/packages/core/src/database/migrations/1695023907817-AddColumnsToTheIntegrationTable.ts @@ -11,7 +11,7 @@ export class AddColumnsToTheIntegrationTable1695023907817 implements MigrationIn * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1695111838783-AddColumnsToTheIntegrationTypeTable.ts b/packages/core/src/database/migrations/1695111838783-AddColumnsToTheIntegrationTypeTable.ts index e933ed0d9d6..7d083ad93e7 100644 --- a/packages/core/src/database/migrations/1695111838783-AddColumnsToTheIntegrationTypeTable.ts +++ b/packages/core/src/database/migrations/1695111838783-AddColumnsToTheIntegrationTypeTable.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; @@ -12,7 +11,7 @@ export class AddColumnsToTheIntegrationTypeTable1695111838783 implements Migrati * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1695112275840-SeedIntegrationsAndIntegrationTypes.ts b/packages/core/src/database/migrations/1695112275840-SeedIntegrationsAndIntegrationTypes.ts index 62bc8034b80..8efb07d0043 100644 --- a/packages/core/src/database/migrations/1695112275840-SeedIntegrationsAndIntegrationTypes.ts +++ b/packages/core/src/database/migrations/1695112275840-SeedIntegrationsAndIntegrationTypes.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; import { IntegrationTypeEnum } from "@gauzy/contracts"; @@ -15,7 +14,7 @@ export class SeedIntegrationsAndIntegrationTypes1695112275840 implements Migrati * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); await IntegrationsUtils.upsertIntegrationTypes(queryRunner, [IntegrationTypeEnum.PROJECT_MANAGEMENT]); await IntegrationsUtils.upsertIntegrationsAndIntegrationTypes(queryRunner, PROJECT_MANAGE_DEFAULT_INTEGRATIONS); diff --git a/packages/core/src/database/migrations/1695570009125-AlterTableTask.ts b/packages/core/src/database/migrations/1695570009125-AlterTableTask.ts index bfcdfcd09ec..0ec172a8f55 100644 --- a/packages/core/src/database/migrations/1695570009125-AlterTableTask.ts +++ b/packages/core/src/database/migrations/1695570009125-AlterTableTask.ts @@ -1,4 +1,5 @@ import { MigrationInterface, QueryRunner } from 'typeorm'; +import * as chalk from "chalk"; export class AlterTableTask1695570009125 implements MigrationInterface { name = 'AlterTableTask1695570009125'; @@ -9,6 +10,8 @@ export class AlterTableTask1695570009125 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1695958130201-AddedArchivedColumnToUser.ts b/packages/core/src/database/migrations/1695958130201-AddedArchivedColumnToUser.ts index d0fe4155b9b..4773be5f57e 100644 --- a/packages/core/src/database/migrations/1695958130201-AddedArchivedColumnToUser.ts +++ b/packages/core/src/database/migrations/1695958130201-AddedArchivedColumnToUser.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddedArchivedColumnToUser1695958130201 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddedArchivedColumnToUser1695958130201 implements MigrationInterfac * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1696413384868-AddedActiveArchivedColumnsToBaseEntity.ts b/packages/core/src/database/migrations/1696413384868-AddedActiveArchivedColumnsToBaseEntity.ts index 3b17efa43f5..3bce1f69c46 100644 --- a/packages/core/src/database/migrations/1696413384868-AddedActiveArchivedColumnsToBaseEntity.ts +++ b/packages/core/src/database/migrations/1696413384868-AddedActiveArchivedColumnsToBaseEntity.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddedActiveArchivedColumnsToBaseEntity1696413384868 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddedActiveArchivedColumnsToBaseEntity1696413384868 implements Migr * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1696704276300-AddLanguage.ts b/packages/core/src/database/migrations/1696704276300-AddLanguage.ts index faa74a7ce5f..e65b67888f2 100644 --- a/packages/core/src/database/migrations/1696704276300-AddLanguage.ts +++ b/packages/core/src/database/migrations/1696704276300-AddLanguage.ts @@ -11,7 +11,7 @@ export class AddLanguage1696704276300 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); await LanguageUtils.migrateLanguages(queryRunner); } diff --git a/packages/core/src/database/migrations/1697263211513-AddedIntegrationSettingColumnsToTheOrganizationProjectTable.ts b/packages/core/src/database/migrations/1697263211513-AddedIntegrationSettingColumnsToTheOrganizationProjectTable.ts index 98605c1bd23..0fa11a6d2c9 100644 --- a/packages/core/src/database/migrations/1697263211513-AddedIntegrationSettingColumnsToTheOrganizationProjectTable.ts +++ b/packages/core/src/database/migrations/1697263211513-AddedIntegrationSettingColumnsToTheOrganizationProjectTable.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from "chalk"; @@ -12,7 +11,7 @@ export class AddedIntegrationSettingColumnsToTheOrganizationProjectTable16972632 * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1697434249910-AddSyncTagColumnToTheOrganizationProjectTable.ts b/packages/core/src/database/migrations/1697434249910-AddSyncTagColumnToTheOrganizationProjectTable.ts index 846b514c3d9..52489c0ee53 100644 --- a/packages/core/src/database/migrations/1697434249910-AddSyncTagColumnToTheOrganizationProjectTable.ts +++ b/packages/core/src/database/migrations/1697434249910-AddSyncTagColumnToTheOrganizationProjectTable.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from "chalk"; @@ -12,7 +11,7 @@ export class AddSyncTagColumnToTheOrganizationProjectTable1697434249910 implemen * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1697635735546-AddedEmailStatusToEmailHistoryTable.ts b/packages/core/src/database/migrations/1697635735546-AddedEmailStatusToEmailHistoryTable.ts index 166ffbce8cf..58ce4bf632d 100644 --- a/packages/core/src/database/migrations/1697635735546-AddedEmailStatusToEmailHistoryTable.ts +++ b/packages/core/src/database/migrations/1697635735546-AddedEmailStatusToEmailHistoryTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddedEmailStatusToEmailHistoryTable1697635735546 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddedEmailStatusToEmailHistoryTable1697635735546 implements Migrati * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1697692691682-AlterTableInvoiceEstimateHistory.ts b/packages/core/src/database/migrations/1697692691682-AlterTableInvoiceEstimateHistory.ts index 74b73722357..4530dc07b7d 100644 --- a/packages/core/src/database/migrations/1697692691682-AlterTableInvoiceEstimateHistory.ts +++ b/packages/core/src/database/migrations/1697692691682-AlterTableInvoiceEstimateHistory.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from "chalk"; @@ -12,7 +11,7 @@ export class AlterTableInvoiceEstimateHistory1697692691682 implements MigrationI * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1697716380119-CreateIntegrationOrganizationGithubRepositoryTable.ts b/packages/core/src/database/migrations/1697716380119-CreateIntegrationOrganizationGithubRepositoryTable.ts index aed7341f364..232177d22a4 100644 --- a/packages/core/src/database/migrations/1697716380119-CreateIntegrationOrganizationGithubRepositoryTable.ts +++ b/packages/core/src/database/migrations/1697716380119-CreateIntegrationOrganizationGithubRepositoryTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class CreateIntegrationOrganizationGithubRepositoryTable1697716380119 implements MigrationInterface { @@ -11,6 +11,8 @@ export class CreateIntegrationOrganizationGithubRepositoryTable1697716380119 imp * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1697978582510-AddedLastSyncedAtColumnToTheIntegrationTenantTable.ts b/packages/core/src/database/migrations/1697978582510-AddedLastSyncedAtColumnToTheIntegrationTenantTable.ts index ffd4cc9fbc5..11c41d8eff4 100644 --- a/packages/core/src/database/migrations/1697978582510-AddedLastSyncedAtColumnToTheIntegrationTenantTable.ts +++ b/packages/core/src/database/migrations/1697978582510-AddedLastSyncedAtColumnToTheIntegrationTenantTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddedLastSyncedAtColumnToTheIntegrationTenantTable1697978582510 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddedLastSyncedAtColumnToTheIntegrationTenantTable1697978582510 imp * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1698214673445-AlterIntegrationOrganizationGithubRepositoryTable.ts b/packages/core/src/database/migrations/1698214673445-AlterIntegrationOrganizationGithubRepositoryTable.ts index 0a3b8fe62eb..8f33dc5a97f 100644 --- a/packages/core/src/database/migrations/1698214673445-AlterIntegrationOrganizationGithubRepositoryTable.ts +++ b/packages/core/src/database/migrations/1698214673445-AlterIntegrationOrganizationGithubRepositoryTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterIntegrationOrganizationGithubRepositoryTable1698214673445 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterIntegrationOrganizationGithubRepositoryTable1698214673445 impl * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1698383136452-CreateIntegrationOrganizationGithubRepositoryIssueTable.ts b/packages/core/src/database/migrations/1698383136452-CreateIntegrationOrganizationGithubRepositoryIssueTable.ts index 6cef445e838..ddbad13212e 100644 --- a/packages/core/src/database/migrations/1698383136452-CreateIntegrationOrganizationGithubRepositoryIssueTable.ts +++ b/packages/core/src/database/migrations/1698383136452-CreateIntegrationOrganizationGithubRepositoryIssueTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class CreateIntegrationOrganizationGithubRepositoryIssueTable1698383136452 implements MigrationInterface { @@ -11,6 +11,8 @@ export class CreateIntegrationOrganizationGithubRepositoryIssueTable169838313645 * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1698659313745-AddSoftDeleteFeatureToTheAllTables.ts b/packages/core/src/database/migrations/1698659313745-AddSoftDeleteFeatureToTheAllTables.ts index 143ba298162..449e4de0121 100644 --- a/packages/core/src/database/migrations/1698659313745-AddSoftDeleteFeatureToTheAllTables.ts +++ b/packages/core/src/database/migrations/1698659313745-AddSoftDeleteFeatureToTheAllTables.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AddSoftDeleteFeatureToTheAllTables1698659313745 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AddSoftDeleteFeatureToTheAllTables1698659313745 implements Migratio * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1698991349981-AlterIntegrationOrganizationGithubRepositoryTable.ts b/packages/core/src/database/migrations/1698991349981-AlterIntegrationOrganizationGithubRepositoryTable.ts index 28ae4f4ff5f..de978411f9f 100644 --- a/packages/core/src/database/migrations/1698991349981-AlterIntegrationOrganizationGithubRepositoryTable.ts +++ b/packages/core/src/database/migrations/1698991349981-AlterIntegrationOrganizationGithubRepositoryTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterIntegrationOrganizationGithubRepositoryTable1698991349981 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterIntegrationOrganizationGithubRepositoryTable1698991349981 impl * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1699353179526-AlterPasswordResetTable.ts b/packages/core/src/database/migrations/1699353179526-AlterPasswordResetTable.ts index e4705de2647..eae19b507c6 100644 --- a/packages/core/src/database/migrations/1699353179526-AlterPasswordResetTable.ts +++ b/packages/core/src/database/migrations/1699353179526-AlterPasswordResetTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterPasswordResetTable1699353179526 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterPasswordResetTable1699353179526 implements MigrationInterface * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1700123233258-AlterTableOrganization.ts b/packages/core/src/database/migrations/1700123233258-AlterTableOrganization.ts index 8d3b7c2ea3a..a9a918e6f29 100644 --- a/packages/core/src/database/migrations/1700123233258-AlterTableOrganization.ts +++ b/packages/core/src/database/migrations/1700123233258-AlterTableOrganization.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from "chalk"; @@ -12,7 +11,7 @@ export class AlterTableOrganization1700123233258 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1700462617037-AddMultiTenantResetPasswordEmailTemplate.ts b/packages/core/src/database/migrations/1700462617037-AddMultiTenantResetPasswordEmailTemplate.ts index c517e38f03c..99a23d9e0dd 100644 --- a/packages/core/src/database/migrations/1700462617037-AddMultiTenantResetPasswordEmailTemplate.ts +++ b/packages/core/src/database/migrations/1700462617037-AddMultiTenantResetPasswordEmailTemplate.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from "chalk"; import { EmailTemplateEnum } from "@gauzy/contracts"; @@ -14,7 +13,7 @@ export class AddMultiTenantResetPasswordEmailTemplate1700462617037 implements Mi * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); // Migrate email templates for multi-tenant password reset try { diff --git a/packages/core/src/database/migrations/1701067699290-AddedEditedAtFeatureToTheTimesheetAndTimeLogTables.ts b/packages/core/src/database/migrations/1701067699290-AddedEditedAtFeatureToTheTimesheetAndTimeLogTables.ts index 5ac7884fad9..2a7b6517b75 100644 --- a/packages/core/src/database/migrations/1701067699290-AddedEditedAtFeatureToTheTimesheetAndTimeLogTables.ts +++ b/packages/core/src/database/migrations/1701067699290-AddedEditedAtFeatureToTheTimesheetAndTimeLogTables.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from "chalk"; @@ -12,7 +11,7 @@ export class AddedEditedAtFeatureToTheTimesheetAndTimeLogTables1701067699290 imp * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); diff --git a/packages/core/src/database/migrations/1701081154869-AlterScreenshotTable.ts b/packages/core/src/database/migrations/1701081154869-AlterScreenshotTable.ts index 8acce21d768..ebb9e4957cc 100644 --- a/packages/core/src/database/migrations/1701081154869-AlterScreenshotTable.ts +++ b/packages/core/src/database/migrations/1701081154869-AlterScreenshotTable.ts @@ -1,5 +1,5 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; +import * as chalk from "chalk"; export class AlterScreenshotTable1701081154869 implements MigrationInterface { @@ -11,6 +11,8 @@ export class AlterScreenshotTable1701081154869 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { + console.log(chalk.yellow(this.name + ' start running!')); + if (['sqlite', 'better-sqlite3'].includes(queryRunner.connection.options.type)) { await this.sqliteUpQueryRunner(queryRunner); } else { diff --git a/packages/core/src/database/migrations/1701353754397-MigrateEmailTemplates.ts b/packages/core/src/database/migrations/1701353754397-MigrateEmailTemplates.ts index 4be45075638..e19dc26a608 100644 --- a/packages/core/src/database/migrations/1701353754397-MigrateEmailTemplates.ts +++ b/packages/core/src/database/migrations/1701353754397-MigrateEmailTemplates.ts @@ -1,4 +1,3 @@ - import { MigrationInterface, QueryRunner } from "typeorm"; import * as chalk from 'chalk'; import { EmailTemplateEnum } from "@gauzy/contracts"; @@ -14,7 +13,7 @@ export class MigrateEmailTemplates1701353754397 implements MigrationInterface { * @param queryRunner */ public async up(queryRunner: QueryRunner): Promise { - console.log(chalk.yellow(`${this.name} start running!`)); + console.log(chalk.yellow(this.name + ' start running!')); const templates = Object.values(EmailTemplateEnum); await Promise.all( From 4b2ef738eaab72e7920b9dce715ff16ed0ee1e89 Mon Sep 17 00:00:00 2001 From: Kifungo A <45813955+adkif@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:17:21 +0200 Subject: [PATCH 06/34] feat: create text mask directive --- .../gauzy/src/app/@shared/directives/index.ts | 2 + .../@shared/directives/text-mask.directive.ts | 53 +++++++++++++++++++ .../integrations/gauzy-ai/gauzy-ai.module.ts | 4 +- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 apps/gauzy/src/app/@shared/directives/text-mask.directive.ts diff --git a/apps/gauzy/src/app/@shared/directives/index.ts b/apps/gauzy/src/app/@shared/directives/index.ts index bddabe95279..162dd9daa19 100755 --- a/apps/gauzy/src/app/@shared/directives/index.ts +++ b/apps/gauzy/src/app/@shared/directives/index.ts @@ -6,6 +6,7 @@ import { UnderConstructionDirective } from './under-construction.directive'; import { ReadMoreDirective } from './read-more'; import { TimeTrackingAuthorizedDirective } from './time-tracking-authorized-directive'; import { NoSpaceEdgesDirective } from './no-space-edges.directive'; +import { TextMaskDirective } from './text-mask.directive'; export const DIRECTIVES = [ AutocompleteOffDirective, @@ -16,4 +17,5 @@ export const DIRECTIVES = [ OutsideDirective, UnderConstructionDirective, NoSpaceEdgesDirective, + TextMaskDirective ]; diff --git a/apps/gauzy/src/app/@shared/directives/text-mask.directive.ts b/apps/gauzy/src/app/@shared/directives/text-mask.directive.ts new file mode 100644 index 00000000000..a81ec116559 --- /dev/null +++ b/apps/gauzy/src/app/@shared/directives/text-mask.directive.ts @@ -0,0 +1,53 @@ +import { Directive, ElementRef, Renderer2, Input } from '@angular/core'; + +interface IMaskConfig { + text: string; + showOriginal: boolean; + replacement: number; +} + +@Directive({ + selector: '[gaTextMask]' +}) +export class TextMaskDirective { + private readonly _config: IMaskConfig; + + constructor(private el: ElementRef, private renderer: Renderer2) { + this._config = { + text: '', + showOriginal: false, + replacement: 0.5 + }; + } + + private applyTextMask() { + const text = this.config.showOriginal ? this.config.text : this.maskText(this.config.text); + this.renderer.setProperty(this.el.nativeElement, 'innerText', text); + } + + private maskText(text: string): string { + if (!text) { + return ''; + } + + const textArray = text.split(''); + + for (let i = 0; i < textArray.length; i++) { + if (i < Math.floor(this.config.replacement * textArray.length)) { + textArray[i] = '*'; + } + } + + return textArray.join(''); + } + + public get config(): IMaskConfig { + return this._config; + } + + @Input() + public set config(partialConfig: Partial) { + Object.assign(this._config, partialConfig); + this.applyTextMask(); + } +} diff --git a/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai.module.ts b/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai.module.ts index a75a09a460b..d602305d22a 100644 --- a/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai.module.ts +++ b/apps/gauzy/src/app/pages/integrations/gauzy-ai/gauzy-ai.module.ts @@ -9,6 +9,7 @@ import { GauzyAILayoutComponent } from './gauzy-ai.layout.component'; import { GauzyAIAuthorizationComponent } from './components/authorization/authorization.component'; import { GauzyAIViewComponent } from './components/view/view.component'; import { WorkInProgressModule } from '../../work-in-progress/work-in-progress.module'; +import { DirectivesModule } from '../../../@shared/directives/directives.module'; @NgModule({ declarations: [ @@ -29,7 +30,8 @@ import { WorkInProgressModule } from '../../work-in-progress/work-in-progress.mo GauzyAIRoutingModule, TranslateModule, BackNavigationModule, - WorkInProgressModule + WorkInProgressModule, + DirectivesModule ] }) export class GauzyAIModule { } From 8ab7fc2f3aae623a543e93b2a44404d079ee2e40 Mon Sep 17 00:00:00 2001 From: Kifungo A <45813955+adkif@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:30:00 +0200 Subject: [PATCH 07/34] feat: improve UI --- .../components/view/view.component.html | 31 ++++++++--- .../components/view/view.component.scss | 52 ++++++++++++++++--- .../components/view/view.component.ts | 18 +++++-- 3 files changed, 82 insertions(+), 19 deletions(-) diff --git a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.html b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.html index 85bfb5d8559..4c5f64e83e9 100644 --- a/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.html +++ b/apps/gauzy/src/app/pages/integrations/gauzy-ai/components/view/view.component.html @@ -12,13 +12,7 @@
- + +
diff --git a/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.component.html b/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.component.html index 14d15ec3c6d..b01ff950225 100644 --- a/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.component.html +++ b/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.component.html @@ -41,11 +41,19 @@
{{ 'TIMESHEET.SCREENSHOTS.SCREENSHOTS' | translate }}
- + +
size="tiny" (click)="deleteImage(image, image?.employee)" > - +
{{ image?.recordedAt | dateTimeFormat }} diff --git a/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.component.ts b/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.component.ts index ccde0f75919..d4979e65454 100644 --- a/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.component.ts +++ b/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.component.ts @@ -29,18 +29,31 @@ export class ViewScreenshotsModalComponent implements OnInit { get timeSlot(): ITimeSlot { return this._timeSlot; } + /** + * Setter for the timeSlot property. Assigns the provided timeSlot value, processes + * and formats the screenshots, and updates the local _timeSlot property accordingly. + * + * @param timeSlot - The TimeSlot object to be assigned. + */ @Input() set timeSlot(timeSlot: ITimeSlot) { - let screenshots = JSON.parse(JSON.stringify(timeSlot.screenshots)); - this.screenshots = sortBy(screenshots, 'recordedAt').map((screenshot: IScreenshot) => { - return { + if (timeSlot) { + // Destructure the timeSlot object + const { ...restTimeSlot } = timeSlot; + const screenshots = JSON.parse(JSON.stringify(timeSlot.screenshots)); + + // Process and format the screenshots array + this.screenshots = sortBy(screenshots, 'recordedAt').map((screenshot: IScreenshot) => ({ employee: timeSlot.employee, ...screenshot - } - }); - this._timeSlot = Object.assign({}, timeSlot, { - localStartedAt: toLocal(timeSlot.startedAt).toDate(), - localStoppedAt: toLocal(timeSlot.stoppedAt).toDate() - }); + })); + + // Update the _timeSlot object with formatted timestamps and other properties + this._timeSlot = { + ...restTimeSlot, + localStartedAt: toLocal(timeSlot.startedAt).toDate(), + localStoppedAt: toLocal(timeSlot.stoppedAt).toDate() + }; + } } /* @@ -64,13 +77,14 @@ export class ViewScreenshotsModalComponent implements OnInit { @Input() set timeLogs(timeLogs: ITimeLog[]) { this._timeLogs = sortBy(timeLogs, 'recordedAt'); } + constructor( private readonly store: Store, private readonly dialogRef: NbDialogRef, private readonly timesheetService: TimesheetService, private readonly nbDialogService: NbDialogService, private readonly toastrService: ToastrService - ) {} + ) { } ngOnInit(): void { this.store.selectedOrganization$ @@ -83,99 +97,132 @@ export class ViewScreenshotsModalComponent implements OnInit { .subscribe(); } - async getTimeSlot() { + /** + * Asynchronously retrieves and sets the time slot and associated time logs. + * + * @returns A Promise that resolves when the operation is complete. + */ + async getTimeSlot(): Promise { try { + // Check if organization and time slot are available + if (!this.organization || !this.timeSlot) { + return; + } + + // Retrieve time slot with specified relations this.timeSlot = await this.timesheetService.getTimeSlot(this.timeSlot.id, { relations: [ 'employee.user', 'screenshots', - 'timeLogs', 'timeLogs.project', 'timeLogs.task', 'timeLogs.organizationContact', 'timeLogs.employee.user', - ] + ], }); + + // Set the time logs property to the time logs of the retrieved time slot this.timeLogs = this.timeSlot.timeLogs; } catch (error) { - console.log('Error while retrieve TimeSlot:', error); + // Handle errors by logging and displaying a toastr message + console.error('Error while retrieving TimeSlot:', error); this.toastrService.danger(error); } } - close() { + /** + * Closes the current dialog. + */ + close(): void { this.dialogRef.close(); } - viewTimeLog(timeLog: ITimeLog) { + /** + * Opens a modal to view details of a time log. + * + * @param timeLog - The time log to be viewed. + */ + viewTimeLog(timeLog: ITimeLog): void { this.nbDialogService.open(ViewTimeLogModalComponent, { - context: { timeLog } + context: { timeLog }, }); } /** - * DELETE specific Screenshot + * Deletes a specific screenshot associated with an employee. * - * @param screenshot - * @param employee - * @returns + * @param screenshot - The screenshot to be deleted. + * @param employee - The employee associated with the screenshot. + * @returns void */ - async deleteImage( - screenshot: IScreenshot, - employee: IEmployee - ) { + async deleteImage(screenshot: IScreenshot, employee: IEmployee): Promise { if (!screenshot || !this.organization) { return; } + try { const { name } = this.organization; const { organizationId, tenantId } = screenshot; + // Delete the specified screenshot await this.timesheetService.deleteScreenshot(screenshot.id, { organizationId, tenantId - }).then(() => { - this.screenshots = this.screenshots.filter( - (item: IScreenshot) => item.id !== screenshot.id - ); }); + + // Remove the deleted screenshot from the local collection + this.screenshots = this.screenshots.filter( + (item: IScreenshot) => item.id !== screenshot.id + ); + + // Display success message this.toastrService.success('TOASTR.MESSAGE.SCREENSHOT_DELETED', { name: employee.fullName, organization: name }); } catch (error) { - console.log('Error while delete screenshot: ', error); + // Handle errors by logging and displaying a toastr message + console.error('Error while deleting screenshot:', error); this.toastrService.danger(error); } } /** - * DELETE specific TimeLog + * Deletes a specific time log associated with an employee. * - * @param timeLog + * @param timeLog - The time log to be deleted. + * @param employee - The employee associated with the time log. + * @returns void */ - async deleteTimeLog(timeLog: ITimeLog, employee: IEmployee) { + async deleteTimeLog(timeLog: ITimeLog, employee: IEmployee): Promise { if (timeLog.isRunning) { return; } + try { - const { id: organizationId } = this.organization; + const { id: organizationId, name: organizationName } = this.organization; const request = { logIds: [timeLog.id], organizationId - } - await this.timesheetService.deleteLogs(request).then(() => { - this.toastrService.success('TOASTR.MESSAGE.TIME_LOG_DELETED', { - name: employee.fullName, - organization: this.organization.name - }); - this.dialogRef.close({ - timeLog: timeLog, - isDelete: true - }); + }; + + // Delete the specified time log + await this.timesheetService.deleteLogs(request); + + // Display success message + this.toastrService.success('TOASTR.MESSAGE.TIME_LOG_DELETED', { + name: employee.fullName, + organization: organizationName + }); + + // Close the dialog and emit an event indicating time log deletion + this.dialogRef.close({ + timeLog: timeLog, + isDelete: true }); } catch (error) { - console.log('Error while delete TimeLog: ', error); + // Handle errors by logging and displaying a toastr message + console.error('Error while deleting TimeLog:', error); this.toastrService.danger(error); } } diff --git a/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.module.ts b/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.module.ts index 5ccb34516fe..87993f88f91 100644 --- a/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.module.ts +++ b/apps/gauzy/src/app/@shared/timesheet/screenshots/view-screenshots-modal/view-screenshots-modal.module.ts @@ -1,21 +1,22 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { ViewScreenshotsModalComponent } from './view-screenshots-modal.component'; import { NbDialogModule, NbCardModule, NbButtonModule, NbIconModule, NbProgressBarModule, - NbAlertModule + NbAlertModule, + NbTooltipModule } from '@nebular/theme'; -import { SharedModule } from '../../../shared.module'; import { MomentModule } from 'ngx-moment'; -import { TranslateModule } from '@ngx-translate/core'; +import { SharedModule } from '../../../shared.module'; import { LabelModule } from '../../../components/label/label.module'; import { GalleryModule } from '../../../gallery/gallery.module'; import { DialogsModule } from '../../../dialogs/dialogs.module'; -import { TableComponentsModule } from '../../../table-components'; +import { TranslateModule } from '../../../translate/translate.module'; +import { TableComponentsModule } from '../../../table-components/table-components.module'; +import { ViewScreenshotsModalComponent } from './view-screenshots-modal.component'; @NgModule({ declarations: [ViewScreenshotsModalComponent], @@ -23,13 +24,14 @@ import { TableComponentsModule } from '../../../table-components'; imports: [ CommonModule, NbAlertModule, - NbDialogModule.forChild(), - NbCardModule, NbButtonModule, + NbCardModule, + NbDialogModule.forChild(), NbIconModule, - SharedModule, NbProgressBarModule, + NbTooltipModule, MomentModule, + SharedModule, TranslateModule, LabelModule, GalleryModule, From 3a3bbfd6bff8de6ffbb3049daf3ceff4b3d9d254 Mon Sep 17 00:00:00 2001 From: RAHUL RATHORE <41804588+rahul-rocket@users.noreply.github.com> Date: Fri, 8 Dec 2023 18:36:57 +0530 Subject: [PATCH 33/34] fix: #7246 screenshot gallery change button colors --- apps/gauzy/src/app/@shared/gallery/gallery.component.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/gauzy/src/app/@shared/gallery/gallery.component.html b/apps/gauzy/src/app/@shared/gallery/gallery.component.html index 1d4a3e65294..26eee4c0943 100755 --- a/apps/gauzy/src/app/@shared/gallery/gallery.component.html +++ b/apps/gauzy/src/app/@shared/gallery/gallery.component.html @@ -4,6 +4,7 @@