diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 12:09:34 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 12:09:34 +0000 |
commit | 903ccf7c93eb9490c76857bffe744249cc07de09 (patch) | |
tree | 603a3162e91999160e4efc74f351f9405f422d61 /app/assets | |
parent | 41cb558299b483b44b45351730ee4c0e9fe4ca2c (diff) | |
download | gitlab-ce-903ccf7c93eb9490c76857bffe744249cc07de09.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/jira_import/components/jira_import_app.vue | 28 | ||||
-rw-r--r-- | app/assets/javascripts/jira_import/index.js | 31 | ||||
-rw-r--r-- | app/assets/javascripts/jira_import/queries/getJiraProjects.query.graphql | 14 | ||||
-rw-r--r-- | app/assets/javascripts/notebook/cells/code.vue | 4 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/import/jira/index.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/static_site_editor/show/index.js (renamed from app/assets/javascripts/pages/static_site_editor/index.js) | 0 | ||||
-rw-r--r-- | app/assets/javascripts/projects/default_project_templates.js | 84 | ||||
-rw-r--r-- | app/assets/javascripts/projects/project_new.js | 86 |
8 files changed, 164 insertions, 86 deletions
diff --git a/app/assets/javascripts/jira_import/components/jira_import_app.vue b/app/assets/javascripts/jira_import/components/jira_import_app.vue new file mode 100644 index 00000000000..4b19c4d1b17 --- /dev/null +++ b/app/assets/javascripts/jira_import/components/jira_import_app.vue @@ -0,0 +1,28 @@ +<script> +import getJiraProjects from '../queries/getJiraProjects.query.graphql'; + +export default { + name: 'JiraImportApp', + props: { + projectPath: { + type: String, + required: true, + }, + }, + apollo: { + getJiraImports: { + query: getJiraProjects, + variables() { + return { + fullPath: this.projectPath, + }; + }, + update: data => data.project.jiraImports, + }, + }, +}; +</script> + +<template> + <div></div> +</template> diff --git a/app/assets/javascripts/jira_import/index.js b/app/assets/javascripts/jira_import/index.js new file mode 100644 index 00000000000..a17313fd774 --- /dev/null +++ b/app/assets/javascripts/jira_import/index.js @@ -0,0 +1,31 @@ +import Vue from 'vue'; +import VueApollo from 'vue-apollo'; +import createDefaultClient from '~/lib/graphql'; +import App from './components/jira_import_app.vue'; + +Vue.use(VueApollo); + +const defaultClient = createDefaultClient(); + +const apolloProvider = new VueApollo({ + defaultClient, +}); + +export default function mountJiraImportApp() { + const el = document.querySelector('.js-jira-import-root'); + if (!el) { + return false; + } + + return new Vue({ + el, + apolloProvider, + render(createComponent) { + return createComponent(App, { + props: { + projectPath: el.dataset.projectPath, + }, + }); + }, + }); +} diff --git a/app/assets/javascripts/jira_import/queries/getJiraProjects.query.graphql b/app/assets/javascripts/jira_import/queries/getJiraProjects.query.graphql new file mode 100644 index 00000000000..13100eac221 --- /dev/null +++ b/app/assets/javascripts/jira_import/queries/getJiraProjects.query.graphql @@ -0,0 +1,14 @@ +query getJiraProjects($fullPath: ID!) { + project(fullPath: $fullPath) { + jiraImportStatus + jiraImports { + nodes { + jiraProjectKey + scheduledAt + scheduledBy { + username + } + } + } + } +} diff --git a/app/assets/javascripts/notebook/cells/code.vue b/app/assets/javascripts/notebook/cells/code.vue index 1782e5bfe5a..f5a6f3a9817 100644 --- a/app/assets/javascripts/notebook/cells/code.vue +++ b/app/assets/javascripts/notebook/cells/code.vue @@ -21,11 +21,11 @@ export default { }, computed: { rawInputCode() { - if (this.cell.source) { + if (this.cell.source && Array.isArray(this.cell.source)) { return this.cell.source.join(''); } - return ''; + return this.cell.source || ''; }, hasOutput() { return this.cell.outputs.length; diff --git a/app/assets/javascripts/pages/projects/import/jira/index.js b/app/assets/javascripts/pages/projects/import/jira/index.js new file mode 100644 index 00000000000..cb7a7bde55d --- /dev/null +++ b/app/assets/javascripts/pages/projects/import/jira/index.js @@ -0,0 +1,3 @@ +import mountJiraImportApp from '~/jira_import'; + +document.addEventListener('DOMContentLoaded', mountJiraImportApp); diff --git a/app/assets/javascripts/pages/static_site_editor/index.js b/app/assets/javascripts/pages/projects/static_site_editor/show/index.js index 8f808dae56c..8f808dae56c 100644 --- a/app/assets/javascripts/pages/static_site_editor/index.js +++ b/app/assets/javascripts/pages/projects/static_site_editor/show/index.js diff --git a/app/assets/javascripts/projects/default_project_templates.js b/app/assets/javascripts/projects/default_project_templates.js new file mode 100644 index 00000000000..37bad1efaaf --- /dev/null +++ b/app/assets/javascripts/projects/default_project_templates.js @@ -0,0 +1,84 @@ +import { s__ } from '~/locale'; + +export default { + rails: { + text: s__('ProjectTemplates|Ruby on Rails'), + icon: '.template-option .icon-rails', + }, + express: { + text: s__('ProjectTemplates|NodeJS Express'), + icon: '.template-option .icon-express', + }, + spring: { + text: s__('ProjectTemplates|Spring'), + icon: '.template-option .icon-spring', + }, + iosswift: { + text: s__('ProjectTemplates|iOS (Swift)'), + icon: '.template-option .icon-iosswift', + }, + dotnetcore: { + text: s__('ProjectTemplates|.NET Core'), + icon: '.template-option .icon-dotnetcore', + }, + android: { + text: s__('ProjectTemplates|Android'), + icon: '.template-option .icon-android', + }, + gomicro: { + text: s__('ProjectTemplates|Go Micro'), + icon: '.template-option .icon-gomicro', + }, + gatsby: { + text: s__('ProjectTemplates|Pages/Gatsby'), + icon: '.template-option .icon-gatsby', + }, + hugo: { + text: s__('ProjectTemplates|Pages/Hugo'), + icon: '.template-option .icon-hugo', + }, + jekyll: { + text: s__('ProjectTemplates|Pages/Jekyll'), + icon: '.template-option .icon-jekyll', + }, + plainhtml: { + text: s__('ProjectTemplates|Pages/Plain HTML'), + icon: '.template-option .icon-plainhtml', + }, + gitbook: { + text: s__('ProjectTemplates|Pages/GitBook'), + icon: '.template-option .icon-gitbook', + }, + hexo: { + text: s__('ProjectTemplates|Pages/Hexo'), + icon: '.template-option .icon-hexo', + }, + nfhugo: { + text: s__('ProjectTemplates|Netlify/Hugo'), + icon: '.template-option .icon-nfhugo', + }, + nfjekyll: { + text: s__('ProjectTemplates|Netlify/Jekyll'), + icon: '.template-option .icon-nfjekyll', + }, + nfplainhtml: { + text: s__('ProjectTemplates|Netlify/Plain HTML'), + icon: '.template-option .icon-nfplainhtml', + }, + nfgitbook: { + text: s__('ProjectTemplates|Netlify/GitBook'), + icon: '.template-option .icon-nfgitbook', + }, + nfhexo: { + text: s__('ProjectTemplates|Netlify/Hexo'), + icon: '.template-option .icon-nfhexo', + }, + salesforcedx: { + text: s__('ProjectTemplates|SalesforceDX'), + icon: '.template-option .icon-salesforcedx', + }, + serverless_framework: { + text: s__('ProjectTemplates|Serverless Framework/JS'), + icon: '.template-option .icon-serverless_framework', + }, +}; diff --git a/app/assets/javascripts/projects/project_new.js b/app/assets/javascripts/projects/project_new.js index 9cbda324aff..ebf745fd046 100644 --- a/app/assets/javascripts/projects/project_new.js +++ b/app/assets/javascripts/projects/project_new.js @@ -1,7 +1,7 @@ import $ from 'jquery'; import { addSelectOnFocusBehaviour } from '../lib/utils/common_utils'; import { convertToTitleCase, humanize, slugify } from '../lib/utils/text_utility'; -import { s__ } from '~/locale'; +import DEFAULT_PROJECT_TEMPLATES from 'ee_else_ce/projects/default_project_templates'; let hasUserDefinedProjectPath = false; let hasUserDefinedProjectName = false; @@ -140,90 +140,8 @@ const bindEvents = () => { $projectFieldsForm.addClass('selected'); $selectedIcon.empty(); const value = $(this).val(); - const templates = { - rails: { - text: s__('ProjectTemplates|Ruby on Rails'), - icon: '.template-option .icon-rails', - }, - express: { - text: s__('ProjectTemplates|NodeJS Express'), - icon: '.template-option .icon-express', - }, - spring: { - text: s__('ProjectTemplates|Spring'), - icon: '.template-option .icon-spring', - }, - iosswift: { - text: s__('ProjectTemplates|iOS (Swift)'), - icon: '.template-option .icon-iosswift', - }, - dotnetcore: { - text: s__('ProjectTemplates|.NET Core'), - icon: '.template-option .icon-dotnetcore', - }, - android: { - text: s__('ProjectTemplates|Android'), - icon: '.template-option .icon-android', - }, - gomicro: { - text: s__('ProjectTemplates|Go Micro'), - icon: '.template-option .icon-gomicro', - }, - gatsby: { - text: s__('ProjectTemplates|Pages/Gatsby'), - icon: '.template-option .icon-gatsby', - }, - hugo: { - text: s__('ProjectTemplates|Pages/Hugo'), - icon: '.template-option .icon-hugo', - }, - jekyll: { - text: s__('ProjectTemplates|Pages/Jekyll'), - icon: '.template-option .icon-jekyll', - }, - plainhtml: { - text: s__('ProjectTemplates|Pages/Plain HTML'), - icon: '.template-option .icon-plainhtml', - }, - gitbook: { - text: s__('ProjectTemplates|Pages/GitBook'), - icon: '.template-option .icon-gitbook', - }, - hexo: { - text: s__('ProjectTemplates|Pages/Hexo'), - icon: '.template-option .icon-hexo', - }, - nfhugo: { - text: s__('ProjectTemplates|Netlify/Hugo'), - icon: '.template-option .icon-nfhugo', - }, - nfjekyll: { - text: s__('ProjectTemplates|Netlify/Jekyll'), - icon: '.template-option .icon-nfjekyll', - }, - nfplainhtml: { - text: s__('ProjectTemplates|Netlify/Plain HTML'), - icon: '.template-option .icon-nfplainhtml', - }, - nfgitbook: { - text: s__('ProjectTemplates|Netlify/GitBook'), - icon: '.template-option .icon-nfgitbook', - }, - nfhexo: { - text: s__('ProjectTemplates|Netlify/Hexo'), - icon: '.template-option .icon-nfhexo', - }, - salesforcedx: { - text: s__('ProjectTemplates|SalesforceDX'), - icon: '.template-option .icon-salesforcedx', - }, - serverless_framework: { - text: s__('ProjectTemplates|Serverless Framework/JS'), - icon: '.template-option .icon-serverless_framework', - }, - }; - const selectedTemplate = templates[value]; + const selectedTemplate = DEFAULT_PROJECT_TEMPLATES[value]; $selectedTemplateText.text(selectedTemplate.text); $(selectedTemplate.icon) .clone() |