From 8b0bb716ad0537e894d4ab7e67b5ba6faf4c2bf9 Mon Sep 17 00:00:00 2001 From: Eric BREHAULT Date: Wed, 6 Mar 2024 09:34:05 +0100 Subject: [PATCH] Ericbrehault/sc 9166/deprecate desktop app (#1378) * do not allow sync if no folders selected * update link to doc * deprecation warning in desktop app --- apps/desktop/src/app/app.component.ts | 5 ++ .../src/app/login/login.component.scss | 2 +- libs/sync/src/assets/i18n/ca.json | 3 + libs/sync/src/assets/i18n/en.json | 3 + libs/sync/src/assets/i18n/es.json | 3 + libs/sync/src/assets/i18n/fr.json | 3 + libs/sync/src/lib/sync/sources/confluence.ts | 2 +- libs/sync/src/lib/upload/sync.component.html | 20 ++--- .../lib/upload/tabs/activity.component.html | 10 ++- .../lib/upload/tabs/activity.component.scss | 11 +++ .../src/lib/upload/tabs/activity.component.ts | 5 ++ .../lib/upload/tabs/edit-folders.component.ts | 2 + libs/sync/sync.babel | 74 +++++++++++++++++++ package.json | 2 +- 14 files changed, 131 insertions(+), 14 deletions(-) diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index 85cd526a8..eb55a6276 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -49,6 +49,11 @@ export class AppComponent implements OnInit { } ngOnInit(): void { + this.modalService.openConfirm({ + title: 'home.deprecated.title', + description: 'home.deprecated.message', + onlyConfirm: true, + }); if (this.config.getVersion()) { this.version = `${pkg['version']} - ${this.config.getVersion()}`; } diff --git a/apps/desktop/src/app/login/login.component.scss b/apps/desktop/src/app/login/login.component.scss index 234bed8e8..692673bf6 100644 --- a/apps/desktop/src/app/login/login.component.scss +++ b/apps/desktop/src/app/login/login.component.scss @@ -5,7 +5,7 @@ left: 0; height: 100%; width: 100%; - z-index: 10050; + z-index: 1000; background-color: $color-dark-stronger; } diff --git a/libs/sync/src/assets/i18n/ca.json b/libs/sync/src/assets/i18n/ca.json index 9b60f8b94..320f04d29 100644 --- a/libs/sync/src/assets/i18n/ca.json +++ b/libs/sync/src/assets/i18n/ca.json @@ -15,6 +15,8 @@ "history.source": "Origen", "history.title": "Historial de pujades", "home.active-connectors": "o comproveu els vostres connectors actius a la llista de l'esquerra.", + "home.deprecated.message": "L'aplicació Nuclia Desktop està obsoleta. Utilitzeu el Nuclia Sync Agent.", + "home.deprecated.title": "Avís de depreciació", "home.new-connector": "Feu clic al botó següent per afegir un nou connector al vostre compte de Nuclia", "home.welcome": "Benvingut/da", "login.button": "Accedir", @@ -31,6 +33,7 @@ "upload.activity.error": "La sincronització ha fallat", "upload.activity.event": "Missatge", "upload.activity.help": "Totes les sincronitzacions s'activen automàticament cada 60 minuts.", + "upload.activity.no-folders": "Encara no s'ha seleccionat cap carpeta. Aneu a la pestanya Carpetes per seleccionar les carpetes que voleu sincronitzar.", "upload.activity.sync-now": "Sincronitza ara", "upload.add-connector": "Afegir connector", "upload.authentication.fail": "L'autenticació ha fallat", diff --git a/libs/sync/src/assets/i18n/en.json b/libs/sync/src/assets/i18n/en.json index 60d674f44..4c0e0048d 100644 --- a/libs/sync/src/assets/i18n/en.json +++ b/libs/sync/src/assets/i18n/en.json @@ -15,6 +15,8 @@ "history.source": "Source", "history.title": "Upload history", "home.active-connectors": "or check your active connectors in the list on the the left.", + "home.deprecated.message": "The Nuclia Desktop Application is deprecated. Please use the Nuclia Sync Agent.", + "home.deprecated.title": "Deprecation warning", "home.new-connector": "Click the button below to add a new connector to your Nuclia account", "home.welcome": "Welcome", "login.button": "Log in", @@ -31,6 +33,7 @@ "upload.activity.error": "Sync failed", "upload.activity.event": "Message", "upload.activity.help": "All syncs are triggered automatically every 60 minutes.", + "upload.activity.no-folders": "No folders selected yet. Go to the Folders tab to select the folders you want to sync.", "upload.activity.sync-now": "Sync now", "upload.add-connector": "Add connector", "upload.authentication.fail": "Authentication failed", diff --git a/libs/sync/src/assets/i18n/es.json b/libs/sync/src/assets/i18n/es.json index 4452b6a29..7f3b1798c 100644 --- a/libs/sync/src/assets/i18n/es.json +++ b/libs/sync/src/assets/i18n/es.json @@ -15,6 +15,8 @@ "history.source": "Origen", "history.title": "Historial de subidas", "home.active-connectors": "o verifique sus conectores activos en la lista de la izquierda.", + "home.deprecated.message": "La aplicación Nuclia Desktop está en desuso. Utilice el Nuclia Sync Agent.", + "home.deprecated.title": "Advertencia de obsolescencia", "home.new-connector": "Haga clic en el botón a continuación para agregar un nuevo conector a tu cuenta de Nuclia", "home.welcome": "Bienvenido/a", "login.button": "Iniciar sesión", @@ -31,6 +33,7 @@ "upload.activity.error": "Sincronización fallida", "upload.activity.event": "Mensaje", "upload.activity.help": "Todas las sincronizaciones se activan automáticamente cada 60 minutos.", + "upload.activity.no-folders": "Aún no hay carpetas seleccionadas. Vaya a la pestaña Carpetas para seleccionar las carpetas que desea sincronizar.", "upload.activity.sync-now": "Sincronizar ahora", "upload.add-connector": "Añadir conector", "upload.authentication.fail": "Autenticación fallida", diff --git a/libs/sync/src/assets/i18n/fr.json b/libs/sync/src/assets/i18n/fr.json index e7a688bea..8a7b7b90d 100644 --- a/libs/sync/src/assets/i18n/fr.json +++ b/libs/sync/src/assets/i18n/fr.json @@ -15,6 +15,8 @@ "history.source": "Source", "history.title": "Historique des téléchargements", "home.active-connectors": "ou vérifiez vos connecteurs actifs dans la liste de gauche.", + "home.deprecated.message": "L'application Nuclia Desktop est obsolète. Veuillez utiliser le Nuclia Sync Agent.", + "home.deprecated.title": "Avertissement de dépréciation", "home.new-connector": "Cliquez sur le bouton ci-dessous pour ajouter un nouveau connecteur à votre compte Nuclia", "home.welcome": "Bienvenu/e", "login.button": "Se connecter", @@ -31,6 +33,7 @@ "upload.activity.error": "Échec de la synchronisation", "upload.activity.event": "Message", "upload.activity.help": "Toutes les synchronisations sont déclenchées automatiquement toutes les 60 minutes.", + "upload.activity.no-folders": "Aucun dossier sélectionné pour l'instant. Allez dans l'onglet Dossiers pour sélectionner les dossiers que vous souhaitez synchroniser.", "upload.activity.sync-now": "Synchroniser maintenant", "upload.add-connector": "Ajouter un connecteur", "upload.authentication.fail": "Échec de l'authentification", diff --git a/libs/sync/src/lib/sync/sources/confluence.ts b/libs/sync/src/lib/sync/sources/confluence.ts index 533c633b8..ede86ea83 100644 --- a/libs/sync/src/lib/sync/sources/confluence.ts +++ b/libs/sync/src/lib/sync/sources/confluence.ts @@ -13,7 +13,7 @@ export const ConfluenceConnector: SourceConnectorDefinition = { title: 'Confluence', logo: `${baseLogoPath}/confluence.svg`, description: 'Collaboration platform developed by Atlassian', - helpUrl: 'https://docs.nuclia.dev/docs/docs/using/nda#confluence-connector-usage', + helpUrl: 'https://docs.nuclia.dev/docs/docs/using/sync-agent#confluence-connector-usage', factory: () => of(new ConfluenceImpl()), }; diff --git a/libs/sync/src/lib/upload/sync.component.html b/libs/sync/src/lib/upload/sync.component.html index 106b06458..794711051 100644 --- a/libs/sync/src/lib/upload/sync.component.html +++ b/libs/sync/src/lib/upload/sync.component.html @@ -18,11 +18,6 @@

[active]="selectedTab === 'activity'"> {{ 'upload.tabs.activity' | translate }} - - {{ 'upload.tabs.settings' | translate }} - @if (canSelectFiles | async) { [active]="selectedTab === 'labels'"> {{ 'upload.tabs.labels' | translate }} + + {{ 'upload.tabs.settings' | translate }} + @if (selectedTab === 'activity') {
} -@if (selectedTab === 'settings') { -
- -
-} @if (selectedTab === 'folders') {
} @@ -63,3 +58,8 @@

@if (selectedTab === 'labels') {
} +@if (selectedTab === 'settings') { +
+ +
+} diff --git a/libs/sync/src/lib/upload/tabs/activity.component.html b/libs/sync/src/lib/upload/tabs/activity.component.html index 5612b6ed2..ddc978908 100644 --- a/libs/sync/src/lib/upload/tabs/activity.component.html +++ b/libs/sync/src/lib/upload/tabs/activity.component.html @@ -1,7 +1,15 @@

{{ 'upload.activity.help' | translate }}

+@if ((canSelectFiles | async) && (noFolderSelected | async)) { +
+ +
+ {{ 'upload.activity.no-folders' | translate }} +
+
+} + [disabled]="syncing || ((canSelectFiles | async) && (noFolderSelected | async))"> {{ 'upload.activity.sync-now' | translate }} diff --git a/libs/sync/src/lib/upload/tabs/activity.component.scss b/libs/sync/src/lib/upload/tabs/activity.component.scss index e69de29bb..29df9b641 100644 --- a/libs/sync/src/lib/upload/tabs/activity.component.scss +++ b/libs/sync/src/lib/upload/tabs/activity.component.scss @@ -0,0 +1,11 @@ +@import 'apps/dashboard/src/variables'; + +.warning-container { + display: flex; + align-items: center; + background: $color-secondary-regular; + color: $color-dark-stronger; + margin-bottom: rhythm(2); + padding: rhythm(2); + gap: rhythm(2); +} diff --git a/libs/sync/src/lib/upload/tabs/activity.component.ts b/libs/sync/src/lib/upload/tabs/activity.component.ts index 42433ade2..8748d9c13 100644 --- a/libs/sync/src/lib/upload/tabs/activity.component.ts +++ b/libs/sync/src/lib/upload/tabs/activity.component.ts @@ -17,6 +17,11 @@ export class SyncActivityComponent implements OnInit, OnDestroy { currentIndex = 0; logs: { index: number; date: string; message: string; icon: string }[] = []; syncing = false; + currentSync = this.syncService.getCurrentSync(); + canSelectFiles = this.syncService.currentSourceId.pipe( + map((sourceId) => this.syncService.canSelectFiles(sourceId || '')), + ); + noFolderSelected = this.currentSync.pipe(map((sync) => !sync.foldersToSync || sync.foldersToSync.length === 0)); constructor( private syncService: SyncService, diff --git a/libs/sync/src/lib/upload/tabs/edit-folders.component.ts b/libs/sync/src/lib/upload/tabs/edit-folders.component.ts index a814340fe..548b382bb 100644 --- a/libs/sync/src/lib/upload/tabs/edit-folders.component.ts +++ b/libs/sync/src/lib/upload/tabs/edit-folders.component.ts @@ -33,6 +33,7 @@ export class EditSyncFoldersComponent implements OnInit, AfterViewInit { resources: Observable = this.triggerSearch.pipe( tap(() => { this.loading = true; + this.cdr.markForCheck(); }), switchMap(() => this.currentSource.pipe(take(1))), switchMap((source) => @@ -53,6 +54,7 @@ export class EditSyncFoldersComponent implements OnInit, AfterViewInit { .pipe( tap(() => { this.loading = false; + this.cdr.markForCheck(); }), scan((acc, current) => acc.concat(current.items), [] as SyncItem[]), ), diff --git a/libs/sync/sync.babel b/libs/sync/sync.babel index d72378ed6..d700e9238 100644 --- a/libs/sync/sync.babel +++ b/libs/sync/sync.babel @@ -410,6 +410,57 @@ + + deprecated + + + message + + + + + ca-ES + false + + + en-US + false + + + es-ES + false + + + fr-FR + false + + + + + title + + + + + ca-ES + false + + + en-US + false + + + es-ES + false + + + fr-FR + false + + + + + new-connector @@ -801,6 +852,29 @@ + + no-folders + + + + + ca-ES + false + + + en-US + false + + + es-ES + false + + + fr-FR + false + + + sync-now diff --git a/package.json b/package.json index dd47069fb..b172aa92e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuclia", - "version": "2.7.8", + "version": "2.7.9", "license": "MIT", "author": "Nuclia.cloud", "description": "Nuclia frontend apps and libs",