fix: replace breadcrumb popover with simply expanding the breadcrumbs

This commit is contained in:
Thea Schöbl
2023-02-24 11:34:41 +00:00
parent 66719d6cb7
commit ec2ac250bc
6 changed files with 39 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 StApps
* Copyright (C) 2023 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
@@ -32,10 +32,6 @@ describe('assessments', function () {
cy.visit('/assessments/detail/02f065a6-6c02-58ab-97d9-a3febdbc91a1?token=mock');
cy.get('.breadcrumb-collapsed').click();
cy.get('ion-popover').within(() => {
cy.get('ion-item').should('have.length', 3);
cy.get('ion-item').first().should('contain', 'Basismodule');
cy.get('ion-item').last().should('contain', 'Modellierung');
});
cy.get('ion-breadcrumb').should('have.length', 3);
});
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 StApps
* Copyright (C) 2023 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
@@ -35,6 +35,8 @@ export class DataPathComponent implements OnInit, OnDestroy {
@Input() autoRouting = true;
@Input() maxItems = 2;
@Input() set item(item: SCThings) {
// eslint-disable-next-line unicorn/prefer-ternary
if (item.type === SCThingType.Catalog && item.superCatalogs) {

View File

@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2022 StApps
~ Copyright (C) 2023 StApps
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3.
@@ -18,8 +18,8 @@
color="light"
[itemsBeforeCollapse]="1"
[itemsAfterCollapse]="($width | async) >= 768 ? 1 : 0"
[maxItems]="2"
(ionCollapsedClick)="popover.present($event)"
[maxItems]="maxItems"
(ionCollapsedClick)="maxItems = undefined"
>
<ion-breadcrumb *ngFor="let fragment of stack">
<ion-label
@@ -38,16 +38,4 @@
>
</ion-breadcrumb>
</ion-breadcrumbs>
<ion-popover #popover>
<ng-template>
<ion-list>
<ion-item
button
*ngFor="let fragment of stack"
(click)="dataRoutingService.emitPathEvent(fragment); popover.dismiss()"
>{{ 'name' | thingTranslate: $any(fragment) }}</ion-item
>
</ion-list>
</ng-template>
</ion-popover>
</ng-container>

View File

@@ -1,16 +1,16 @@
/*!
* Copyright (C) 2022 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
* Copyright (C) 2023 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
.crumb-label {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
* Copyright (C) 2023 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Component, Input} from '@angular/core';
import {SCThingWithoutReferences} from '@openstapps/core';
@@ -32,6 +32,8 @@ export class EventRoutePathComponent {
@Input() itemsBeforeCollapse?: number;
@Input() showSelfInPopover = false;
@Input() items: Array<SCThingWithoutReferences | undefined> = [];
@Input() more?: Observable<SCThingWithoutReferences[]>;

View File

@@ -1,5 +1,5 @@
<!--
~ Copyright (C) 2022 StApps
~ Copyright (C) 2023 StApps
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3.
@@ -27,7 +27,7 @@
</ion-breadcrumbs>
<ion-popover #popover>
<ng-template>
<ion-list>
<ion-list lines="none">
<ng-container *ngIf="moreAnchor === 'start' && more | async as more">
<ng-container
*ngFor="let item of more"
@@ -35,11 +35,13 @@
[ngTemplateOutletContext]="{item}"
></ng-container>
</ng-container>
<ng-container
*ngFor="let item of items"
[ngTemplateOutlet]="popoverItem"
[ngTemplateOutletContext]="{item}"
></ng-container>
<ng-container *ngIf="showSelfInPopover">
<ng-container
*ngFor="let item of items"
[ngTemplateOutlet]="popoverItem"
[ngTemplateOutletContext]="{item}"
></ng-container>
</ng-container>
<ng-container *ngIf="moreAnchor === 'end' && more | async as more">
<ng-container
*ngFor="let item of more"