Skip to content

Commit

Permalink
#1454 Fix some queries in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Dec 10, 2020
1 parent 1d507aa commit 7c8fdc2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions frontend/app/scripts/controllers/case/CaseObservablesCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
};

this.$onInit = function() {
$scope.filtering = new FilteringSrv('case_artifact', 'observable.list', {
$scope.filtering = new FilteringSrv('observable', 'observable.list', {
version: 'v1',
defaults: {
showFilters: true,
Expand Down Expand Up @@ -68,7 +68,7 @@
$scope.artifacts = new PaginatedQuerySrv({
name: 'observables',
root: $scope.caseId,
objectType: 'case_artifact',
objectType: 'obserable',
version: 'v1',
scope: $scope,
sort: $scope.filtering.context.sort,
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/scripts/controllers/case/ObservablesStatsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
], {
scope: $scope,
rootId: caseId,
objectType: 'case_artifact',
objectType: 'observable',
query: {
params: {
name: 'observables-by-tags-stats-' + caseId
Expand All @@ -69,7 +69,7 @@
], {
scope: $scope,
rootId: caseId,
objectType: 'case_artifact',
objectType: 'observable',
query: {
params: {
name: 'observables-by-type-stats-' + caseId
Expand All @@ -95,7 +95,7 @@
], {
scope: $scope,
rootId: caseId,
objectType: 'case_artifact',
objectType: 'observable',
query: {
params: {
name: 'observables-by-ioc-stats-' + caseId
Expand Down
6 changes: 6 additions & 0 deletions frontend/app/scripts/services/EntitySrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
caseId: entity.case.id,
itemId: entity.id
};
} else if (entity._type === 'observable') {
state.name = 'app.case.observables-item';
state.params = {
caseId: entity.case.id,
itemId: entity.id
};
} else if (entity._type === 'case_artifact_job') {
state.name = 'app.case.observables-item';
state.params = {
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/scripts/services/api/CortexSrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
streamObjectType: 'case_artifact_job',
filter: {
_parent: {
_type: 'case_artifact',
_type: 'observable',
_query: {
_id: observableId
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/scripts/services/api/TagSrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
switch(entity) {
case 'case':
return self.fromCases(query);
case 'case_artifact':
case 'observable':
return self.fromObservables(query);
case 'alert':
return self.fromAlerts(query);
Expand Down

0 comments on commit 7c8fdc2

Please sign in to comment.