Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(geo): changer l'affichage de Query du liste collapse ver afficha… #1156

Merged
merged 5 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<igo-list [navigation]="true">
<igo-list [navigation]="true" *ngIf="tabsMode === false">
<ng-template
#groupTemplate
ngFor let-group
Expand Down Expand Up @@ -48,3 +48,51 @@
</ng-template>

</igo-list>

<igo-list [navigation]="true" *ngIf="tabsMode">

<ng-container *ngIf="mode === searchResultMode.Grouped; then tabsTemplate else flatTemplate"></ng-container>

<ng-template #tabsTemplate>
<mat-tab-group class="custom-tabs-view" dynamicHeight>
<mat-tab *ngFor="let group of results$ | async" [label]="computeGroupTitle(group)">
<ng-container *ngTemplateOutlet="storeItemTemplate; context: {group: group}"></ng-container>
</mat-tab>
</mat-tab-group>
</ng-template>

<ng-template #flatTemplate>
<ng-template ngFor let-group [ngForOf]="results$ | async">
<ng-container *ngTemplateOutlet="storeItemTemplate; context: {group: group}"></ng-container>
</ng-template>
</ng-template>

<ng-template #storeItemTemplate let-group="group">
<ng-template ngFor let-result [ngForOf]="group.results">
<igo-search-results-item
igoListItem
color="accent"
[map]="map"
[result]="result"
[showIcons]="showIcons"
[withZoomButton]="withZoomButton"
[focused]="store.state.get(result).focused"
[selected]="store.state.get(result).selected"
(focus)="resultFocus.emit(result)"
(unfocus)="resultUnfocus.emit(result)"
(select)="onResultSelect(result)"
(mouseenter)="resultFocus.emit(result)"
(mouseleave)="resultUnfocus.emit(result)">

<ng-container igoSearchItemToolbar
[ngTemplateOutlet]="templateSearchToolbar"
[ngTemplateOutletContext]="{result: result}">
</ng-container>

</igo-search-results-item>
</ng-template>
<span class="moreResults mat-typography" *ngIf="isMoreResults(group)" (click)="displayMoreResults(group)">
<u>{{ 'igo.geo.search.displayMoreResults' | translate }}</u>
</span>
</ng-template>
</igo-list>
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@

igo-list ::ng-deep mat-list {
height: 100%;
.custom-tabs-view .mat-tab-header-pagination {
min-width: 20px;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ export class SearchResultsComponent implements OnInit, OnDestroy {
*/
@Input() withZoomButton = false;

/**
* To check if the view for tabsMode for search-result-tools
*/
@Input() tabsMode: boolean = false;

/**
* Search term
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatListModule } from '@angular/material/list';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatTabsModule } from '@angular/material/tabs';
import { MatDialogModule } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { ReactiveFormsModule } from '@angular/forms';
Expand Down Expand Up @@ -38,6 +39,7 @@ import { SaveFeatureDialogComponent } from './save-feature-dialog.component';
MatIconModule,
MatListModule,
MatButtonModule,
MatTabsModule,
MatDialogModule,
IgoCollapsibleModule,
IgoListModule,
Expand Down