Commit 96825378 authored by Justin Ho's avatar Justin Ho

Hide old form when feature flag is enabled

Add checkbox titles to fix spec
parent c976e8d3
<script>
import { startCase, isEmpty } from 'lodash';
import { capitalize, lowerCase, isEmpty } from 'lodash';
import { __, sprintf } from '~/locale';
import { GlFormGroup, GlFormCheckbox, GlFormInput, GlFormSelect, GlFormTextarea } from '@gitlab/ui';
......@@ -73,14 +73,15 @@ export default {
return this.isPassword && !isEmpty(this.value);
},
label() {
const title = this.title || startCase(this.name);
if (this.isNonEmptyPassword) {
return sprintf(__('Enter new %{field_title}'), {
password: title,
field_title: this.humanizedTitle,
});
}
return title;
return this.humanizedTitle;
},
humanizedTitle() {
return this.title || capitalize(lowerCase(this.name));
},
passwordRequired() {
return isEmpty(this.value) && this.required;
......@@ -118,7 +119,9 @@ export default {
<gl-form-group :label="label" :label-for="fieldId" :description="help">
<template v-if="isCheckbox">
<input :name="fieldName" type="hidden" value="false" />
<gl-form-checkbox v-model="model" v-bind="sharedProps" />
<gl-form-checkbox v-model="model" v-bind="sharedProps">
{{ humanizedTitle }}
</gl-form-checkbox>
</template>
<gl-form-select v-else-if="isSelect" v-model="model" v-bind="sharedProps" :options="options" />
<gl-form-textarea
......
......@@ -34,5 +34,6 @@ commit_events: @service.commit_events.to_s, enable_comments: @service.comment_on
%p.text-muted
= @service.class.event_description(event)
- @service.global_fields.each do |field|
= render 'shared/field', form: form, field: field
- if Feature.disabled?(:integration_form_refactor)
- @service.global_fields.each do |field|
= render 'shared/field', form: form, field: field
......@@ -6,6 +6,8 @@ describe 'Admin activates Prometheus' do
let(:admin) { create(:user, :admin) }
before do
stub_feature_flags(integration_form_refactor: false)
sign_in(admin)
visit(admin_application_settings_services_path)
......
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