You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/07/24 12:27:32 UTC
[incubator-dlab] 02/02: [DLAB-930]: added filter matches message
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-814
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 86ddec274ec475c7180331be36ade37d7cc4751f
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Wed Jul 24 15:27:18 2019 +0300
[DLAB-930]: added filter matches message
---
.../resources/resources-grid/resources-grid.component.html | 13 +++++++++----
.../resources/resources-grid/resources-grid.component.ts | 14 ++++++--------
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
index 772490d..c0aa2f6 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.html
@@ -181,15 +181,20 @@
</th>
</ng-container>
<ng-container matColumnDef="placeholder">
- <td mat-footer-cell *matFooterCellDef colspan="6" class="info">
- To start working, please, create new environment
+ <td mat-footer-cell *matFooterCellDef
+ [colSpan]="!healthStatus?.billingEnabled ? displayedFilterColumns.length -1 : displayedFilterColumns.length"
+ class="info">
+ <span *ngIf="(!filteredEnvironments) && !filtering || (filteredEnvironments.length == 0) && !filtering">
+ To start working, please, create new environment</span>
+ <span *ngIf="(filteredEnvironments.length == 0) && filtering">No matches found</span>
</td>
</ng-container>
+
<!-- FILTER END -->
<tr mat-header-row *matHeaderRowDef="displayedColumns" class="header-row"></tr>
- <tr [hidden]="collapsedFilterRow" mat-header-row *matHeaderRowDef="displayedFilterColumns; sticky: true"
+ <tr [hidden]="!collapsedFilterRow" mat-header-row *matHeaderRowDef="displayedFilterColumns; sticky: true"
class="filter-row"></tr>
<tr mat-row *matRowDef="let element; columns: ['project']" class="element-row"
@@ -197,9 +202,9 @@
(click)="expandedElement = expandedElement === element ? null : element">
</tr>
<tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="detail-row"></tr>
+
<tr [hidden]="filteredEnvironments?.length" mat-footer-row *matFooterRowDef="['placeholder']"></tr>
</table>
-
</section>
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
index 65b31ad..1a71c11 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
@@ -106,6 +106,7 @@ export class ResourcesGridComponent implements OnInit {
public buildGrid(): void {
this.userResourceService.getUserProvisionedResources()
.subscribe((result: any) => {
+ this.filtering = false;
this.environments = ExploratoryModel.loadEnvironments(result);
this.getDefaultFilterConfiguration();
(this.environments.length) ? this.getUserPreferences() : this.filteredEnvironments = [];
@@ -142,15 +143,14 @@ export class ResourcesGridComponent implements OnInit {
}
private applyFilter_btnClick(config: FilterConfigurationModel) {
- this.filtering = true;
let filteredData = this.getEnvironmentsListCopy();
-
const containsStatus = (list, selectedItems) => {
return list.filter((item: any) => { if (selectedItems.indexOf(item.status) !== -1) return item; });
};
- if (config)
+ if (filteredData.length) this.filtering = true;
+ if (config) {
filteredData = filteredData.filter(project => {
project.exploratory = project.exploratory.filter(item => {
@@ -174,7 +174,9 @@ export class ResourcesGridComponent implements OnInit {
return project.exploratory.length > 0;
});
- config && this.updateUserPreferences(config);
+ this.updateUserPreferences(config);
+ }
+
this.filteredEnvironments = filteredData;
}
@@ -314,8 +316,4 @@ export class ResourcesGridComponent implements OnInit {
.afterClosed().subscribe(() => this.buildGrid());
}
}
-
-
-
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org