Commit 61f46c69 authored by Tom Quirk's avatar Tom Quirk

Move integrations settings layout to Vue

parent c41c5383
...@@ -95,10 +95,7 @@ export default { ...@@ -95,10 +95,7 @@ export default {
</script> </script>
<template> <template>
<div> <div class="gl-mb-3">
<!-- helpHtml is trusted input -->
<div v-if="helpHtml" v-safe-html:[$options.helpHtmlConfig]="helpHtml"></div>
<override-dropdown <override-dropdown
v-if="defaultState !== null" v-if="defaultState !== null"
:inherit-from-id="defaultState.id" :inherit-from-id="defaultState.id"
...@@ -107,80 +104,91 @@ export default { ...@@ -107,80 +104,91 @@ export default {
@change="setOverride" @change="setOverride"
/> />
<active-checkbox v-if="propsSource.showActive" :key="`${currentKey}-active-checkbox`" /> <div class="row">
<jira-trigger-fields <div class="col-lg-4"></div>
v-if="isJira"
:key="`${currentKey}-jira-trigger-fields`" <div class="col-lg-8">
v-bind="propsSource.triggerFieldsProps" <!-- helpHtml is trusted input -->
/> <div v-if="helpHtml" v-safe-html:[$options.helpHtmlConfig]="helpHtml"></div>
<trigger-fields
v-else-if="propsSource.triggerEvents.length" <active-checkbox v-if="propsSource.showActive" :key="`${currentKey}-active-checkbox`" />
:key="`${currentKey}-trigger-fields`" <jira-trigger-fields
:events="propsSource.triggerEvents" v-if="isJira"
:type="propsSource.type" :key="`${currentKey}-jira-trigger-fields`"
/> v-bind="propsSource.triggerFieldsProps"
<dynamic-field />
v-for="field in propsSource.fields" <trigger-fields
:key="`${currentKey}-${field.name}`" v-else-if="propsSource.triggerEvents.length"
v-bind="field" :key="`${currentKey}-trigger-fields`"
/> :events="propsSource.triggerEvents"
<jira-issues-fields :type="propsSource.type"
v-if="showJiraIssuesFields" />
:key="`${currentKey}-jira-issues-fields`" <dynamic-field
v-bind="propsSource.jiraIssuesProps" v-for="field in propsSource.fields"
/> :key="`${currentKey}-${field.name}`"
<div v-if="isEditable" class="footer-block row-content-block"> v-bind="field"
<template v-if="isInstanceOrGroupLevel"> />
<gl-button <jira-issues-fields
v-gl-modal.confirmSaveIntegration v-if="showJiraIssuesFields"
category="primary" :key="`${currentKey}-jira-issues-fields`"
variant="success" v-bind="propsSource.jiraIssuesProps"
:loading="isSaving" />
:disabled="isDisabled" <div v-if="isEditable" class="footer-block row-content-block">
data-qa-selector="save_changes_button" <template v-if="isInstanceOrGroupLevel">
> <gl-button
{{ __('Save changes') }} v-gl-modal.confirmSaveIntegration
</gl-button> category="primary"
<confirmation-modal @submit="onSaveClick" /> variant="success"
</template> :loading="isSaving"
<gl-button :disabled="isDisabled"
v-else data-qa-selector="save_changes_button"
category="primary" >
variant="success" {{ __('Save changes') }}
type="submit" </gl-button>
:loading="isSaving" <confirmation-modal @submit="onSaveClick" />
:disabled="isDisabled" </template>
data-qa-selector="save_changes_button" <gl-button
@click.prevent="onSaveClick" v-else
> category="primary"
{{ __('Save changes') }} variant="success"
</gl-button> type="submit"
:loading="isSaving"
:disabled="isDisabled"
data-qa-selector="save_changes_button"
@click.prevent="onSaveClick"
>
{{ __('Save changes') }}
</gl-button>
<gl-button <gl-button
v-if="propsSource.canTest" v-if="propsSource.canTest"
:loading="isTesting" :loading="isTesting"
:disabled="isDisabled" :disabled="isDisabled"
:href="propsSource.testPath" :href="propsSource.testPath"
@click.prevent="onTestClick" @click.prevent="onTestClick"
> >
{{ __('Test settings') }} {{ __('Test settings') }}
</gl-button> </gl-button>
<template v-if="showReset"> <template v-if="showReset">
<gl-button <gl-button
v-gl-modal.confirmResetIntegration v-gl-modal.confirmResetIntegration
category="secondary" category="secondary"
variant="default" variant="default"
:loading="isResetting" :loading="isResetting"
:disabled="isDisabled" :disabled="isDisabled"
data-testid="reset-button" data-testid="reset-button"
> >
{{ __('Reset') }} {{ __('Reset') }}
</gl-button> </gl-button>
<reset-confirmation-modal @reset="onResetClick" /> <reset-confirmation-modal @reset="onResetClick" />
</template> </template>
<gl-button class="btn-cancel" :href="propsSource.cancelPath">{{ __('Cancel') }}</gl-button> <gl-button class="btn-cancel" :href="propsSource.cancelPath">{{
__('Cancel')
}}</gl-button>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
- if lookup_context.template_exists?('top', "projects/services/#{@service.to_param}", true) - if lookup_context.template_exists?('top', "projects/services/#{@service.to_param}", true)
= render "projects/services/#{@service.to_param}/top" = render "projects/services/#{@service.to_param}/top"
%h3.page-title.gl-mt-3 %h3.page-title
= @service.title = @service.title
- if @service.operating? - if @service.operating?
= sprite_icon('check', css_class: 'gl-text-green-500') = sprite_icon('check', css_class: 'gl-text-green-500')
.row.gl-mb-3 = form_for(@service, as: :service, url: scoped_integration_path(@service), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_service_path(@project, @service) } }) do |form|
.col-lg-4 = render 'shared/service_settings', form: form, integration: @service
- if @service.respond_to?(:detailed_description) %input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referrer }
%p= @service.detailed_description
.col-lg-8
= form_for(@service, as: :service, url: scoped_integration_path(@service), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_service_path(@project, @service) } }) do |form|
= render 'shared/service_settings', form: form, integration: @service
%input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referrer }
- if lookup_context.template_exists?('show', "projects/services/#{@service.to_param}", true) - if lookup_context.template_exists?('show', "projects/services/#{@service.to_param}", true)
%hr %hr
......
- integration = local_assigns.fetch(:integration) - integration = local_assigns.fetch(:integration)
%h3.page-title.gl-mt-3 %h3.page-title
= integration.title = integration.title
.row = form_for integration, as: :service, url: scoped_integration_path(integration), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => scoped_test_integration_path(integration) } } do |form|
.col-lg-4 = render 'shared/service_settings', form: form, integration: integration
.col-lg-8
= form_for integration, as: :service, url: scoped_integration_path(integration), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => scoped_test_integration_path(integration) } } do |form|
= render 'shared/service_settings', form: form, integration: integration
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