Skip to content

Commit 0ea0500

Browse files
committed
fixed merges
2 parents a66de9f + dfb2765 commit 0ea0500

File tree

9 files changed

+178
-28
lines changed

9 files changed

+178
-28
lines changed

src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ let redoMixin = {
138138
store: this.$store
139139
}
140140
this.$store.commit('EMPTY_STATE', payload)
141-
console.log(this.$store)
142141
this.doneAction.forEach(action => {
143142
//console.log('In the loop', this.$store)
144143
// this.$store.commit(`${mutation.type}`, mutation.payload);

src/components/ComponentDisplay.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ export default {
414414
/* height: 500px; */
415415
/* width: 500px; */
416416
/* original is 70 */
417-
height: 90vh;
418-
width: 100%;
417+
min-height: 1080px;
418+
min-width: 1920px;
419419
position: relative;
420420
/* background: rgb(211, 211, 210); */
421421
}

src/components/ExportProject.vue

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,55 @@ export default {
143143
input: ['<input />', ''],
144144
navbar: ['<nav>', '</nav>']
145145
}
146+
147+
/* Function to loop through nested elements */
148+
function writeNested (childrenArray, indent) {
149+
if (!childrenArray.length) {
150+
return ''
151+
}
152+
let indented = indent + ' '
153+
let nestedString = ''
154+
155+
childrenArray.forEach(child => {
156+
nestedString += indented
157+
// console.log(child)
158+
if (!child.text) {
159+
nestedString += `<${child}/>\n`
160+
} else {
161+
if (child.children.length) {
162+
nestedString += htmlElementMap[child.text][0]
163+
nestedString += '\n'
164+
nestedString += writeNested(child.children, indented)
165+
nestedString += indented + htmlElementMap[child.text][1]
166+
nestedString += '\n'
167+
} else {
168+
nestedString += htmlElementMap[child.text][0] + htmlElementMap[child.text][1] + '\n'
169+
}
170+
}
171+
})
172+
return nestedString
173+
}
174+
146175
// loop to iterate through compName arr
147176
let htmlArr = this.componentMap[compName].htmlList
148-
let outputStr = ''
177+
let outputStr = ``
149178
for (let el of htmlArr) {
150-
outputStr += '\t\t'
151-
outputStr += htmlElementMap[el.text][0]
152-
outputStr += htmlElementMap[el.text][1]
153-
outputStr += `\n`
179+
// console.log(el)
180+
if (!el.text) {
181+
outputStr += ` <${el}/>\n`
182+
} else {
183+
outputStr += ` `
184+
if (el.children.length) {
185+
outputStr += htmlElementMap[el.text][0]
186+
outputStr += '\n'
187+
outputStr += writeNested(el.children, ` `)
188+
outputStr += ` `
189+
outputStr += htmlElementMap[el.text][1]
190+
outputStr += ` \n`
191+
} else {
192+
outputStr += htmlElementMap[el.text][0] + htmlElementMap[el.text][1] + '\n'
193+
}
194+
}
154195
}
155196
console.log(`outputStr from writeTemplateTag: ${outputStr}`)
156197
return outputStr
@@ -199,15 +240,6 @@ export default {
199240
} else {
200241
// console.log(`else (if compName === 'App'`);
201242
str += `<div>\n`
202-
children.forEach(name => {
203-
str += `\t\t<${
204-
// name.componentName
205-
name
206-
}>\n\t\t</${
207-
// name.componentName
208-
name
209-
}>\n`
210-
})
211243
}
212244
// writes the html tag boilerplate
213245
let templateTagStr = this.writeTemplateTag(compName)

src/components/HomeQueue.vue

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,34 @@ li {
158158
text-align: center;
159159
}
160160
161+
@media (max-width: 900px) {
162+
.list-group-item {
163+
display: inline-block;
164+
margin: 2px 1.5%;
165+
width: 45%;
166+
border-radius: 0.5cm;
167+
border: 2px solid $secondary;
168+
background-color: $secondary;
169+
height: 35px;
170+
padding-top: 6px;
171+
text-align: center;
172+
}
173+
}
174+
175+
@media (max-width: 700px) {
176+
.list-group-item {
177+
display: inline-block;
178+
margin: 2px 1.5%;
179+
width: 90%;
180+
border-radius: 0.5cm;
181+
border: 2px solid $secondary;
182+
background-color: $secondary;
183+
height: 35px;
184+
padding-top: 6px;
185+
text-align: center;
186+
}
187+
}
188+
161189
.list-group-item-selected {
162190
display: inline-block;
163191
margin: 2px 1.5%;
@@ -170,19 +198,53 @@ li {
170198
text-align: center;
171199
}
172200
201+
@media (max-width: 900px) {
202+
.list-group-item-selected {
203+
display: inline-block;
204+
margin: 2px 1.5%;
205+
width: 45%;
206+
border-radius: 0.5cm;
207+
border: 2px solid white;
208+
background-color: $secondary;
209+
height: 35px;
210+
padding-top: 6px;
211+
text-align: center;
212+
}
213+
}
214+
215+
@media (max-width: 700px) {
216+
.list-group-item-selected {
217+
display: inline-block;
218+
margin: 2px 1.5%;
219+
width: 90%;
220+
border-radius: 0.5cm;
221+
border: 2px solid white;
222+
background-color: $secondary;
223+
height: 35px;
224+
padding-top: 6px;
225+
text-align: center;
226+
}
227+
}
228+
229+
173230
.fa-trash:hover {
174231
cursor: pointer;
175232
color: red;
176233
}
177234
178235
.fa-trash {
179236
position: relative;
180-
left: 20px;
181-
237+
// left: 20px;
238+
top: 2px;
239+
right: 35px;
240+
float: right;
182241
}
183242
.fa-angle-double-down {
184243
position: relative;
185-
right: 20px;
244+
// right: 20px;
245+
top: 2px;
246+
left: 35px;
247+
float: left;
186248
}
187249
188250
.fa-angle-double-down:hover {

src/components/HomeSideDropDownItems/ComponentList.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<template>
22
<div class="home-sidebar">
33
<multiselect
4-
class='multiselect'
5-
v-model="value"
6-
:options='options'
7-
:searchable="true"
4+
class='multiselect'
5+
v-model="value"
6+
:options='options'
7+
:searchable="true"
88
:close-on-select="true"
99
:max-height="90"
1010
:option-height="20"
1111
@input="handleSelect(value)"
12+
@open="resetActiveComponent"
1213
placeholder="Select a component">
1314
<span slot='noResult'>No components found.</span>
1415
</multiselect>
@@ -87,6 +88,11 @@ export default {
8788
this.setActiveComponent(componentName)
8889
this.value = ''
8990
this.activeComponentData.isActive = true
91+
},
92+
resetActiveComponent () {
93+
if (this.activeComponent !== '') {
94+
this.setActiveComponent('')
95+
}
9096
}
9197
}
9298
}

src/components/ParentMultiselect.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:close-on-select="true"
99
:options="options"
1010
@input="handleSelect"
11+
@open="resetActiveComponent"
1112
:max-height="90"
1213
:option-height="20"
1314
:searchable="true"
@@ -44,14 +45,19 @@ export default {
4445
methods: {
4546
...mapActions([
4647
// 'addParent',
47-
'parentSelected'
48+
'parentSelected', 'setActiveComponent'
4849
]),
4950
handleSelect (value) {
5051
// Set Active Component to selected Parent
5152
// this.setActiveComponent(value)
5253
// this.addParent(value)
5354
// Set parentSelected to true IF VALUE IS A VALID PARENT (not null)
5455
this.parentSelected(value)
56+
},
57+
resetActiveComponent () {
58+
if (this.activeComponent !== '') {
59+
this.setActiveComponent('')
60+
}
5561
}
5662
},
5763
watch: {

src/components/RouteDisplay.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<template>
22
<div>
33
<q-input
4-
@keyup.enter.native="handleEnterKeyPress"
4+
@keyup.enter.native="handleEnterKeyPress "
55
standout="bg-secondary text-white"
66
bottom-slots
77
v-model="newRoute"
88
label="Enter new route"
99
:dense="dense"
1010
class="input-add"
11+
@click.native="resetActiveComponent"
1112
></q-input>
1213
<!--<div class="route-display">-->
1314
<!--
@@ -35,7 +36,7 @@ export default {
3536
}
3637
},
3738
methods: {
38-
...mapActions(['addRouteToRouteMap', 'setRoutes']),
39+
...mapActions(['addRouteToRouteMap', 'setRoutes', 'setActiveComponent']),
3940
handleEnterKeyPress () {
4041
const newRouteName = this.newRoute.replace(/[^a-z0-9-_.]/gi, '')
4142
if (!newRouteName.trim() || this.routes[newRouteName] || this.componentMap[newRouteName]) {
@@ -48,6 +49,11 @@ export default {
4849
})
4950
5051
.catch(err => console.log(err))
52+
},
53+
resetActiveComponent () {
54+
if (this.activeComponent !== '') {
55+
this.setActiveComponent('')
56+
}
5157
}
5258
}
5359
}

src/css/app.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// app global css
22
main {
33
background: #0e0f0f;
4-
overflow: auto;
4+
overflow: scroll;
55

66
}
77

src/layouts/MyLayout.vue

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@
99
<!-- <q-avatar></q-avatar> -->
1010
OverVue
1111
</q-toolbar-title>
12+
<div>
13+
<!-- <i class="fa fa-undo" aria-hidden="true"></i> -->
14+
<!-- <i class="fas fa fa-repeat" aria-hidden="true"></i> -->
15+
<i v-if='this.$router.app.$children[0].doneAction.length' class="fa fa-backward" aria-hidden="true" @click="undo"></i>
16+
<i v-else class="fa fa-backward" id="unavailable" aria-hidden="true"></i>
17+
<i v-if='this.$router.app.$children[0].undoneAction.length' class="fa fa-forward" aria-hidden="true" @click="redo"></i>
18+
<i v-else class="fa fa-forward" id="unavailable" aria-hidden="true"></i>
1219
<OpenProjectComponent />
1320
<SaveProjectComponent />
1421
<ExportProjectComponent />
22+
</div>
1523
</q-toolbar>
1624
</q-header>
1725

@@ -55,11 +63,42 @@ export default {
5563
SaveProjectComponent,
5664
OpenProjectComponent,
5765
UploadImage
66+
},
67+
methods: {
68+
undo () {
69+
console.log('UNDO FROM BUTTON')
70+
console.log('look at me ', this.$router.app.$children[0].doneAction)
71+
this.$router.app.$children[0].undo()
72+
},
73+
redo () {
74+
console.log('REDO FROM BUTTON')
75+
this.$router.app.$children[0].redo()
76+
}
5877
}
5978
}
6079
</script>
6180

6281
<style lang="stylus">
82+
83+
.fa-backward, .fa-forward {
84+
padding: 0 5px
85+
}
86+
87+
.fa-backward:hover, .fa-forward:hover {
88+
cursor: pointer;
89+
color: #00ffff
90+
}
91+
92+
#unavailable {
93+
color: grey;
94+
cursor: default
95+
}
96+
97+
.fa-backward:active, .fa-forward:active {
98+
box-shadow: 0 1px inherit;
99+
transform: translateY(1px);
100+
}
101+
63102
.q-layout {
64103
transition-timing-function: ease-in;
65104
}

0 commit comments

Comments
 (0)