Skip to content

Commit

Permalink
feat: add back devs of hub 26.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedHamouGisaia authored and QuCMGisaia committed Dec 18, 2024
1 parent 70caaf4 commit ac538d1
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 110 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<img src="assets/hub-icon.png"/>
</a>
</div>
<arlas-dashboard-search *ngIf="displayMenu" class="search" [searchPlaceholder]="'searchPlaceholder'"></arlas-dashboard-search>
<arlas-dashboard-search *ngIf="displayMenu" class="search" [searchPlaceholder]="'searchPlaceholder' | marker"></arlas-dashboard-search>
</div>
<div right-menu class="title" id="title">
<mat-divider vertical class="vertical-divider"></mat-divider>
Expand Down
8 changes: 6 additions & 2 deletions src/app/components/card/card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { AfterViewInit, Component, Input, OnInit, Output, ViewChild } from '@angular/core';
import { ConfigActionEnum, ConfigMenuComponent, NO_ORGANISATION } from 'arlas-wui-toolkit';
import { Subject } from 'rxjs';
import { Card } from '../../services/card.service';
import { Card, Group } from '../../services/card.service';


export enum Action {
Expand Down Expand Up @@ -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() {
Expand Down
7 changes: 5 additions & 2 deletions src/app/components/dynamic-hub/dynamic-hub.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
<div class="dashboards">
<div class="dashboard" *ngFor="let data of cardsFiltered | keyvalue : publicAtTheEnd " >
<h2>
<span class="dashboard-title">{{data.key | titlecase | translate}} {{'dashboards' | translate}}</span>
<span class="dashboard-title" *ngIf="data.key !== 'public'; else publicTitle">{{'Dashboards' | translate:{dashboard: data.key | translate} }}</span>
<ng-template #publicTitle>
<span class="dashboard-title">{{'Public dashboards' | translate }}</span>
</ng-template>
<ng-container *ngIf="data.key | getValue:canCreateDashboardByOrg">
<button class="add-button" mat-stroked-button (click)="add(data.key)"
[matTooltip]="'Create a new Exploration Dashboard' | translate">
Expand All @@ -40,7 +43,7 @@ <h2>
</div>


<div class="collection" *ngIf="cards?.size > 0">
<div class="collection" *ngIf="isLoading || !isLoading && cards?.size > 0">
<div class="collection-wrapper" [class.collection--without-edit-header]="!canCreateDashboard">
<h2>{{'Collections' | translate}}</h2>
<div class="cards">
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dynamic-hub/dynamic-hub.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ h2 {
}
.collection {
flex: 1;

flex-shrink: 0;
&-wrapper {
height: calc(100vh - ($top-menu-height + $header-height));
position: sticky;
Expand Down
58 changes: 28 additions & 30 deletions src/app/components/dynamic-hub/dynamic-hub.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from 'arlas-wui-toolkit';
import { BehaviorSubject, debounceTime, Observable, of } from 'rxjs';
import { catchError, filter, map, mergeMap, take, tap } from 'rxjs/operators';
import { Card, CardService } from '../../services/card.service';
import { Card, CardService, Group } from '../../services/card.service';
import { Action } from '../card/card.component';
import { HubAction, HubActionEnum, HubActionModalComponent } from '../hub-action-modal/hub-action-modal.component';
import { KeyValue } from '@angular/common';
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -237,7 +237,7 @@ export class DynamicHubComponent implements OnInit {
}

public publicAtTheEnd = (a: KeyValue<string, Card[]>, b: KeyValue<string, Card[]>): 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) {
Expand All @@ -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({
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<string, Card[]>();
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, []);
}
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/dashboard-search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand Down
54 changes: 27 additions & 27 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -63,7 +65,5 @@
"None": "None",
"Share configuration": "Share configuration",
"no_collection": "Collection undefined",
"Rename": "Rename",
"no_organisation":"",
"searchPlaceholder": "Search a dashboard..."
}
"Rename": "Rename"
}
54 changes: 27 additions & 27 deletions src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
}
Loading

0 comments on commit ac538d1

Please sign in to comment.