Skip to content

Commit a44586d

Browse files
xingzhang-suserushk014
authored andcommitted
NVSHAS-10056: Exporting response rules on UI bugs
1 parent 2618ad8 commit a44586d

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

admin/src/main/scala/com/neu/service/policy/PolicyService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class PolicyService() extends BaseService with DefaultJsonFormats with LazyLoggi
175175
logger.info("Export sensors")
176176
complete {
177177
RestClient.httpRequestWithHeader(
178-
s"${baseClusterUri(tokenId)}/file/dlp",
178+
s"${baseClusterUri(tokenId)}/file/response/rule",
179179
POST,
180180
exportedResponseRuleToJson(exportedResponseRuleList),
181181
tokenId

admin/webapp/websrc/app/common/services/response-rules.service.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,14 @@ export class ResponseRulesService {
4141
headerName: this.translate.instant('responsePolicy.gridHeader.ID'),
4242
field: 'id',
4343
headerCheckboxSelection: params =>
44-
source ===
45-
GlobalConstant.NAV_SOURCE.SELF,
44+
source === GlobalConstant.NAV_SOURCE.SELF,
4645
headerCheckboxSelectionFilteredOnly: params =>
47-
params.context.componentParent.source ===
48-
GlobalConstant.NAV_SOURCE.SELF,
46+
params.context.componentParent.source ===
47+
GlobalConstant.NAV_SOURCE.SELF,
4948
cellRenderer: params => {
5049
if (params.value)
5150
return `<span class="${
52-
source === GlobalConstant.NAV_SOURCE.SELF
53-
? 'left-margin-32'
54-
: ''
51+
source === GlobalConstant.NAV_SOURCE.SELF ? 'left-margin-32' : ''
5552
}">
5653
${params.value}
5754
</span>`;

admin/webapp/websrc/app/routes/components/export-options/export-options.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
</div>
4343
<hr class="my-2" *ngIf="source === 'group'" />
4444
<mat-checkbox
45+
*ngIf="isShowingUserRef"
4546
[checked]="useNameRef"
4647
(change)="toggleNameRef($event)"
4748
class="mr-3 my-2">

admin/webapp/websrc/app/routes/components/export-options/export-options.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms';
33
import { SettingsService } from '@services/settings.service';
44
import { map } from 'rxjs/operators';
55
import { TranslateService } from '@ngx-translate/core';
6+
import { GlobalConstant } from '@common/constants/global.constant';
67

78
@Component({
89
selector: 'app-export-options',
@@ -16,6 +17,7 @@ export class ExportOptionsComponent implements OnInit {
1617

1718
exportOptionsForm!: FormGroup;
1819
remoteRepoEnabled = false;
20+
isShowingUserRef = true;
1921
useNameRef = false;
2022

2123
constructor(
@@ -33,7 +35,9 @@ export class ExportOptionsComponent implements OnInit {
3335
file_path: [this.exportFileName],
3436
comment: [''],
3537
});
36-
38+
this.isShowingUserRef =
39+
this.exportFileName !==
40+
GlobalConstant.REMOTE_EXPORT_FILENAME.RESPONSE_RULES;
3741
this.exportOptions?.addControl('export_options', this.exportOptionsForm);
3842
this.getRemoteRepositories();
3943
}

admin/webapp/websrc/app/routes/components/response-rules/response-rules.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ export class ResponseRulesComponent implements OnInit, OnDestroy {
7676
this.isWriteResponseRuleAuthorized,
7777
this.source
7878
);
79-
this.gridOptions.onSelectionChanged =
80-
this.onSelectionChanged4ResponseRules;
79+
this.gridOptions.onSelectionChanged = this.onSelectionChanged4ResponseRules;
8180
this.gridOptions.onGridReady = params => {
8281
const $win = $(GlobalVariable.window);
8382
if (params && params.api) {
@@ -183,8 +182,8 @@ export class ResponseRulesComponent implements OnInit, OnDestroy {
183182
data: {
184183
importUrl: PathConstant.RESPONSE_RULE_IMPORT_URL,
185184
importMsg: {
186-
success: this.translate.instant('waf.msg.IMPORT_FINISH'),
187-
error: this.translate.instant('waf.msg.IMPORT_FAILED'),
185+
success: this.translate.instant('responsePolicy.message.IMPORT_OK'),
186+
error: this.translate.instant('responsePolicy.message.IMPORT_NG'),
188187
},
189188
},
190189
});

admin/webapp/websrc/assets/i18n/en-common.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,9 @@
26222622
"ADD_CRITERIA_VALUE": "Enter certain value of criteria",
26232623
"ADD_CRITERIA": "Add Criteria",
26242624
"EXPORT_OK": "Respnose rules is exported successfully!",
2625-
"EXPORT_NG": "Respnose rules exporting failed!"
2625+
"EXPORT_NG": "Respnose rules exporting failed!",
2626+
"IMPORT_OK": "Respnose rules is imported successfully!",
2627+
"IMPORT_NG": "Respnose rules importing failed!"
26262628
},
26272629
"dialog": {
26282630
"content": {

0 commit comments

Comments
 (0)