Skip to content

Commit

Permalink
bugfixed dropdown clear issue and omnisearch redirection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ritesh74 committed Aug 14, 2019
1 parent 07270f4 commit 295db15
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ export class AssetListComponent implements OnInit, OnDestroy {
this.filterTagOptions = response[0].response;
this.filterTagLabels = _.map(response[0].response, 'name');
});

} catch (error) {
this.errorMessage = this.errorHandling.handleJavascriptError(error);
this.logger.log('error', error);
Expand All @@ -800,9 +801,6 @@ export class AssetListComponent implements OnInit, OnDestroy {
return el.compareKey === this.currentFilterType.optionValue.toLowerCase().trim();
}
);
this.filterTagOptions = [];
this.filterTagLabels = [];
this.currentFilterType = null;
}
this.getUpdatedUrl();
this.utils.clickClearDropdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,6 @@ export class CertificatesComponent implements OnInit, OnDestroy {
(el) => {
return el.compareKey === this.currentFilterType.optionValue.toLowerCase().trim();
});
this.filterTagOptions = [];
this.filterTagLabels = [];
this.currentFilterType = null;
}
this.getUpdatedUrl();
this.utils.clickClearDropdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ export class ComplianceDashboardComponent implements OnInit, OnDestroy {
}, (el) => {
return el.key === this.currentFilterType.optionName;
});
this.currentFilterType = null;
this.filterTagOptions = [];
this.filterTagLabels = [];
this.updateComponent();
}
this.utils.clickClearDropdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,6 @@ export class IssueListingComponent implements OnInit, OnDestroy {
return el.compareKey === this.currentFilterType.optionValue.toLowerCase().trim();
}
);
this.filterTagOptions = [];
this.filterTagLabels = [];
this.currentFilterType = null;
}
this.getUpdatedUrl();
this.utils.clickClearDropdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ export class VulnerabilitiesComplianceComponent implements OnInit, OnDestroy {
this.selectComplianceDropdown.updateCompliance(
this.utils.arrayToObject(this.filters, 'filterkey', 'value')
);
this.filterTagOptions = [];
this.filterTagLabels = [];
this.currentFilterType = null;
}
this.utils.clickClearDropdown();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,6 @@ export class VulnerabilitiesComponent implements OnInit, OnDestroy {
return el.compareKey === this.currentFilterType.optionValue.toLowerCase().trim();
}
);
this.filterTagOptions = [];
this.filterTagLabels = [];
this.currentFilterType = null;
}
this.getUpdatedUrl();
this.utils.clickClearDropdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,29 +775,44 @@ export class OmniSearchDetailsComponent implements OnInit, OnDestroy {
}

if (data['searchCategory'].toLowerCase() === 'assets') {
this.router.navigate(
['pl', { outlets: { details: ['assets-details', resourceType, resourceID] } }],
{
queryParamsHandling: 'merge'
}
);

this.router.navigate(
['../../../../assets/assets-details', resourceType, resourceID],
{ relativeTo: this.activatedRoute, queryParamsHandling: 'merge' }
).then(response => {
this.logger.log('info', 'Successfully navigated to asset details page: ' + response);
})
.catch(error => {
this.logger.log('error', 'Error in navigation - ' + error);
});

} else if (data['searchCategory'].toLowerCase() === 'policy violations') {
this.router.navigate(
['pl', { outlets: { details: ['issue-details', resourceID] } }],
{
this.router.navigate(['../../../../compliance/issue-details', resourceID], {
relativeTo: this.activatedRoute,
queryParamsHandling: 'merge'
}
);
}).then(response => {
this.logger.log('info', 'Successfully navigated to issue details page: ' + response);
})
.catch(error => {
this.logger.log('error', 'Error in navigation - ' + error);
});
} else if (data['searchCategory'].toLowerCase() === 'vulnerabilities') {
const apiTarget = { TypeAsset: 'vulnerable' };
const eachParams = { qid: resourceID }; // resourceID is qid here
let newParams = this.utils.makeFilterObj(eachParams);
newParams = Object.assign(newParams, apiTarget);
newParams['mandatory'] = 'qid';
this.router.navigate(['pl', { outlets: { details: ['asset-list'] } }], {
queryParams: newParams,
queryParamsHandling: 'merge'
});
const apiTarget = { TypeAsset: 'vulnerable' };
const eachParams = { qid: resourceID }; // resourceID is qid here
let newParams = this.utils.makeFilterObj(eachParams);
newParams = Object.assign(newParams, apiTarget);
newParams['mandatory'] = 'qid';
this.router.navigate(['../../../../', 'assets', 'asset-list'], {
relativeTo: this.activatedRoute,
queryParams: newParams,
queryParamsHandling: 'merge'
})
.then(response => {
this.logger.log('info', 'Successfully navigated to issue details page: ' + response);
})
.catch(error => {
this.logger.log('error', 'Error in navigation - ' + error);
});
}
} catch (error) {
this.errorMessage = this.errorHandling.handleJavascriptError(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
text-align: left;
}

.tagging-instances-content /deep/ .table-cells {
max-width: 300px;
.cost-table-wrapper /deep/ .table-cells {
max-width: 500px;
width: 100% !important;
}

Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@
color: #555;
font-size: 1em;
}
.tagging-instances-container /deep/ .table-cells {
max-width: 500px;
width: 100% !important;
}
9 changes: 9 additions & 0 deletions webapp/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1875,4 +1875,13 @@ img.trend-img-holder {
.ngx-dropdown-list-container hr {
display: none;
}
.available-items li:hover {
background: #e20074;
color: white !important;
transition: all 500ms ease;
}
.available-items li {
padding-top:.3em !important;
padding-bottom:.3em !important;
}

0 comments on commit 295db15

Please sign in to comment.