Commit 42ae4c1b authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'jivanvl-update-help-page-path-usage' into 'master'

Change shared_runner_limit_block to use frontend helper utils

See merge request gitlab-org/gitlab!53180
parents 37952ce3 8b08b5cd
...@@ -54,11 +54,6 @@ export default { ...@@ -54,11 +54,6 @@ export default {
required: false, required: false,
default: null, default: null,
}, },
runnerHelpUrl: {
type: String,
required: false,
default: null,
},
deploymentHelpUrl: { deploymentHelpUrl: {
type: String, type: String,
required: false, required: false,
...@@ -250,7 +245,6 @@ export default { ...@@ -250,7 +245,6 @@ export default {
v-if="shouldRenderSharedRunnerLimitWarning" v-if="shouldRenderSharedRunnerLimitWarning"
:quota-used="job.runners.quota.used" :quota-used="job.runners.quota.used"
:quota-limit="job.runners.quota.limit" :quota-limit="job.runners.quota.limit"
:runners-path="runnerHelpUrl"
:project-path="projectPath" :project-path="projectPath"
:subscriptions-more-minutes-url="subscriptionsMoreMinutesUrl" :subscriptions-more-minutes-url="subscriptionsMoreMinutesUrl"
/> />
...@@ -330,7 +324,6 @@ export default { ...@@ -330,7 +324,6 @@ export default {
'right-sidebar-collapsed': !isSidebarOpen, 'right-sidebar-collapsed': !isSidebarOpen,
}" }"
:artifact-help-url="artifactHelpUrl" :artifact-help-url="artifactHelpUrl"
:runner-help-url="runnerHelpUrl"
data-testid="job-sidebar" data-testid="job-sidebar"
/> />
</div> </div>
......
...@@ -41,11 +41,6 @@ export default { ...@@ -41,11 +41,6 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
runnerHelpUrl: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
...mapGetters(['hasForwardDeploymentFailure']), ...mapGetters(['hasForwardDeploymentFailure']),
...@@ -135,7 +130,7 @@ export default { ...@@ -135,7 +130,7 @@ export default {
<gl-icon :size="14" name="external-link" /> <gl-icon :size="14" name="external-link" />
</gl-link> </gl-link>
</div> </div>
<job-sidebar-details-container :runner-help-url="runnerHelpUrl" /> <job-sidebar-details-container />
<artifacts-block v-if="hasArtifact" :artifact="job.artifact" :help-url="artifactHelpUrl" /> <artifacts-block v-if="hasArtifact" :artifact="job.artifact" :help-url="artifactHelpUrl" />
<trigger-block v-if="hasTriggers" :trigger="job.trigger" /> <trigger-block v-if="hasTriggers" :trigger="job.trigger" />
<commit-block <commit-block
......
...@@ -3,6 +3,7 @@ import { mapState } from 'vuex'; ...@@ -3,6 +3,7 @@ import { mapState } from 'vuex';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
import { timeIntervalInWords } from '~/lib/utils/datetime_utility'; import { timeIntervalInWords } from '~/lib/utils/datetime_utility';
import { helpPagePath } from '~/helpers/help_page_helper';
import DetailRow from './sidebar_detail_row.vue'; import DetailRow from './sidebar_detail_row.vue';
export default { export default {
...@@ -11,13 +12,6 @@ export default { ...@@ -11,13 +12,6 @@ export default {
DetailRow, DetailRow,
}, },
mixins: [timeagoMixin], mixins: [timeagoMixin],
props: {
runnerHelpUrl: {
type: String,
required: false,
default: '',
},
},
computed: { computed: {
...mapState(['job']), ...mapState(['job']),
coverage() { coverage() {
...@@ -51,6 +45,11 @@ export default { ...@@ -51,6 +45,11 @@ export default {
queued() { queued() {
return timeIntervalInWords(this.job.queued); return timeIntervalInWords(this.job.queued);
}, },
runnerHelpUrl() {
return helpPagePath('ci/runners/README.html', {
anchor: 'set-maximum-job-timeout-for-a-runner',
});
},
runnerId() { runnerId() {
return `${this.job.runner.description} (#${this.job.runner.id})`; return `${this.job.runner.description} (#${this.job.runner.id})`;
}, },
......
...@@ -13,7 +13,6 @@ export default () => { ...@@ -13,7 +13,6 @@ export default () => {
const { const {
artifactHelpUrl, artifactHelpUrl,
deploymentHelpUrl, deploymentHelpUrl,
runnerHelpUrl,
runnerSettingsUrl, runnerSettingsUrl,
variablesSettingsUrl, variablesSettingsUrl,
subscriptionsMoreMinutesUrl, subscriptionsMoreMinutesUrl,
...@@ -39,7 +38,6 @@ export default () => { ...@@ -39,7 +38,6 @@ export default () => {
props: { props: {
artifactHelpUrl, artifactHelpUrl,
deploymentHelpUrl, deploymentHelpUrl,
runnerHelpUrl,
runnerSettingsUrl, runnerSettingsUrl,
variablesSettingsUrl, variablesSettingsUrl,
subscriptionsMoreMinutesUrl, subscriptionsMoreMinutesUrl,
......
...@@ -8,7 +8,6 @@ module Ci ...@@ -8,7 +8,6 @@ module Ci
"project_path" => @project.full_path, "project_path" => @project.full_path,
"artifact_help_url" => help_page_path('user/gitlab_com/index.html', anchor: 'gitlab-cicd'), "artifact_help_url" => help_page_path('user/gitlab_com/index.html', anchor: 'gitlab-cicd'),
"deployment_help_url" => help_page_path('user/project/clusters/index.html', anchor: 'troubleshooting'), "deployment_help_url" => help_page_path('user/project/clusters/index.html', anchor: 'troubleshooting'),
"runner_help_url" => help_page_path('ci/runners/README.html', anchor: 'set-maximum-job-timeout-for-a-runner'),
"runner_settings_url" => project_runners_path(@build.project, anchor: 'js-runners-settings'), "runner_settings_url" => project_runners_path(@build.project, anchor: 'js-runners-settings'),
"variables_settings_url" => project_variables_path(@build.project, anchor: 'js-cicd-variables-settings'), "variables_settings_url" => project_variables_path(@build.project, anchor: 'js-cicd-variables-settings'),
"page_path" => project_job_path(@project, @build), "page_path" => project_job_path(@project, @build),
......
<script> <script>
import { GlButton, GlAlert } from '@gitlab/ui'; import { GlButton, GlAlert } from '@gitlab/ui';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import { helpPagePath } from '~/helpers/help_page_helper';
export default { export default {
components: { components: {
...@@ -16,11 +17,6 @@ export default { ...@@ -16,11 +17,6 @@ export default {
type: Number, type: Number,
required: true, required: true,
}, },
runnersPath: {
type: String,
required: false,
default: null,
},
projectPath: { projectPath: {
type: String, type: String,
required: true, required: true,
...@@ -43,6 +39,11 @@ export default { ...@@ -43,6 +39,11 @@ export default {
{ quotaUsed: this.quotaUsed, quotaLimit: this.quotaLimit }, { quotaUsed: this.quotaUsed, quotaLimit: this.quotaLimit },
); );
}, },
runnersPath() {
return helpPagePath('ci/runners/README.html', {
anchor: 'set-maximum-job-timeout-for-a-runner',
});
},
}, },
}; };
</script> </script>
......
...@@ -6,7 +6,6 @@ import { trimText } from 'helpers/text_helper'; ...@@ -6,7 +6,6 @@ import { trimText } from 'helpers/text_helper';
describe('Shared Runner Limit Block', () => { describe('Shared Runner Limit Block', () => {
let wrapper; let wrapper;
const runnersPath = 'root/project/runners';
const projectPath = 'h5bp/html5-boilerplate'; const projectPath = 'h5bp/html5-boilerplate';
const subscriptionsMoreMinutesUrl = 'https://customers.gitlab.com/buy_pipeline_minutes'; const subscriptionsMoreMinutesUrl = 'https://customers.gitlab.com/buy_pipeline_minutes';
...@@ -27,7 +26,6 @@ describe('Shared Runner Limit Block', () => { ...@@ -27,7 +26,6 @@ describe('Shared Runner Limit Block', () => {
propsData: { propsData: {
quotaUsed: 1000, quotaUsed: 1000,
quotaLimit: 4000, quotaLimit: 4000,
runnersPath,
projectPath, projectPath,
subscriptionsMoreMinutesUrl, subscriptionsMoreMinutesUrl,
}, },
...@@ -56,7 +54,6 @@ describe('Shared Runner Limit Block', () => { ...@@ -56,7 +54,6 @@ describe('Shared Runner Limit Block', () => {
quotaUsed: 1000, quotaUsed: 1000,
quotaLimit: 4000, quotaLimit: 4000,
projectPath, projectPath,
runnersPath,
subscriptionsMoreMinutesUrl, subscriptionsMoreMinutesUrl,
}, },
}); });
...@@ -64,21 +61,4 @@ describe('Shared Runner Limit Block', () => { ...@@ -64,21 +61,4 @@ describe('Shared Runner Limit Block', () => {
expect(trimText(wrapper.text())).toContain('For more information, go to the Runners page.'); expect(trimText(wrapper.text())).toContain('For more information, go to the Runners page.');
}); });
}); });
describe('without runnersPath', () => {
it('does not render runner link', () => {
factory({
propsData: {
quotaUsed: 1000,
quotaLimit: 4000,
projectPath,
subscriptionsMoreMinutesUrl,
},
});
expect(trimText(wrapper.element.textContent)).not.toContain(
'For more information, go to the Runners page.',
);
});
});
}); });
...@@ -34,7 +34,6 @@ describe('Job App', () => { ...@@ -34,7 +34,6 @@ describe('Job App', () => {
const props = { const props = {
artifactHelpUrl: 'help/artifact', artifactHelpUrl: 'help/artifact',
runnerHelpUrl: 'help/runner',
deploymentHelpUrl: 'help/deployment', deploymentHelpUrl: 'help/deployment',
runnerSettingsUrl: 'settings/ci-cd/runners', runnerSettingsUrl: 'settings/ci-cd/runners',
variablesSettingsUrl: 'settings/ci-cd/variables', variablesSettingsUrl: 'settings/ci-cd/variables',
......
...@@ -116,14 +116,5 @@ describe('Job Sidebar Details Container', () => { ...@@ -116,14 +116,5 @@ describe('Job Sidebar Details Container', () => {
expect(findJobTimeout().exists()).toBe(false); expect(findJobTimeout().exists()).toBe(false);
}); });
it('should pass the help URL', async () => {
const helpUrl = 'fakeUrl';
const props = { runnerHelpUrl: helpUrl };
createWrapper({ props });
await store.dispatch('receiveJobSuccess', { metadata: { timeout_human_readable } });
expect(findJobTimeout().props('helpUrl')).toBe(helpUrl);
});
}); });
}); });
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