This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table): Don't show empty state while loading.
Fixes APM-266048
- Loading branch information
1 parent
2c501b6
commit 9f0130a
Showing
9 changed files
with
137 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/components-e2e/src/components/table/table-simple/table-simple.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<dt-table [dataSource]="dataSource" [loading]="loading"> | ||
<dt-simple-text-column name="name" label="Rule name" sortable="false"> | ||
</dt-simple-text-column> | ||
|
||
<dt-loading-distractor dtTableLoadingState> | ||
Loading... | ||
</dt-loading-distractor> | ||
|
||
<dt-empty-state role="row"> | ||
<dt-empty-state-item role="cell"> | ||
<dt-empty-state-item-title aria-level="1"> | ||
No data that matches your query | ||
</dt-empty-state-item-title> | ||
Amend the timefrime you're querying within or review your query to make | ||
your statement less restrictive. | ||
</dt-empty-state-item> | ||
</dt-empty-state> | ||
|
||
<dt-header-row *dtHeaderRowDef="['name']"></dt-header-row> | ||
<dt-row *dtRowDef="let row; columns: ['name']"></dt-row> | ||
</dt-table> | ||
|
||
<button dt-button (click)="toggleTableData()" id="set-empty-data"> | ||
Toggle table data | ||
</button> | ||
<button dt-button (click)="loading = !loading" id="set-loading"> | ||
Set loading | ||
</button> |
45 changes: 45 additions & 0 deletions
45
apps/components-e2e/src/components/table/table-simple/table-simple.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @license | ||
* Copyright 2020 Dynatrace LLC | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
const DATA = [ | ||
{ name: 'I' }, | ||
{ name: 'II' }, | ||
{ name: 'III' }, | ||
{ name: 'IV' }, | ||
{ name: 'V' }, | ||
]; | ||
|
||
@Component({ | ||
selector: 'dt-e2e-table-simple', | ||
templateUrl: 'table-simple.html', | ||
}) | ||
export class DtE2ETableSimple { | ||
disabled = false; | ||
|
||
loading = false; | ||
|
||
dataSource = DATA; | ||
|
||
toggleTableData(): void { | ||
if (this.dataSource.length === 0) { | ||
this.dataSource = DATA; | ||
} else { | ||
this.dataSource = []; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters