diff options
Diffstat (limited to 'app/views/projects/triggers')
-rw-r--r-- | app/views/projects/triggers/_form.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/triggers/_index.html.haml | 43 |
2 files changed, 36 insertions, 11 deletions
diff --git a/app/views/projects/triggers/_form.html.haml b/app/views/projects/triggers/_form.html.haml index b621f1ab3ed..b7e226b009c 100644 --- a/app/views/projects/triggers/_form.html.haml +++ b/app/views/projects/triggers/_form.html.haml @@ -1,3 +1,4 @@ +- show_cancel_button = local_assigns.fetch(:show_cancel_button, false) = gitlab_ui_form_for [@project, @trigger], html: { class: 'gl-show-field-errors' } do |f| = form_errors(@trigger) @@ -9,3 +10,6 @@ = f.label :key, s_("Trigger|Description"), class: "label-bold" = f.text_field :description, class: 'form-control gl-form-input', required: true, title: 'Trigger description is required.', placeholder: s_("Trigger|Trigger description") = f.submit btn_text, pajamas_button: true + - if show_cancel_button + = render Pajamas::ButtonComponent.new(button_options: { type: 'reset', class: 'gl-ml-2 js-toggle-button' }) do + = _('Cancel') diff --git a/app/views/projects/triggers/_index.html.haml b/app/views/projects/triggers/_index.html.haml index b68aad24b50..7b6915b7b85 100644 --- a/app/views/projects/triggers/_index.html.haml +++ b/app/views/projects/triggers/_index.html.haml @@ -1,17 +1,38 @@ +- add_form_class = 'gl-display-none' if !form_errors(@trigger) +- hide_class = 'gl-display-none' if form_errors(@trigger) + .row.gl-mt-3.gl-mb-3 .col-lg-12 - = render Pajamas::CardComponent.new do |c| + = render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card js-toggle-container' }, header_options: { class: 'gl-new-card-header gl-flex-wrap gl-sm-flex-nowrap' }, body_options: { class: 'gl-new-card-body gl-px-0' }) do |c| - c.with_header do - = _("Manage your project's triggers") + .gl-new-card-title-wrapper + %h5.gl-new-card-title + = _("Active pipeline trigger tokens") + .gl-new-card-count + = sprite_icon('token', css_class: 'gl-mr-2') + = @triggers.size + .gl-new-card-actions.gl-display-flex.gl-justify-content-end.gl-w-full.gl-sm-w-auto.gl-mt-3.gl-sm-mt-0 + = render Pajamas::ButtonComponent.new(size: :small, category: :tertiary, button_options: { data: { testid: 'reveal-hide-values-button' } }) do + = _('Reveal values') + = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: "gl-ml-2 js-toggle-button js-toggle-content #{hide_class}" }) do + = _('Add new token') + - c.with_body do - = render 'projects/triggers/form', btn_text: _('Add trigger') - .gl-mb-5 + .gl-new-card-add-form.gl-m-3.js-toggle-content{ class: add_form_class } + %h4.gl-mt-0 + = _('Add new pipeline trigger token') + = render 'projects/triggers/form', btn_text: _('Create pipeline trigger token'), show_cancel_button: true + #js-ci-pipeline-triggers-list.triggers-list{ data: { triggers: @triggers_json } } - - c.with_footer do - %p - = _("These examples show how to trigger this project's pipeline for a branch or tag.") - %p.light + %details.gl-mt-5.gl-border.gl-rounded-base + %summary.gl-py-3.gl-px-5.gl-font-weight-semibold + = _("View trigger token usage examples") + .gl-p-5 + %p.gl-text-secondary + = _("These examples show common methods of triggering a pipeline with a pipeline trigger token. The URL and ID for this project is prefilled.") + + %p.gl-text-secondary = _('In each example, replace %{code_start}TOKEN%{code_end} with the trigger token you generated and replace %{code_start}REF_NAME%{code_end} with the branch or tag name.').html_safe % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe } %h5.gl-mt-3 @@ -40,10 +61,10 @@ %h5.gl-mt-3 = _('Pass job variables') - %p.light + %p.gl-text-secondary = _('To pass variables to the triggered pipeline, add %{code_start}variables[VARIABLE]=VALUE%{code_end} to the API request.').html_safe % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe } - %p.light + %p.gl-text-secondary = _('cURL:') %pre @@ -54,7 +75,7 @@ -F "ref=REF_NAME" \ -F "variables[RUN_NIGHTLY_BUILD]=true" \ #{builds_trigger_url(@project.id)} - %p.light + %p.gl-text-secondary = _('Webhook:') %pre.gl-mb-0 |