diff --git a/CHANGELOG.md b/CHANGELOG.md index eebc3ae..2db6205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## [v26.1.1](https://github.com/gisaia/ARLAS-wui-hub/tree/v26.1.1) (2024-12-10) + +[Full Changelog](https://github.com/gisaia/ARLAS-wui-hub/compare/v26.1.0...v26.1.1) + +## [v26.1.0](https://github.com/gisaia/ARLAS-wui-hub/tree/v26.1.0) (2024-12-02) + +[Full Changelog](https://github.com/gisaia/ARLAS-wui-hub/compare/v26.0.3...v26.1.0) + +**New stuff:** + +- Align collections list with organisation bar [\#211](https://github.com/gisaia/ARLAS-wui-hub/issues/211) +- When you search, a progress bar appears, shifting everything downwards each time you type a letter [\#208](https://github.com/gisaia/ARLAS-wui-hub/issues/208) + +**Fixed bugs:** + +- Make some paddings in between cards and creation/import buttons [\#212](https://github.com/gisaia/ARLAS-wui-hub/issues/212) +- Dashboards searchbar should not be proposed in login page [\#210](https://github.com/gisaia/ARLAS-wui-hub/issues/210) +- When you do a search and then close the search by clicking on the cross, the last dashboard looks weird [\#209](https://github.com/gisaia/ARLAS-wui-hub/issues/209) +- Missing dashboard after search [\#207](https://github.com/gisaia/ARLAS-wui-hub/issues/207) + ## [v26.0.3](https://github.com/gisaia/ARLAS-wui-hub/tree/v26.0.3) (2024-11-14) [Full Changelog](https://github.com/gisaia/ARLAS-wui-hub/compare/v26.0.2...v26.0.3) diff --git a/src/app/app.component.html b/src/app/app.component.html index 4a40da0..47a5d06 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -11,7 +11,7 @@ - +
diff --git a/src/app/components/card/card.component.ts b/src/app/components/card/card.component.ts index 8fedb1f..7212416 100644 --- a/src/app/components/card/card.component.ts +++ b/src/app/components/card/card.component.ts @@ -98,7 +98,11 @@ export class CardComponent implements AfterViewInit, OnInit { } public initDashboardVisibility() { - this.status = this.card.isPublic ? 'public' : (this.rights.length === 0) ? 'private' : 'shared'; + this.status = this.isPublic(this.rights) ? 'public' : (this.rights.length === 0) ? 'private' : 'shared'; + } + + private isPublic(readers: CardRights[]): boolean{ + return readers.find(g => g.name === 'public') !== undefined; } public ngAfterViewInit() { diff --git a/src/app/components/dynamic-hub/dynamic-hub.component.html b/src/app/components/dynamic-hub/dynamic-hub.component.html index f4806af..3a13131 100644 --- a/src/app/components/dynamic-hub/dynamic-hub.component.html +++ b/src/app/components/dynamic-hub/dynamic-hub.component.html @@ -17,7 +17,10 @@

- {{data.key | titlecase | translate}} {{'dashboards' | translate}} + {{'Dashboards' | translate:{dashboard: data.key | translate} }} + + {{'Public dashboards' | translate }} +

-
+

{{'Collections' | translate}}

diff --git a/src/app/components/dynamic-hub/dynamic-hub.component.scss b/src/app/components/dynamic-hub/dynamic-hub.component.scss index d932a32..8334d4e 100644 --- a/src/app/components/dynamic-hub/dynamic-hub.component.scss +++ b/src/app/components/dynamic-hub/dynamic-hub.component.scss @@ -90,7 +90,7 @@ h2 { } .collection { flex: 1; - + flex-shrink: 0; &-wrapper { height: calc(100vh - ($top-menu-height + $header-height)); position: sticky; diff --git a/src/app/components/dynamic-hub/dynamic-hub.component.ts b/src/app/components/dynamic-hub/dynamic-hub.component.ts index f388d6b..cb9b972 100644 --- a/src/app/components/dynamic-hub/dynamic-hub.component.ts +++ b/src/app/components/dynamic-hub/dynamic-hub.component.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import { KeyValue } from '@angular/common'; import { Component, OnInit, QueryList, ViewChildren } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { UserOrgData } from 'arlas-iam-api'; @@ -24,13 +25,12 @@ import { ActionModalComponent, ArlasIamService, ArlasSettingsService, AuthentificationService, ConfigAction, ConfigActionEnum, PermissionService, PersistenceService } from 'arlas-wui-toolkit'; -import { BehaviorSubject, debounceTime, Observable, of } from 'rxjs'; -import { catchError, filter, map, mergeMap, take, tap } from 'rxjs/operators'; +import { debounceTime, Observable, of } from 'rxjs'; +import { catchError, filter, map, mergeMap, tap } from 'rxjs/operators'; import { Card, CardService } from '../../services/card.service'; +import { DashboardSearchService } from '../../services/dashboard-search.service'; import { Action } from '../card/card.component'; import { HubAction, HubActionEnum, HubActionModalComponent } from '../hub-action-modal/hub-action-modal.component'; -import { KeyValue } from '@angular/common'; -import { DashboardSearchService } from '../../services/dashboard-search.service'; @Component({ selector: 'arlas-dynamic-hub', @@ -131,17 +131,17 @@ export class DynamicHubComponent implements OnInit { this.initSearch(); } - public initSearch(){ + public initSearch() { this.dashboardSearch.valueChanged$ .pipe( - tap(() => this.isLoading = true), + tap(() => this.isLoading = true), debounceTime(500), map((v) => { - this.filterDashboard(v); + this.filterDashboard(v, true); this.isLoading = false; }) ) - .subscribe({error: () => this.isLoading = false}); + .subscribe({ error: () => this.isLoading = false }); } public add(org?: string) { @@ -237,7 +237,7 @@ export class DynamicHubComponent implements OnInit { } public publicAtTheEnd = (a: KeyValue, b: KeyValue): number => { - if (a.key !== this.PUBLIC_ORG && b.key === this.PUBLIC_ORG ) { + if (a.key !== this.PUBLIC_ORG && b.key === this.PUBLIC_ORG) { return -1; } if (a.key === this.PUBLIC_ORG && b.key !== this.PUBLIC_ORG) { @@ -264,8 +264,10 @@ export class DynamicHubComponent implements OnInit { this.canCreateDashboardByOrg.set(o, resources.filter(r => r.verb === 'POST').length > 0); this.allowedOrganisations = this.getAllowedOrganisations(); return this.cardService.cardList(fetchOptions) - .pipe(map(cards => this.filterCardsByOrganisation(cards, o))) - .pipe(tap(cards => this.enrichCards(cards, fetchOptions))); + .pipe( + map(cards => this.enrichCards(cards, fetchOptions)), + map(cards => this.filterCardsByOrganisation(cards, o)) + ); }) ) .subscribe({ @@ -321,7 +323,7 @@ export class DynamicHubComponent implements OnInit { publicCards = []; } this.registerCollection(c); - c.preview$ = this.getPreview$(c.previewId,{}); + c.preview$ = this.getPreview$(c.previewId, {}); this.addCard(c, publicCards); this.cardsRef.set(publicOrg, publicCards); } @@ -351,7 +353,6 @@ export class DynamicHubComponent implements OnInit { .forEach(a => a.url = this.arlasSettingsService.getArlasBuilderUrl().concat('/load/')); this.registerCollection(c); c.preview$ = this.getPreview$(c.previewId, fetchOptions); - c.isPublic = c.readers.find(g => g.name === 'public') !== undefined; }); return cards; } @@ -388,32 +389,29 @@ export class DynamicHubComponent implements OnInit { } else { this.cards = this.cardsRef; } - this.dashboardSearch.buildSearchIndex(this.cards); - this.filterDashboard(this.dashboardSearch.currentFilter); + this.filterDashboard(this.dashboardSearch.currentFilter, true); } - public filterDashboard(searchValue: string, preserveEmptyCardList = false){ - let previous; - if(searchValue){ - previous = this.cardsFiltered; + public filterDashboard(searchValue: string, preserveEmptyCardList = false) { + this.cardsFiltered = this.cards; + if (searchValue) { this.cardsFiltered = new Map(); - this.dashboardSearch - .getMatchingSearchIndices() - .forEach(searchIndex => { - if(this.cardsFiltered.has(searchIndex.key)){ - this.cardsFiltered.get(searchIndex.key).push(this.cards.get(searchIndex.key)[searchIndex.cardIndex]); - } else { - this.cardsFiltered.set(searchIndex.key, [this.cards.get(searchIndex.key)[searchIndex.cardIndex]]); - } - }); - } else { - this.cardsFiltered = this.cards; + const searchResults = this.dashboardSearch.getMatchingSearchIndices(); + searchResults.forEach(searchIndex => { + if (this.cardsFiltered.has(searchIndex.key)) { + this.cardsFiltered.get(searchIndex.key).push(this.cards.get(searchIndex.key)[searchIndex.cardIndex]); + } else { + this.cardsFiltered.set(searchIndex.key, [this.cards.get(searchIndex.key)[searchIndex.cardIndex]]); + } + }); } - if(preserveEmptyCardList && this.cardsFiltered.size === 0){ - previous.forEach((v, k) => { - this.cardsFiltered.set(k, []); + if (preserveEmptyCardList && this.cardsFiltered.size === 0) { + this.cards.forEach((v, k) => { + if (!this.cardsFiltered.has(k)) { + this.cardsFiltered.set(k, []); + } }); } } diff --git a/src/app/services/dashboard-search.service.ts b/src/app/services/dashboard-search.service.ts index 1943a0c..47923f2 100644 --- a/src/app/services/dashboard-search.service.ts +++ b/src/app/services/dashboard-search.service.ts @@ -92,7 +92,7 @@ export class DashboardSearchService { } public splitSearchToKeywords(value: string){ - if(value && value.length > 1){ + if(value && value.length >= 1){ return value.split(' '); } return []; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index d8facfb..7403620 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -1,38 +1,40 @@ { "Back to home page": "Back to home page", - "Private": "Private", - "Public": "Public", - "Shared": "Shared", - "View": "View", - "View_with_params": "View {{dashboard}}", - "Last update": "Last update", - "Last update:": "Last update: {{date}}", - "Viewer": "Viewer", - "Editor": "Editor", - "Menu": "Menu", - "Highlights": "Highlights", - "No Highlights": "No Highlights", - "Organisation": "Organisation", - "Readers": "Readers", - "Writers": "Writers", - "Create a new Exploration Dashboard": "Create a new Exploration Dashboard", - "Import an Exploration Dashboard": "Import a new Exploration Dashboard", - "dashboards": "dashboards", - "No dashboard available": "No dashboard available", - "Collections": "Collections", + "searchPlaceholder": "Search a dashboard...", "Add a new dashboard": "Add a new dashboard", "Name": "Name", + "Organisation": "Organisation", "Create": "Create", "Cancel": "Cancel", "Choose an organisation": "Choose an organisation", "Select": "Select", + "Create a new Exploration Dashboard": "Create a new Exploration Dashboard", + "Import an Exploration Dashboard": "Import a new Exploration Dashboard", + "Dashboards": "Dashboards", + "Public dashboards": "Public dashboards", + "No dashboard available": "No dashboard available", + "Collections": "Collections", + "Remove search text": "Remove search text", + "Private": "Private", + "Public": "Public", + "Shared": "Shared", + "View_with_params": "View {{dashboard}}", + "Menu": "Menu", + "Last update:": "Last update: {{date}}", + "Editor": "Editor", + "Viewer": "Viewer", + "reduce": "Reduce", + "expand": "Expand", "Unauthorized to create a dashboard, you need to log in": "Unauthorized to create or update a dashboard, you need to log in", "Missing permissions to create a dashboard": "Missing permissions to create or update a dashboard", "A configuration with this name exists already, please choose another name": "A dashboard with this name exists already, please choose another name", "An error occurred, please try later": "An error occurred, please try later", - "reduce": "Reduce", - "expand": "Expand", - "Dashboards": "Dashboards", + "View": "View", + "Last update": "Last update", + "Highlights": "Highlights", + "No Highlights": "No Highlights", + "Readers": "Readers", + "Writers": "Writers", "ARLAS Hub": "ARLAS Hub", "User info": "User info", "Log In": "Log In", @@ -63,7 +65,5 @@ "None": "None", "Share configuration": "Share configuration", "no_collection": "Collection undefined", - "Rename": "Rename", - "no_organisation":"", - "searchPlaceholder": "Search a dashboard..." -} + "Rename": "Rename" +} \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index ee725c8..c448da9 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -1,38 +1,40 @@ { "Back to home page": "Retour à l'accueil", - "Private": "Privé", - "Public": "Public", - "Shared": "Partagé", - "View": "Visualiser", - "View_with_params": "Visualiser {{dashboard}}", - "Last update": "Modifié", - "Last update:": "Modifié : {{date}}", - "Editor": "Editeur", - "Viewer": "Visualisateur", - "Menu": "Menu", - "Readers": "Droit de lecture", - "Writers": "Droit d'écriture", - "Highlights": "Analytiques :", - "No Highlights": "Pas d'analytiques définis", - "Organisation": "Organisation", - "Create a new Exploration Dashboard": "Créer un nouveau dashboard d'Exploration", - "Import an Exploration Dashboard": "Importer un nouveau dashboard d'Exploration", - "dashboards": "dashboards", - "No dashboard available": "Pas de dashboard disponible", - "Collections": "Collections", + "searchPlaceholder": "Rechercher un dashboard...", "Add a new dashboard": "Ajouter un nouveau dashboard", "Name": "Nom", + "Organisation": "Organisation", "Create": "Créer", "Cancel": "Annuler", "Choose an organisation": "Choisissez une organisation", "Select": "Sélectionner", + "Create a new Exploration Dashboard": "Créer un nouveau dashboard d'Exploration", + "Import an Exploration Dashboard": "Importer un nouveau dashboard d'Exploration", + "Dashboards": "Dashboards", + "Public dashboards": "Dashboards publics", + "No dashboard available": "Aucun dashboard disponible", + "Collections": "Collections", + "Remove search text": "Réinitialiser la recherche", + "Private": "Privé", + "Public": "Public", + "Shared": "Partagé", + "View_with_params": "Visualiser {{dashboard}}", + "Menu": "Menu", + "Last update:": "Modifié : {{date}}", + "Editor": "Editeur", + "Viewer": "Visualisateur", + "reduce": "Réduire", + "expand": "Déployer", "Unauthorized to create a dashboard, you need to log in": "Impossible de créer ou modifier un dashboard, vous devez être connecté", "Missing permissions to create a dashboard": "Vous n'avez pas les droits suffisants pour créer ou modifier un dashboard", "A configuration with this name exists already, please choose another name": "Un autre dashboad existe déjà avec ce même nom, veuillez en choisir un autre.", "An error occurred, please try later": "Une erreur s'est produite, veuillez réessayer plus tard.", - "reduce": "Réduire", - "expand": "Déployer", - "Dashboards": "Dashboards", + "View": "Visualiser", + "Last update": "Modifié", + "Readers": "Droit de lecture", + "Writers": "Droit d'écriture", + "Highlights": "Analytiques :", + "No Highlights": "Pas d'analytiques définis", "ARLAS Hub": "ARLAS Hub", "User info": "Infos utilisateur", "Log In": "Se connecter", @@ -63,7 +65,5 @@ "None": "Aucun", "Share configuration": "Partager le dashboard", "no_collection": "Collection non définie", - "Rename": "Renommer", - "no_organisation":"", - "searchPlaceholder": "Rechercher un dashboard..." -} + "Rename": "Renommer" +} \ No newline at end of file diff --git a/src/assets/i18n/template.json b/src/assets/i18n/template.json index 7dd9688..e3c924a 100644 --- a/src/assets/i18n/template.json +++ b/src/assets/i18n/template.json @@ -1,31 +1,32 @@ { "Back to home page": "Back to home page", - "Private": "Private", - "Public": "Public", - "Shared": "Shared", - "View": "View", - "Last update:": "Last update:", - "Menu": "Menu", - "Highlights": "Highlights", - "No Highlights": "No Highlights", - "Organisation": "Organisation", - "Readers": "Readers", - "Writers": "Writers", - "Create a new Exploration Dashboard": "Create a new Exploration Dashboard", - "Import an Exploration Dashboard": "Import an Exploration Dashboard", - "dashboards": "dashboards", - "No dashboard available": "No dashboard available", - "Collections": "Collections", + "searchPlaceholder": "searchPlaceholder", "Add a new dashboard": "Add a new dashboard", "Name": "Name", + "Organisation": "Organisation", "Create": "Create", "Cancel": "Cancel", "Choose an organisation": "Choose an organisation", "Select": "Select", + "Create a new Exploration Dashboard": "Create a new Exploration Dashboard", + "Import an Exploration Dashboard": "Import an Exploration Dashboard", + "Dashboards": "Dashboards", + "Public dashboards": "Public dashboards", + "No dashboard available": "No dashboard available", + "Collections": "Collections", + "Remove search text": "Remove search text", + "Private": "Private", + "Public": "Public", + "Shared": "Shared", + "View_with_params": "View_with_params", + "Menu": "Menu", + "Last update:": "Last update:", + "Editor": "Editor", + "Viewer": "Viewer", + "reduce": "reduce", + "expand": "expand", "Unauthorized to create a dashboard, you need to log in": "Unauthorized to create a dashboard, you need to log in", "Missing permissions to create a dashboard": "Missing permissions to create a dashboard", "A configuration with this name exists already, please choose another name": "A configuration with this name exists already, please choose another name", - "An error occurred, please try later": "An error occurred, please try later", - "reduce": "reduce", - "expand": "expand" + "An error occurred, please try later": "An error occurred, please try later" } \ No newline at end of file