Commit 4122fa49 authored by Coung Ngo's avatar Coung Ngo

Add Jira Import Vue app foundation

Added foundation for a Vue app for the Jira Import page.
Uses feature flags :jira_issue_import and :jira_issue_import_vue
parent 004ecae8
<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>
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,
},
});
},
});
}
query getJiraProjects($fullPath: ID!) {
project(fullPath: $fullPath) {
jiraImportStatus
jiraImports {
nodes {
jiraProjectKey
scheduledAt
scheduledBy {
username
}
}
}
}
}
import mountJiraImportApp from '~/jira_import';
document.addEventListener('DOMContentLoaded', mountJiraImportApp);
......@@ -7,6 +7,8 @@ module Projects
before_action :jira_integration_configured?
def show
return if Feature.enabled?(:jira_issue_import_vue, @project)
unless @project.import_state&.in_progress?
jira_client = @project.jira_service.client
jira_projects = jira_client.Project.all
......
- title = _('Jira Issue Import')
- page_title title
- breadcrumb_title title
- header_title _("Projects"), root_path
- if Feature.enabled?(:jira_issue_import_vue, @project)
.js-jira-import-root{ data: { project_path: @project.full_path } }
- else
- title = _('Jira Issue Import')
- page_title title
- breadcrumb_title title
- header_title _("Projects"), root_path
= render 'import/shared/errors'
= render 'import/shared/errors'
- if @project.import_state&.in_progress?
- if @project.import_state&.in_progress?
%h3.page-title.d-flex.align-items-center
= sprite_icon('issues', size: 16, css_class: 'mr-1')
= _('Import in progress')
- elsif @jira_projects.present?
- elsif @jira_projects.present?
%h3.page-title.d-flex.align-items-center
= sprite_icon('issues', size: 16, css_class: 'mr-1')
= _('Import issues from Jira')
......
......@@ -59,6 +59,7 @@ describe Projects::Import::JiraController do
context 'when feature flag enabled' do
before do
stub_feature_flags(jira_issue_import: true)
stub_feature_flags(jira_issue_import_vue: false)
end
context 'when jira service is enabled for the project' do
......
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