Props use objects with required & type values

This commit is contained in:
Phil Hughes 2017-01-31 14:57:33 +00:00 committed by Fatih Acet
parent 103c78f18c
commit 00b835bad9
7 changed files with 73 additions and 23 deletions

View file

@ -6,9 +6,24 @@
window.gl.issueBoards = window.gl.issueBoards || {};
gl.issueBoards.IssueCardInner = Vue.extend({
props: [
'issue', 'issueLinkBase', 'list', 'rootPath',
],
props: {
issue: {
type: Object,
required: true,
},
issueLinkBase: {
type: String,
required: true,
},
list: {
type: Object,
required: false,
},
rootPath: {
type: String,
required: true,
},
},
methods: {
showLabel(label) {
if (!this.list) return true;

View file

@ -6,9 +6,16 @@
data() {
return ModalStore.store;
},
props: [
'image', 'newIssuePath',
],
props: {
image: {
type: String,
required: true,
},
newIssuePath: {
type: String,
required: true,
},
},
computed: {
contents() {
const obj = {

View file

@ -41,7 +41,7 @@
},
},
components: {
listsDropdown: gl.issueBoards.ModalFooterListsDropdown,
'lists-dropdown': gl.issueBoards.ModalFooterListsDropdown,
},
template: `
<footer

View file

@ -24,7 +24,7 @@
},
},
components: {
modalTabs: gl.issueBoards.ModalTabs,
'modal-tabs': gl.issueBoards.ModalTabs,
},
template: `
<div>

View file

@ -8,10 +8,24 @@
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.IssuesModal = Vue.extend({
props: [
'blankStateImage', 'newIssuePath', 'issueLinkBase',
'rootPath',
],
props: {
blankStateImage: {
type: String,
required: true,
},
newIssuePath: {
type: String,
required: true,
},
issueLinkBase: {
type: String,
required: true,
},
rootPath: {
type: String,
required: true,
},
},
data() {
return ModalStore.store;
},
@ -76,10 +90,10 @@
},
},
components: {
modalHeader: gl.issueBoards.IssuesModalHeader,
modalList: gl.issueBoards.ModalList,
modalFooter: gl.issueBoards.ModalFooter,
emptyState: gl.issueBoards.ModalEmptyState,
'modal-header': gl.issueBoards.IssuesModalHeader,
'modal-list': gl.issueBoards.ModalList,
'modal-footer': gl.issueBoards.ModalFooter,
'empty-state': gl.issueBoards.ModalEmptyState,
},
template: `
<div

View file

@ -6,9 +6,16 @@
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalList = Vue.extend({
props: [
'issueLinkBase', 'rootPath',
],
props: {
issueLinkBase: {
type: String,
required: true,
},
rootPath: {
type: String,
required: true,
},
},
data() {
return ModalStore.store;
},
@ -94,7 +101,7 @@
this.destroyMasonry();
},
components: {
issueCardInner: gl.issueBoards.IssueCardInner,
'issue-card-inner': gl.issueBoards.IssueCardInner,
},
template: `
<section

View file

@ -6,9 +6,16 @@
window.gl.issueBoards = window.gl.issueBoards || {};
gl.issueBoards.RemoveIssueBtn = Vue.extend({
props: [
'issue', 'list',
],
props: {
issue: {
type: Object,
required: true,
},
list: {
type: Object,
required: true,
},
},
methods: {
removeIssue() {
const lists = this.issue.getLists();