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.
fix(quick-filter): Use internal uid for the filter generation.
- Loading branch information
1 parent
93b31b3
commit eafc15c
Showing
23 changed files
with
323 additions
and
171 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
14 changes: 14 additions & 0 deletions
14
apps/components-e2e/src/components/quick-filter/quick-filter-async/quick-filter-async.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,14 @@ | ||
<dt-quick-filter | ||
[dataSource]="_dataSource" | ||
(currentFilterChanges)="currentFilterChanges($event)" | ||
aria-label="Filter By Input value" | ||
label="Filter by" | ||
clearAllLabel="Clear all" | ||
> | ||
<dt-quick-filter-title>Quick-filter</dt-quick-filter-title> | ||
<dt-quick-filter-sub-title> | ||
All options in the filter field above | ||
</dt-quick-filter-sub-title> | ||
|
||
Quick-filter async example | ||
</dt-quick-filter> |
77 changes: 77 additions & 0 deletions
77
apps/components-e2e/src/components/quick-filter/quick-filter-async/quick-filter-async.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,77 @@ | ||
/** | ||
* @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'; | ||
import { isObject } from '@dynatrace/barista-components/core'; | ||
import { | ||
DtQuickFilterDefaultDataSource, | ||
DtQuickFilterDefaultDataSourceConfig, | ||
DtQuickFilterCurrentFilterChangeEvent, | ||
DtQuickFilterDefaultDataSourceType, | ||
} from '@dynatrace/barista-components/experimental/quick-filter'; | ||
|
||
const filterFieldData = { | ||
autocomplete: [ | ||
{ | ||
name: 'AUT (async)', | ||
async: true, | ||
autocomplete: [], | ||
}, | ||
{ | ||
name: 'USA', | ||
autocomplete: [ | ||
{ name: 'San Francisco' }, | ||
{ name: 'Los Angeles' }, | ||
{ name: 'New York' }, | ||
], | ||
}, | ||
], | ||
}; | ||
|
||
const asyncData = { | ||
name: 'AUT (async)', | ||
autocomplete: [{ name: 'Linz' }, { name: 'Vienna' }, { name: 'Graz' }], | ||
}; | ||
|
||
@Component({ | ||
selector: 'dt-e2e-quick-filter-async', | ||
templateUrl: './quick-filter-async.html', | ||
// template: '' | ||
}) | ||
export class DtE2EQuickFilterAsync { | ||
/** configuration for the quick filter */ | ||
private _config: DtQuickFilterDefaultDataSourceConfig = { | ||
// Method to decide if a node should be displayed in the quick filter | ||
showInSidebar: (node) => | ||
isObject(node) && node.name && node.name !== 'AUT (async)', | ||
}; | ||
|
||
_dataSource = new DtQuickFilterDefaultDataSource< | ||
DtQuickFilterDefaultDataSourceType | ||
>(filterFieldData, this._config); | ||
|
||
currentFilterChanges( | ||
event: DtQuickFilterCurrentFilterChangeEvent< | ||
DtQuickFilterDefaultDataSourceType | ||
>, | ||
): void { | ||
if (event.added[0] === filterFieldData.autocomplete[0]) { | ||
setTimeout(() => { | ||
this._dataSource.data = asyncData; | ||
}, 1000); | ||
} | ||
} | ||
} |
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
Empty file.
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
Oops, something went wrong.