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

Display 'No matching feature flags found' message when no flags found from search #1906

Merged
merged 9 commits into from
Sep 11, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@
<!-- No Data Row -->
<tr *matNoDataRow>
<td class="ft-14-400" [attr.colspan]="displayedColumns.length">
{{ 'feature-flags.no-flags-in-table.text' | translate }}
<ng-container *ngIf="(isSearchActive$ | async); else noFlags">
{{ 'feature-flags.no-matching-flags.text' | translate }}
</ng-container>
<ng-template #noFlags>
{{ 'feature-flags.no-flags-in-table.text' | translate }}
</ng-template>
</td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { FEATURE_FLAG_STATUS, FILTER_MODE } from 'upgrade_types';
export class FeatureFlagRootSectionCardTableComponent implements OnInit {
@Input() dataSource$: MatTableDataSource<FeatureFlag>;
@Input() isLoading$: Observable<boolean>;
@Input() isSearchActive$: Observable<boolean>;
flagSortKey$ = this.featureFlagsService.sortKey$;
flagSortAs$ = this.featureFlagsService.sortAs$;
warningStatusForAllFlags$ = this.featureFlagsService.warningStatusForAllFlags$;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
<ng-template #table>
<div class="table-container">
<app-feature-flag-root-section-card-table
[dataSource$]="dataSource$ | async"
[isLoading$]="isLoadingFeatureFlags$"
[dataSource$]="dataSource$ | async"
[isLoading$]="isLoadingFeatureFlags$"
[isSearchActive$]="isSearchActive$"
>
</app-feature-flag-root-section-card-table>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { FLAG_SEARCH_KEY, IMenuButtonItem } from 'upgrade_types';
import { RouterModule } from '@angular/router';
import { MatTableDataSource } from '@angular/material/table';
import { DialogService } from '../../../../../../../shared/services/common-dialog.service';
import { Observable, Subscription, map } from 'rxjs';
import { Observable, map } from 'rxjs';
import { FeatureFlag } from '../../../../../../../core/feature-flags/store/feature-flags.model';
import { CommonSearchWidgetSearchParams } from '../../../../../../../shared-standalone-component-lib/components/common-section-card-search-header/common-section-card-search-header.component';
import {
Expand Down Expand Up @@ -49,6 +49,7 @@ export class FeatureFlagRootSectionCardComponent {
searchKey$ = this.featureFlagService.searchKey$;
searchParams$ = this.featureFlagService.searchParams$;
selectRootTableState$ = this.featureFlagService.selectRootTableState$;
isSearchActive$: Observable<boolean> = this.searchString$.pipe(map((searchString) => !!searchString));

featureFlagFilterOption = [
FLAG_SEARCH_KEY.ALL,
Expand Down
1 change: 1 addition & 0 deletions frontend/projects/upgrade/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@
"feature-flags.link.text": "featureflags",
"feature-flags.no-flags.text": "Welcome! <br> Let's start by creating a new flag!",
"feature-flags.no-flags-in-table.text": "No feature flags is defined. Create a new feature flag.",
"feature-flags.no-matching-flags.text": "No matching feature flags found.",
"feature-flags.delete-flag.message.text": "Type the name of feature flag to confirm deletion:",
"feature-flags.delete-flag.input-placeholder.text": "Feature flag name",
"feature-flags.import-flag-modal.compatibility-description.incompatible.text": "This JSON file cannot be imported because it lacks required properties or it incorrectly formatted for the feature flag. Please ensure it is the correct file.",
Expand Down
Loading