summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmmar Alakkad <aalakkad@gitlab.com>2019-08-05 15:12:47 +0300
committerAmmar Alakkad <aalakkad@gitlab.com>2019-08-05 15:12:47 +0300
commit9eb4004f74f6451f2e4272a22075e292f0c098d7 (patch)
treef7d87206b270b78b6714fa331b04f41ed9730049
parent715f5de4aa0f1c8d32eecfd54b6610bf8eb67c76 (diff)
downloadgitlab-ce-9eb4004f74f6451f2e4272a22075e292f0c098d7.tar.gz
Refactor passing props to jobs/index.js
-rw-r--r--app/assets/javascripts/jobs/index.js30
-rw-r--r--app/views/projects/jobs/show.html.haml1
2 files changed, 22 insertions, 9 deletions
diff --git a/app/assets/javascripts/jobs/index.js b/app/assets/javascripts/jobs/index.js
index 8c1758b6322..add7f9b710a 100644
--- a/app/assets/javascripts/jobs/index.js
+++ b/app/assets/javascripts/jobs/index.js
@@ -10,17 +10,29 @@ export default () => {
JobApp,
},
render(createElement) {
+ const {
+ deploymentHelpUrl,
+ runnerHelpUrl,
+ runnerSettingsUrl,
+ variablesSettingsUrl,
+ endpoint,
+ pagePath,
+ logState,
+ buildStatus,
+ projectPath,
+ } = element.dataset;
+
return createElement('job-app', {
props: {
- deploymentHelpUrl: element.dataset.deploymentHelpUrl,
- runnerHelpUrl: element.dataset.runnerHelpUrl,
- runnerSettingsUrl: element.dataset.runnerSettingsUrl,
- variablesSettingsUrl: element.dataset.variablesSettingsUrl,
- endpoint: element.dataset.endpoint,
- pagePath: element.dataset.buildOptionsPagePath,
- logState: element.dataset.buildOptionsLogState,
- buildStatus: element.dataset.buildOptionsBuildStatus,
- projectPath: element.dataset.projectPath,
+ deploymentHelpUrl,
+ runnerHelpUrl,
+ runnerSettingsUrl,
+ variablesSettingsUrl,
+ endpoint,
+ pagePath,
+ logState,
+ buildStatus,
+ projectPath,
},
});
},
diff --git a/app/views/projects/jobs/show.html.haml b/app/views/projects/jobs/show.html.haml
index a743e656402..a3688c17041 100644
--- a/app/views/projects/jobs/show.html.haml
+++ b/app/views/projects/jobs/show.html.haml
@@ -12,4 +12,5 @@
runner_help_url: help_page_path('ci/runners/README.html', anchor: 'setting-maximum-job-timeout-for-a-runner'),
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'),
+ page_path: project_job_path(@project, @build), build_status: @build.status, build_stage: @build.stage, log_state: '',
build_options: javascript_build_options } }