Commit 13044309 authored by Adriel Santiago's avatar Adriel Santiago Committed by Clement Ho

Resolve "Add documentation links to Ops Dashboard"

parent dbca9fdc
...@@ -23,6 +23,10 @@ export default { ...@@ -23,6 +23,10 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
emptyDashboardHelpPath: {
type: String,
required: true,
},
}, },
computed: { computed: {
...mapState(['projects', 'projectTokens', 'isLoadingProjects']), ...mapState(['projects', 'projectTokens', 'isLoadingProjects']),
...@@ -95,11 +99,19 @@ export default { ...@@ -95,11 +99,19 @@ export default {
{{ s__('OperationsDashboard|Add a project to the dashboard') }} {{ s__('OperationsDashboard|Add a project to the dashboard') }}
</h4> </h4>
<div class="col-12 d-flex justify-content-center"> <div class="col-12 d-flex justify-content-center">
<span class="js-sub-title mw-460 text-tertiary"> <span class="js-sub-title mw-460 text-tertiary text-left">
{{ s__(`OperationsDashboard|The operations dashboard provides a summary of each project's {{ s__(`OperationsDashboard|The operations dashboard provides a summary of each project's
operational health, including pipeline and alert status.`) }} operational health, including pipeline and alert statuses.`) }}
</span> </span>
</div> </div>
<div class="col-12">
<a
:href="emptyDashboardHelpPath"
class="js-documentation-link btn btn-primary prepend-top-default append-bottom-default"
>
{{ __('View documentation') }}
</a>
</div>
</div> </div>
<gl-loading-icon <gl-loading-icon
v-else v-else
......
...@@ -17,6 +17,7 @@ document.addEventListener( ...@@ -17,6 +17,7 @@ document.addEventListener(
listPath: this.$el.dataset.listPath, listPath: this.$el.dataset.listPath,
addPath: this.$el.dataset.addPath, addPath: this.$el.dataset.addPath,
emptyDashboardSvgPath: this.$el.dataset.emptyDashboardSvgPath, emptyDashboardSvgPath: this.$el.dataset.emptyDashboardSvgPath,
emptyDashboardHelpPath: this.$el.dataset.emptyDashboardHelpPath,
}, },
}); });
}, },
......
...@@ -5,7 +5,8 @@ module OperationsHelper ...@@ -5,7 +5,8 @@ module OperationsHelper
{ {
'add-path' => add_operations_project_path, 'add-path' => add_operations_project_path,
'list-path' => operations_list_path, 'list-path' => operations_list_path,
'empty-dashboard-svg-path' => image_path('illustrations/operations-dashboard_empty.svg') 'empty-dashboard-svg-path' => image_path('illustrations/operations-dashboard_empty.svg'),
'empty-dashboard-help-path' => help_page_path('user/operations_dashboard/index.html')
} }
end end
end end
---
title: Add documentation link to ops dashboard
merge_request: 8296
author:
type: changed
...@@ -10,7 +10,8 @@ describe OperationsHelper do ...@@ -10,7 +10,8 @@ describe OperationsHelper do
expect(operations_data).to eq( expect(operations_data).to eq(
'add-path' => '/-/operations', 'add-path' => '/-/operations',
'list-path' => '/-/operations/list', 'list-path' => '/-/operations/list',
'empty-dashboard-svg-path' => '/images/illustrations/operations-dashboard_empty.svg' 'empty-dashboard-svg-path' => '/images/illustrations/operations-dashboard_empty.svg',
'empty-dashboard-help-path' => '/help/user/operations_dashboard/index.html'
) )
end end
end end
......
...@@ -22,6 +22,7 @@ describe('dashboard component', () => { ...@@ -22,6 +22,7 @@ describe('dashboard component', () => {
addPath: 'mock-addPath', addPath: 'mock-addPath',
listPath: mockListPath, listPath: mockListPath,
emptyDashboardSvgPath: '/assets/illustrations/operations-dashboard_empty.svg', emptyDashboardSvgPath: '/assets/illustrations/operations-dashboard_empty.svg',
emptyDashboardHelpPath: '/help/user/operations_dashboard/index.html',
}, },
}); });
let vm; let vm;
...@@ -122,6 +123,18 @@ describe('dashboard component', () => { ...@@ -122,6 +123,18 @@ describe('dashboard component', () => {
mockText.EMPTY_SUBTITLE, mockText.EMPTY_SUBTITLE,
); );
}); });
it('renders link to documentation', () => {
const link = vm.$el.querySelector('.js-documentation-link');
expect(link.innerText.trim()).toBe('View documentation');
});
it('links to documentation', () => {
const link = vm.$el.querySelector('.js-documentation-link');
expect(link.href).toMatch(vm.emptyDashboardHelpPath);
});
}); });
}); });
}); });
...@@ -5,7 +5,7 @@ export const mockText = { ...@@ -5,7 +5,7 @@ export const mockText = {
DASHBOARD_TITLE: 'Operations Dashboard', DASHBOARD_TITLE: 'Operations Dashboard',
EMPTY_TITLE: 'Add a project to the dashboard', EMPTY_TITLE: 'Add a project to the dashboard',
EMPTY_SUBTITLE: EMPTY_SUBTITLE:
"The operations dashboard provides a summary of each project's operational health, including pipeline and alert status.", "The operations dashboard provides a summary of each project's operational health, including pipeline and alert statuses.",
EMPTY_SVG_SOURCE: '/assets/illustrations/operations-dashboard_empty.svg', EMPTY_SVG_SOURCE: '/assets/illustrations/operations-dashboard_empty.svg',
NO_SEARCH_RESULTS: 'Sorry, no projects matched your search', NO_SEARCH_RESULTS: 'Sorry, no projects matched your search',
RECEIVE_PROJECTS_ERROR: 'Something went wrong, unable to get operations projects', RECEIVE_PROJECTS_ERROR: 'Something went wrong, unable to get operations projects',
......
...@@ -5656,7 +5656,7 @@ msgstr "" ...@@ -5656,7 +5656,7 @@ msgstr ""
msgid "OperationsDashboard|Add a project to the dashboard" msgid "OperationsDashboard|Add a project to the dashboard"
msgstr "" msgstr ""
msgid "OperationsDashboard|The operations dashboard provides a summary of each project's operational health, including pipeline and alert status." msgid "OperationsDashboard|The operations dashboard provides a summary of each project's operational health, including pipeline and alert statuses."
msgstr "" msgstr ""
msgid "OperationsDashboard|Unable to add %{invalidProjects}. The Operations Dashboard is available for projects with a Gold subscription." msgid "OperationsDashboard|Unable to add %{invalidProjects}. The Operations Dashboard is available for projects with a Gold subscription."
...@@ -8767,6 +8767,9 @@ msgstr "" ...@@ -8767,6 +8767,9 @@ msgstr ""
msgid "View app" msgid "View app"
msgstr "" msgstr ""
msgid "View documentation"
msgstr ""
msgid "View epics list" msgid "View epics list"
msgstr "" msgstr ""
......
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