Commit b98da2cd authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '341073-update-path' into 'master'

Update path name to policies

See merge request gitlab-org/gitlab!71879
parents 0d3e0ad8 877a3d2a
......@@ -71,7 +71,7 @@ export default {
'networkDocumentationPath',
'noEnvironmentSvgPath',
'projectId',
'threatMonitoringPath',
'policiesPath',
],
props: {
existingPolicy: {
......@@ -188,14 +188,14 @@ export default {
}
return saveFn({ environmentId: this.currentEnvironmentId, policy }).then(() => {
if (!this.errorUpdatingPolicy) redirectTo(this.threatMonitoringPath);
if (!this.errorUpdatingPolicy) redirectTo(this.policiesPath);
});
},
removePolicy() {
const policy = { name: this.existingPolicy.name, manifest: this.yamlEditorValue };
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 {
import(/* webpackChunkName: 'policy_yaml_editor' */ '../policy_yaml_editor.vue'),
},
directives: { GlModal: GlModalDirective, GlTooltip: GlTooltipDirective },
inject: ['threatMonitoringPath'],
inject: ['policiesPath'],
props: {
customSaveButtonText: {
type: String,
......@@ -186,7 +186,7 @@ export default {
:loading="isRemovingPolicy"
>{{ 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
modal-id="delete-modal"
:title="deleteModalTitle"
......
......@@ -24,7 +24,7 @@ export default () => {
networkDocumentationPath,
networkPoliciesEndpoint,
noEnvironmentSvgPath,
threatMonitoringPath,
policiesPath,
policy,
policyType,
projectPath,
......@@ -66,7 +66,7 @@ export default () => {
projectId,
projectPath,
hasEnvironment: isValidEnvironmentId(parseInt(defaultEnvironmentId, 10)),
threatMonitoringPath,
policiesPath,
},
store,
render(createElement) {
......
......@@ -35,7 +35,7 @@ module Projects::Security::PoliciesHelper
policy_type: policy_type,
project_path: project.full_path,
project_id: project.id,
threat_monitoring_path: project_security_policies_path(project)
policies_path: project_security_policies_path(project)
}
end
end
......@@ -52,7 +52,7 @@ describe('NetworkPolicyEditor component', () => {
hasEnvironment: true,
networkDocumentationPath: 'path/to/docs',
noEnvironmentSvgPath: 'path/to/svg',
threatMonitoringPath: '/threat-monitoring',
policiesPath: '/threat-monitoring',
projectId: '21',
...provide,
},
......
......@@ -6,7 +6,7 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
describe('PolicyEditorLayout component', () => {
let wrapper;
let glTooltipDirectiveMock;
const threatMonitoringPath = '/threat-monitoring';
const policiesPath = '/threat-monitoring';
const factory = ({ propsData = {} } = {}) => {
glTooltipDirectiveMock = jest.fn();
......@@ -18,7 +18,7 @@ describe('PolicyEditorLayout component', () => {
...propsData,
},
provide: {
threatMonitoringPath,
policiesPath,
},
stubs: { PolicyYamlEditor: true },
});
......
......@@ -49,7 +49,7 @@ RSpec.describe Projects::Security::PoliciesHelper do
no_environment_svg_path: kind_of(String),
project_path: project.full_path,
project_id: project.id,
threat_monitoring_path: kind_of(String),
policies_path: kind_of(String),
environment_id: environment&.id,
policy: policy&.to_json,
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