Commit 406e57ce authored by Fernando's avatar Fernando

Additonal code review changes

* Removve uneeded rule-form feature flag check
* Change project to @project in controller
* Simplofy feature flag logic for data function
parent b5888f5f
......@@ -39,7 +39,7 @@ class ProjectsController < Projects::ApplicationController
frontend_experimentation_tracking_data(:new_create_project_ui, 'click_tab')
push_frontend_feature_flag(:new_create_project_ui) if experiment_enabled?(:new_create_project_ui)
push_frontend_feature_flag(:service_desk_custom_address, @project)
push_frontend_feature_flag(:approval_suggestions, project)
push_frontend_feature_flag(:approval_suggestions, @project)
end
layout :determine_layout
......
<script>
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { mapState } from 'vuex';
import { __ } from '~/locale';
import GlModalVuex from '~/vue_shared/components/gl_modal_vuex.vue';
......@@ -10,8 +9,6 @@ export default {
GlModalVuex,
RuleForm,
},
// TODO: Remove feature flag in https://gitlab.com/gitlab-org/gitlab/-/issues/235114
mixins: [glFeatureFlagsMixin()],
props: {
modalId: {
type: String,
......@@ -55,14 +52,11 @@ export default {
size="sm"
@ok.prevent="submit"
>
<!-- TODO: Remove feature flag in https://gitlab.com/gitlab-org/gitlab/-/issues/235114 -->
<rule-form
v-if="glFeatures.approvalSuggestions"
ref="form"
:init-rule="rule"
:is-mr-edit="isMrEdit"
:default-rule-name="defaultRuleName"
/>
<rule-form v-else ref="form" :init-rule="rule" :is-mr-edit="isMrEdit" />
</gl-modal-vuex>
</template>
......@@ -39,23 +39,7 @@ export default {
},
},
data() {
// TODO: Remove feature flag in https://gitlab.com/gitlab-org/gitlab/-/issues/235114
if (this.glFeatures.approvalSuggestions) {
return {
name: this.defaultRuleName || '',
approvalsRequired: 1,
minApprovalsRequired: 0,
approvers: [],
approversToAdd: [],
branches: [],
branchesToAdd: [],
showValidation: false,
isFallback: false,
containsHiddenGroups: false,
...this.getInitialData(),
};
}
return {
const defaults = {
name: '',
approvalsRequired: 1,
minApprovalsRequired: 0,
......@@ -68,6 +52,12 @@ export default {
containsHiddenGroups: false,
...this.getInitialData(),
};
// TODO: Remove feature flag in https://gitlab.com/gitlab-org/gitlab/-/issues/235114
if(this.glFeatures.approvalSuggestions){
return { ...defaults, name: this.defaultRuleName || ''};
}
return defaults
},
computed: {
...mapState(['settings']),
......
<script>
import { camelCase } from 'lodash';
import { GlButton, GlLink, GlSprintf, GlSkeletonLoading } from '@gitlab/ui';
import { LICENSE_CHECK_NAME, VULNERABILITY_CHECK_NAME, JOB_TYPES } from 'ee/approvals/constants';
import { JOB_TYPES } from 'ee/approvals/constants';
export default {
components: {
......@@ -20,7 +20,6 @@ export default {
],
licenseCheck: [JOB_TYPES.LICENSE_SCANNING],
},
securityRules: [VULNERABILITY_CHECK_NAME, LICENSE_CHECK_NAME],
props: {
configuration: {
type: Object,
......
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