Commit b2921918 authored by Kushal Pandya's avatar Kushal Pandya Committed by Olena Horal-Koretska

Add Test Case show HAML view

Adds HAML view for rendering Test Case page.
parent 1def732d
......@@ -5,10 +5,14 @@ import LabelsSelect from './labels_select';
import IssuableContext from './issuable_context';
import Sidebar from './right_sidebar';
import DueDateSelectors from './due_date_select';
import { mountSidebarLabels } from '~/sidebar/mount_sidebar';
import { mountSidebarLabels, getSidebarOptions } from '~/sidebar/mount_sidebar';
export default () => {
const sidebarOptions = JSON.parse(document.querySelector('.js-sidebar-options').innerHTML);
const sidebarOptEl = document.querySelector('.js-sidebar-options');
if (!sidebarOptEl) return;
const sidebarOptions = getSidebarOptions(sidebarOptEl);
new MilestoneSelect({
full_path: sidebarOptions.fullPath,
......
......@@ -5,15 +5,19 @@ import initSortDiscussions from './sort_discussions';
import { store } from './stores';
document.addEventListener('DOMContentLoaded', () => {
const el = document.getElementById('js-vue-notes');
if (!el) return;
// eslint-disable-next-line no-new
new Vue({
el: '#js-vue-notes',
el,
components: {
notesApp,
},
store,
data() {
const notesDataset = document.getElementById('js-vue-notes').dataset;
const notesDataset = el.dataset;
const parsedUserData = JSON.parse(notesDataset.currentUserData);
const noteableData = JSON.parse(notesDataset.noteableData);
let currentUserData = {};
......
......@@ -18,7 +18,7 @@ export default function() {
if (issueType === 'incident') {
initIncidentApp(issuableData);
} else {
} else if (issueType === 'issue') {
initIssueApp(issuableData);
}
......
......@@ -22,8 +22,8 @@ Vue.use(Translate);
Vue.use(VueApollo);
Vue.use(Vuex);
function getSidebarOptions() {
return JSON.parse(document.querySelector('.js-sidebar-options').innerHTML);
function getSidebarOptions(sidebarOptEl = document.querySelector('.js-sidebar-options')) {
return JSON.parse(sidebarOptEl.innerHTML);
}
function mountAssigneesComponent(mediator) {
......
......@@ -3,7 +3,11 @@ import Mediator from './sidebar_mediator';
import mountSidebar from './mount_sidebar';
export default () => {
const mediator = new Mediator(getSidebarOptions());
const sidebarOptEl = document.querySelector('.js-sidebar-options');
if (!sidebarOptEl) return;
const mediator = new Mediator(getSidebarOptions(sidebarOptEl));
mediator.fetch();
mountSidebar(mediator);
......
- if @issue.issue_type == 'test_case'
= render_if_exists 'projects/quality/test_cases/show'
- else
= render_ce 'projects/issues/show'
- @content_class = "limit-container-width" unless fluid_layout
- add_to_breadcrumbs _('Test Cases'), project_quality_test_cases_path(@project)
- breadcrumb_title @issue.to_reference
- page_title "#{@issue.title} (#{@issue.to_reference})", _('Test Cases')
- page_description @issue.description
-# haml-lint:disable InlineJavaScript
%script#js-issuable-app-initial-data{ type: "application/json" }= issuable_initial_data(@issue).to_json
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