Commit e99efc34 authored by Justin Ho's avatar Justin Ho

Scope feature flag to project

And refactor some specs
parent 16f21dcc
= form_errors(@service)
- trigger_events = Feature.enabled?(:integration_form_refactor) ? ServiceEventSerializer.new(service: @service).represent(@service.configurable_events).to_json : []
- fields = Feature.enabled?(:integration_form_refactor) ? ServiceFieldSerializer.new(service: @service).represent(@service.global_fields).to_json : []
- trigger_events = Feature.enabled?(:integration_form_refactor, @project) ? ServiceEventSerializer.new(service: @service).represent(@service.configurable_events).to_json : []
- fields = Feature.enabled?(:integration_form_refactor, @project) ? ServiceFieldSerializer.new(service: @service).represent(@service.global_fields).to_json : []
- if lookup_context.template_exists?('help', "projects/services/#{@service.to_param}", true)
= render "projects/services/#{@service.to_param}/help", subject: @service
......@@ -13,7 +13,7 @@
.js-vue-integration-settings{ data: { show_active: @service.show_active_box?.to_s, activated: (@service.active || @service.new_record?).to_s, type: @service.to_param, merge_request_events: @service.merge_requests_events.to_s,
commit_events: @service.commit_events.to_s, enable_comments: @service.comment_on_event_enabled.to_s, comment_detail: @service.comment_detail, trigger_events: trigger_events, fields: fields } }
- if @service.configurable_events.present? && !@service.is_a?(JiraService) && Feature.disabled?(:integration_form_refactor)
- if @service.configurable_events.present? && !@service.is_a?(JiraService) && Feature.disabled?(:integration_form_refactor, @project)
.form-group.row
%label.col-form-label.col-sm-2= _('Trigger')
......@@ -34,6 +34,6 @@ commit_events: @service.commit_events.to_s, enable_comments: @service.comment_on
%p.text-muted
= @service.class.event_description(event)
- if Feature.disabled?(:integration_form_refactor)
- if Feature.disabled?(:integration_form_refactor, @project)
- @service.global_fields.each do |field|
= render 'shared/field', form: form, field: field
......@@ -111,8 +111,9 @@ describe('IntegrationForm', () => {
const dynamicFields = wrapper.findAll(DynamicField);
expect(dynamicFields).toHaveLength(2);
expect(dynamicFields.at(0).props()).toMatchObject(fields[0]);
expect(dynamicFields.at(1).props()).toMatchObject(fields[1]);
dynamicFields.wrappers.forEach((field, index) => {
expect(field.props()).toMatchObject(fields[index]);
});
});
});
});
......
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