Commit 877a3d2a authored by Alexander Turinske's avatar Alexander Turinske

Update path name to policies

- this matches where the path actually send the user
parent f0590e1d
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
'networkDocumentationPath', 'networkDocumentationPath',
'noEnvironmentSvgPath', 'noEnvironmentSvgPath',
'projectId', 'projectId',
'threatMonitoringPath', 'policiesPath',
], ],
props: { props: {
existingPolicy: { existingPolicy: {
...@@ -188,14 +188,14 @@ export default { ...@@ -188,14 +188,14 @@ export default {
} }
return saveFn({ environmentId: this.currentEnvironmentId, policy }).then(() => { return saveFn({ environmentId: this.currentEnvironmentId, policy }).then(() => {
if (!this.errorUpdatingPolicy) redirectTo(this.threatMonitoringPath); if (!this.errorUpdatingPolicy) redirectTo(this.policiesPath);
}); });
}, },
removePolicy() { removePolicy() {
const policy = { name: this.existingPolicy.name, manifest: this.yamlEditorValue }; const policy = { name: this.existingPolicy.name, manifest: this.yamlEditorValue };
return this.deletePolicy({ environmentId: this.currentEnvironmentId, policy }).then(() => { return this.deletePolicy({ environmentId: this.currentEnvironmentId, policy }).then(() => {
if (!this.errorRemovingPolicy) redirectTo(this.threatMonitoringPath); if (!this.errorRemovingPolicy) redirectTo(this.policiesPath);
}); });
}, },
}, },
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
import(/* webpackChunkName: 'policy_yaml_editor' */ '../policy_yaml_editor.vue'), import(/* webpackChunkName: 'policy_yaml_editor' */ '../policy_yaml_editor.vue'),
}, },
directives: { GlModal: GlModalDirective, GlTooltip: GlTooltipDirective }, directives: { GlModal: GlModalDirective, GlTooltip: GlTooltipDirective },
inject: ['threatMonitoringPath'], inject: ['policiesPath'],
props: { props: {
customSaveButtonText: { customSaveButtonText: {
type: String, type: String,
...@@ -186,7 +186,7 @@ export default { ...@@ -186,7 +186,7 @@ export default {
:loading="isRemovingPolicy" :loading="isRemovingPolicy"
>{{ s__('NetworkPolicies|Delete policy') }}</gl-button >{{ s__('NetworkPolicies|Delete policy') }}</gl-button
> >
<gl-button category="secondary" :href="threatMonitoringPath">{{ __('Cancel') }}</gl-button> <gl-button category="secondary" :href="policiesPath">{{ __('Cancel') }}</gl-button>
<gl-modal <gl-modal
modal-id="delete-modal" modal-id="delete-modal"
:title="deleteModalTitle" :title="deleteModalTitle"
......
...@@ -24,7 +24,7 @@ export default () => { ...@@ -24,7 +24,7 @@ export default () => {
networkDocumentationPath, networkDocumentationPath,
networkPoliciesEndpoint, networkPoliciesEndpoint,
noEnvironmentSvgPath, noEnvironmentSvgPath,
threatMonitoringPath, policiesPath,
policy, policy,
policyType, policyType,
projectPath, projectPath,
...@@ -66,7 +66,7 @@ export default () => { ...@@ -66,7 +66,7 @@ export default () => {
projectId, projectId,
projectPath, projectPath,
hasEnvironment: isValidEnvironmentId(parseInt(defaultEnvironmentId, 10)), hasEnvironment: isValidEnvironmentId(parseInt(defaultEnvironmentId, 10)),
threatMonitoringPath, policiesPath,
}, },
store, store,
render(createElement) { render(createElement) {
......
...@@ -35,7 +35,7 @@ module Projects::Security::PoliciesHelper ...@@ -35,7 +35,7 @@ module Projects::Security::PoliciesHelper
policy_type: policy_type, policy_type: policy_type,
project_path: project.full_path, project_path: project.full_path,
project_id: project.id, project_id: project.id,
threat_monitoring_path: project_security_policies_path(project) policies_path: project_security_policies_path(project)
} }
end end
end end
...@@ -52,7 +52,7 @@ describe('NetworkPolicyEditor component', () => { ...@@ -52,7 +52,7 @@ describe('NetworkPolicyEditor component', () => {
hasEnvironment: true, hasEnvironment: true,
networkDocumentationPath: 'path/to/docs', networkDocumentationPath: 'path/to/docs',
noEnvironmentSvgPath: 'path/to/svg', noEnvironmentSvgPath: 'path/to/svg',
threatMonitoringPath: '/threat-monitoring', policiesPath: '/threat-monitoring',
projectId: '21', projectId: '21',
...provide, ...provide,
}, },
......
...@@ -6,7 +6,7 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; ...@@ -6,7 +6,7 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
describe('PolicyEditorLayout component', () => { describe('PolicyEditorLayout component', () => {
let wrapper; let wrapper;
let glTooltipDirectiveMock; let glTooltipDirectiveMock;
const threatMonitoringPath = '/threat-monitoring'; const policiesPath = '/threat-monitoring';
const factory = ({ propsData = {} } = {}) => { const factory = ({ propsData = {} } = {}) => {
glTooltipDirectiveMock = jest.fn(); glTooltipDirectiveMock = jest.fn();
...@@ -18,7 +18,7 @@ describe('PolicyEditorLayout component', () => { ...@@ -18,7 +18,7 @@ describe('PolicyEditorLayout component', () => {
...propsData, ...propsData,
}, },
provide: { provide: {
threatMonitoringPath, policiesPath,
}, },
stubs: { PolicyYamlEditor: true }, stubs: { PolicyYamlEditor: true },
}); });
......
...@@ -49,7 +49,7 @@ RSpec.describe Projects::Security::PoliciesHelper do ...@@ -49,7 +49,7 @@ RSpec.describe Projects::Security::PoliciesHelper do
no_environment_svg_path: kind_of(String), no_environment_svg_path: kind_of(String),
project_path: project.full_path, project_path: project.full_path,
project_id: project.id, project_id: project.id,
threat_monitoring_path: kind_of(String), policies_path: kind_of(String),
environment_id: environment&.id, environment_id: environment&.id,
policy: policy&.to_json, policy: policy&.to_json,
policy_type: policy_type policy_type: policy_type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment