feat: apply new layout overhaul

This commit is contained in:
Andy Bastian
2022-08-08 11:01:00 +00:00
committed by Rainer Killinger
parent f16e5394cc
commit 7bbdba5c0b
228 changed files with 28387 additions and 1092 deletions

View File

@@ -13,11 +13,12 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Component, Input, OnInit, OnDestroy} from '@angular/core';
import {Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router';
import {Keyboard} from '@capacitor/keyboard';
import {AlertController} from '@ionic/angular';
import {
SCFacet,
SCFeatureConfiguration,
SCSearchFilter,
SCSearchQuery,
SCSearchSort,
@@ -31,6 +32,7 @@ import {SettingsProvider} from '../../settings/settings.provider';
import {DataRoutingService} from '../data-routing.service';
import {DataProvider} from '../data.provider';
import {PositionService} from '../../map/position.service';
import {ConfigProvider} from '../../config/config.provider';
/**
* SearchPageComponent queries things and shows list of things as search results and filter as context menu
@@ -38,14 +40,24 @@ import {PositionService} from '../../map/position.service';
@Component({
selector: 'stapps-search-page',
templateUrl: 'search-page.html',
styleUrls: ['search-page.scss'],
providers: [ContextMenuService],
})
export class SearchPageComponent implements OnInit, OnDestroy {
title = 'search.title';
isHebisAvailable = false;
/**
* Signalizes that the data is being loaded
*/
loading = false;
/**
* Display the navigation between default and library search
*/
@Input() showNavigation = true;
/**
* Show default data (e.g. when there is user interaction)
*/
@@ -56,6 +68,11 @@ export class SearchPageComponent implements OnInit, OnDestroy {
*/
@Input() showDrawer = true;
/**
* Show "universal search" toolbar
*/
@Input() showTopToolbar = true;
/**
* Api query filter
*/
@@ -131,7 +148,9 @@ export class SearchPageComponent implements OnInit, OnDestroy {
* @param logger An angular logger
* @param dataRoutingService DataRoutingService
* @param router Router
* @param route ActivatedRoute
* @param positionService PositionService
* @param configProvider ConfigProvider
*/
constructor(
protected readonly alertController: AlertController,
@@ -141,7 +160,9 @@ export class SearchPageComponent implements OnInit, OnDestroy {
protected readonly logger: NGXLogger,
protected dataRoutingService: DataRoutingService,
protected router: Router,
private readonly route: ActivatedRoute,
protected positionService: PositionService,
private readonly configProvider: ConfigProvider,
) {}
/**
@@ -314,10 +335,29 @@ export class SearchPageComponent implements OnInit, OnDestroy {
),
this.dataRoutingService.itemSelectListener().subscribe(item => {
if (this.itemRouting) {
void this.router.navigate(['data-detail', item.uid]);
void this.router.navigate(['/data-detail', item.uid]);
}
}),
);
try {
const features = this.configProvider.getValue(
'features',
) as SCFeatureConfiguration;
this.isHebisAvailable = !!features.plugins?.['hebis-plugin']?.urlPath;
} catch (error) {
this.logger.error(error);
}
}
/**
* Initialize
*/
async ionViewWillEnter() {
const term = this.route.snapshot.paramMap.get('term') || undefined;
if (term) {
this.queryText = term;
this.searchStringChanged(term);
}
}
ngOnDestroy() {