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