Commit fef65601 authored by Savas Vedova's avatar Savas Vedova

Merge branch 'error-tracking-settings-clean-up' into 'master'

Update error tracking settings UI

See merge request gitlab-org/gitlab!60627
parents fd9d4589 5a11f55e
<script> <script>
import { GlButton } from '@gitlab/ui'; import { GlButton, GlFormGroup, GlFormCheckbox } from '@gitlab/ui';
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import ErrorTrackingForm from './error_tracking_form.vue'; import ErrorTrackingForm from './error_tracking_form.vue';
import ProjectDropdown from './project_dropdown.vue'; import ProjectDropdown from './project_dropdown.vue';
export default { export default {
components: { ProjectDropdown, ErrorTrackingForm, GlButton }, components: {
ErrorTrackingForm,
GlButton,
GlFormCheckbox,
GlFormGroup,
ProjectDropdown,
},
props: { props: {
initialApiHost: { initialApiHost: {
type: String, type: String,
...@@ -66,18 +72,18 @@ export default { ...@@ -66,18 +72,18 @@ export default {
<template> <template>
<div> <div>
<div class="form-check form-group"> <gl-form-group
<input :label="s__('ErrorTracking|Enable error tracking')"
label-for="error-tracking-enabled"
>
<gl-form-checkbox
id="error-tracking-enabled" id="error-tracking-enabled"
:checked="enabled" :checked="enabled"
class="form-check-input" @change="updateEnabled($event)"
type="checkbox" >
@change="updateEnabled($event.target.checked)" {{ s__('ErrorTracking|Active') }}
/> </gl-form-checkbox>
<label class="form-check-label" for="error-tracking-enabled">{{ </gl-form-group>
s__('ErrorTracking|Active')
}}</label>
</div>
<error-tracking-form /> <error-tracking-form />
<div class="form-group"> <div class="form-group">
<project-dropdown <project-dropdown
...@@ -95,7 +101,7 @@ export default { ...@@ -95,7 +101,7 @@ export default {
<gl-button <gl-button
:disabled="settingsLoading" :disabled="settingsLoading"
class="js-error-tracking-button" class="js-error-tracking-button"
variant="success" variant="confirm"
@click="handleSubmit" @click="handleSubmit"
> >
{{ __('Save changes') }} {{ __('Save changes') }}
......
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
v-show="connectSuccessful" v-show="connectSuccessful"
class="js-error-tracking-connect-success gl-ml-2 text-success align-middle" class="js-error-tracking-connect-success gl-ml-2 text-success align-middle"
:aria-label="__('Projects Successfully Retrieved')" :aria-label="__('Projects Successfully Retrieved')"
name="check-circle" name="check"
/> />
</div> </div>
</div> </div>
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
%button.gl-button.btn.btn-default.js-settings-toggle{ type: 'button' } %button.gl-button.btn.btn-default.js-settings-toggle{ type: 'button' }
= _('Expand') = _('Expand')
%p %p
= _('To link Sentry to GitLab, enter your Sentry URL and Auth Token.') = _('Link Sentry to GitLab to discover and view the errors your application generates.')
= link_to _('More information'), help_page_path('operations/error_tracking'), target: '_blank', rel: 'noopener noreferrer' = link_to _('Learn more.'), help_page_path('operations/error_tracking'), target: '_blank', rel: 'noopener noreferrer'
.settings-content .settings-content
.js-error-tracking-form{ data: { list_projects_endpoint: project_error_tracking_projects_path(@project, format: :json), .js-error-tracking-form{ data: { list_projects_endpoint: project_error_tracking_projects_path(@project, format: :json),
operations_settings_endpoint: project_settings_operations_path(@project), operations_settings_endpoint: project_settings_operations_path(@project),
......
---
title: Update error tracking settings to use better copy and correct colors
merge_request: 60627
author:
type: changed
...@@ -12932,6 +12932,9 @@ msgstr "" ...@@ -12932,6 +12932,9 @@ msgstr ""
msgid "ErrorTracking|Connection failed. Check Auth Token and try again." msgid "ErrorTracking|Connection failed. Check Auth Token and try again."
msgstr "" msgstr ""
msgid "ErrorTracking|Enable error tracking"
msgstr ""
msgid "ErrorTracking|If you self-host Sentry, enter your Sentry instance's full URL. If you use Sentry's hosted solution, enter https://sentry.io" msgid "ErrorTracking|If you self-host Sentry, enter your Sentry instance's full URL. If you use Sentry's hosted solution, enter https://sentry.io"
msgstr "" msgstr ""
...@@ -19396,6 +19399,9 @@ msgstr "" ...@@ -19396,6 +19399,9 @@ msgstr ""
msgid "Link Prometheus monitoring to GitLab." msgid "Link Prometheus monitoring to GitLab."
msgstr "" msgstr ""
msgid "Link Sentry to GitLab to discover and view the errors your application generates."
msgstr ""
msgid "Link an external wiki from the project's sidebar. %{docs_link}" msgid "Link an external wiki from the project's sidebar. %{docs_link}"
msgstr "" msgstr ""
...@@ -33453,9 +33459,6 @@ msgstr "" ...@@ -33453,9 +33459,6 @@ msgstr ""
msgid "To learn more about this project, read %{link_to_wiki}." msgid "To learn more about this project, read %{link_to_wiki}."
msgstr "" msgstr ""
msgid "To link Sentry to GitLab, enter your Sentry URL and Auth Token."
msgstr ""
msgid "To move or copy an entire GitLab project from another GitLab installation to this one, navigate to the original project's settings page, generate an export file, and upload it here." msgid "To move or copy an entire GitLab project from another GitLab installation to this one, navigate to the original project's settings page, generate an export file, and upload it here."
msgstr "" msgstr ""
......
...@@ -33,11 +33,12 @@ describe('error tracking settings form', () => { ...@@ -33,11 +33,12 @@ describe('error tracking settings form', () => {
describe('an empty form', () => { describe('an empty form', () => {
it('is rendered', () => { it('is rendered', () => {
expect(wrapper.findAll(GlFormInput).length).toBe(2); expect(wrapper.findAllComponents(GlFormInput).length).toBe(2);
expect(wrapper.find(GlFormInput).attributes('id')).toBe('error-tracking-api-host'); expect(wrapper.findComponent(GlFormInput).attributes('id')).toBe('error-tracking-api-host');
expect(wrapper.findAll(GlFormInput).at(1).attributes('id')).toBe('error-tracking-token'); expect(wrapper.findAllComponents(GlFormInput).at(1).attributes('id')).toBe(
'error-tracking-token',
expect(wrapper.findAll(GlButton).exists()).toBe(true); );
expect(wrapper.findAllComponents(GlButton).exists()).toBe(true);
}); });
it('is rendered with labels and placeholders', () => { it('is rendered with labels and placeholders', () => {
...@@ -51,7 +52,7 @@ describe('error tracking settings form', () => { ...@@ -51,7 +52,7 @@ describe('error tracking settings form', () => {
); );
expect(pageText).not.toContain('Connection failed. Check Auth Token and try again.'); expect(pageText).not.toContain('Connection failed. Check Auth Token and try again.');
expect(wrapper.findAll(GlFormInput).at(0).attributes('placeholder')).toContain( expect(wrapper.findAllComponents(GlFormInput).at(0).attributes('placeholder')).toContain(
'https://mysentryserver.com', 'https://mysentryserver.com',
); );
}); });
...@@ -63,7 +64,7 @@ describe('error tracking settings form', () => { ...@@ -63,7 +64,7 @@ describe('error tracking settings form', () => {
}); });
it('shows loading spinner', () => { it('shows loading spinner', () => {
const buttonEl = wrapper.find(GlButton); const buttonEl = wrapper.findComponent(GlButton);
expect(buttonEl.props('loading')).toBe(true); expect(buttonEl.props('loading')).toBe(true);
expect(buttonEl.text()).toBe('Connecting'); expect(buttonEl.text()).toBe('Connecting');
......
...@@ -47,7 +47,7 @@ RSpec.describe 'projects/settings/operations/show' do ...@@ -47,7 +47,7 @@ RSpec.describe 'projects/settings/operations/show' do
render render
expect(rendered).to have_content _('Error tracking') expect(rendered).to have_content _('Error tracking')
expect(rendered).to have_content _('To link Sentry to GitLab, enter your Sentry URL and Auth Token') expect(rendered).to have_content _('Link Sentry to GitLab to discover and view the errors your application generates.')
end end
end end
end end
......
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