Skip to content

Commit 92ca1ec

Browse files
Merge branch 'dev2021' of https://github.com/oslabs-beta/OverVue into dev2021
2 parents b08372f + 5faf85c commit 92ca1ec

File tree

4 files changed

+30
-22
lines changed

4 files changed

+30
-22
lines changed

src/components/dashboard_items/CodeSnippet.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export default {
6565
},
6666
// Creates <template> boilerplate
6767
writeTemplateTag (componentName) {
68-
// console.log('writeTemplateTag invoked!')
6968
// create reference object
7069
const htmlElementMap = {
7170
div: ['<div>', '</div>'],
@@ -82,6 +81,7 @@ export default {
8281
}
8382
8483
// Helper function that recursively iterates through the given html element's children and their children's children.
84+
// also adds proper indentation to code snippet
8585
function writeNested (childrenArray, indent) {
8686
if (!childrenArray.length) {
8787
return ''
@@ -91,7 +91,6 @@ export default {
9191
9292
childrenArray.forEach(child => {
9393
nestedString += indented
94-
// console.log(child)
9594
if (!child.text) {
9695
nestedString += `<${child}/>\n`
9796
} else {
@@ -113,7 +112,6 @@ export default {
113112
let htmlArr = this.componentMap[componentName].htmlList
114113
let outputStr = ``
115114
for (let el of htmlArr) {
116-
// console.log(el)
117115
if (!el.text) {
118116
outputStr += ` <${el}/>\n`
119117
} else {
@@ -130,7 +128,6 @@ export default {
130128
}
131129
}
132130
}
133-
// console.log(`outputStr from writeTemplateTag: ${outputStr}`)
134131
return outputStr
135132
},
136133
// Creates boiler text for <script> and <style>
@@ -156,15 +153,14 @@ export default {
156153
this.getWindowHeight()
157154
})
158155
},
159-
// Updates code snippet
156+
// Updates code snippet when adding children
160157
updated () {
161-
// console.log(`code: ${this.createCodeSnippet(this.activeComponent, this.componentMap[this.activeComponent].children)}`)
162-
// console.log('component map: ', this.componentMap);
163158
if (this.componentMap[this.activeComponent]) {
164159
this.code = `${this.createCodeSnippet(
165160
this.activeComponent,
166161
this.componentMap[this.activeComponent].children
167162
)}`
163+
// else if there is not existing component/no active component
168164
} else {
169165
this.code = `Your component boilerplate will be displayed here.`
170166
}

src/components/dashboard_items/ComponentDetails.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!--
2+
Description:
3+
Located in the Dashboard
4+
Contains the Code Snippet, HTMLQueue Components, and the Component state, actions, and props as well
5+
Functionality includes: Contains the Code Snippet and HTMLQueue Components,
6+
as well as tabs to show the Component state, actions, and props
7+
8+
-->
9+
110
<template>
211
<div class="container">
312
<q-card id="store-cards" v-if="this.activeComponentObj">

src/components/dashboard_items/Dashboard.vue

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!--
22
Description:
33
Displays OverVue's dashboard containing Component Details, Vuex Store, and the Project Tree
4-
Functionality includes: opening/closing drawer, deselecting active html, and
5-
toggling to html elements tab during component creation
4+
Functionality includes: opening/closing drawer, and contains the different Tabs
5+
As of now, no default tab selected when not selecting anything, but might change to Project Tree in the future if we want
66
-->
77

88
<template>
@@ -85,27 +85,30 @@ export default {
8585
}
8686
}
8787
},
88-
// toggles dashboard to "html" tab when existing component is not in focus
8988
watch: {
89+
// toggles dashboard to "Component Details" tab when a components is selected
9090
activeComponent: function () {
91-
// console.log('watching activeComponent in Dashboard');
92-
if (this.activeComponent === '' && this.selectedElementList.length !== 0) {
93-
this.tab = 'html'
91+
if (this.activeComponent !== '') {
92+
this.tab = 'detail'
93+
} else {
94+
// otherwise toggle dashboard to 'Project Tree' tab if no component is selected
95+
this.tab = 'tree'
9496
}
9597
},
96-
// toggles dashboard to "html" tab if component name has value & elements are in queue
98+
// otherwise toggle dashboard to 'Project Tree' tab if no component is selected or the
99+
// user is in the process of creating a component
97100
componentNameInputValue: function () {
98-
// console.log('watching componentNameInputVal')
99-
if (this.componentNameInputValue !== '' && this.selectedElementList.length !== 0 && this.activeComponent === '') {
100-
// console.log(this.selectedElementList)
101-
this.tab = 'html'
101+
if (this.componentNameInputValue !== '' && this.activeComponent === '') {
102+
console.log(this.selectedElementList.length)
103+
this.tab = 'tree'
102104
}
103105
},
104-
// toggles dashboard to "html" tab if elements are added to queue on component creation
106+
// // toggles dashboard to "Project Tree" tab if:
107+
// // no component is selected and either:
108+
// // elements are being added to component or name is being typed
105109
selectedElementList: function () {
106-
// console.log('watching selectedElementList')
107110
if (this.activeComponent === '' && this.selectedElementList.length !== 0) {
108-
this.tab = 'html'
111+
this.tab = 'tree'
109112
}
110113
}
111114
}

src/components/dashboard_items/HTMLQueue.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { setSelectedElementList, deleteSelectedElement, deleteFromComponentHtmlL
3838
import { breadthFirstSearch } from '../../utils/search.util'
3939
4040
export default {
41-
name: 'HTML Queue',
41+
name: 'HTMLQueue',
4242
props: {
4343
name: {
4444
type: String

0 commit comments

Comments
 (0)