Skip to content

Commit b40e544

Browse files
committed
Merge branch 'master' into windows
2 parents 6b5d8fd + 9137d95 commit b40e544

File tree

10 files changed

+96
-121
lines changed

10 files changed

+96
-121
lines changed

src/components/ComponentDisplay.vue

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
@deactivated="onDeactivated(componentData)"
1919
@dragging="onDrag"
2020
@resizing="onResize"
21-
@dblclick.native="onDoubleClick(componentData)"
2221
@dragstop="finishedDrag"
2322
@resizestop="finishedResize"
2423
:onDragStart="recordInitialPosition"
@@ -177,7 +176,7 @@ export default {
177176
console.log('mockBg is working', this.imagePath[this.activeRoute])
178177
return this.imagePath[this.activeRoute]
179178
? {
180-
background: `url("${this.userImage}") center/contain no-repeat`
179+
background: `url("${this.userImage}") center/contain no-repeat rgba(223, 218, 218, 0.886)`,
181180
}
182181
: {}
183182
}
@@ -346,12 +345,6 @@ export default {
346345
// console.log("We just clicked without making a new active component")
347346
// }
348347
},
349-
onDoubleClick (compData) {
350-
if (!(componentData.componentName === this.activeComponent)) {
351-
this.setActiveComponent(componentData.componentName)
352-
}
353-
this.activeComponentData.isActive = true
354-
},
355348
handleAddChild () {
356349
// render modal with childrenmultiselect in it
357350
this.modalOpen = true
@@ -374,11 +367,6 @@ export default {
374367
if (e.target.innerText === '-' && payload.z > 0) payload.z--
375368
this.updateComponentLayer(payload)
376369
},
377-
// @dblclick.native="onDoubleClick(componentData)"
378-
// onDoubleClick (compData) {
379-
// this.setActiveComponent(compData.componentName)
380-
// this.activeComponentData.isActive = true
381-
// }
382370
handleClick (event) {
383371
if (event.target.className === 'component-display grid-bg') {
384372
if (!(this.activeComponent === '')) this.setActiveComponent('')
@@ -395,11 +383,9 @@ export default {
395383
top: -18px;
396384
left: 2px;
397385
color: black;
386+
-webkit-text-stroke: 0.4px white;
398387
font-weight: 800;
399-
/* background: rgba(0, 0, 0, 0.678); */
400-
/* width: 1rem; */
401388
line-height: 1.2;
402-
/* margin: 10px; */
403389
z-index: -1;
404390
}
405391
.component-children {

src/components/Footer.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<q-tab name="html" label="HTML Elements" id="label-text" />
2323
</q-tabs>
2424

25-
<q-tab-panels v-model="tab" animated class="bg-primary text-white full-footer">
25+
<q-tab-panels v-model="tab" animated class="html-bg text-white" >
2626
<q-tab-panel name="code">
2727
<CodeSnippet />
2828
</q-tab-panel>
@@ -35,7 +35,7 @@
3535
<Tree />
3636
</q-tab-panel>
3737

38-
<q-tab-panel name="html">
38+
<q-tab-panel name="html" :style="{height: `${height}vh`}">
3939
<HomeQueue />
4040
</q-tab-panel>
4141
</q-tab-panels>
@@ -172,14 +172,18 @@ i {
172172
background: black;
173173
}
174174
175-
.full-footer {
176-
// height: 100vh;
177-
padding-bottom: 0px;
178-
}
175+
// .full-footer {
176+
// // height: 100vh;
177+
178+
// }
179179
180180
#footer-cards {
181181
height: 100%;
182182
border-radius: 0px;
183183
background: #737578;
184184
}
185+
.html-bg {
186+
// give html background color of grey
187+
background-color: #202122;
188+
}
185189
</style>

src/components/HomeQueue.vue

Lines changed: 12 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
@end="drag = false"
1515
>
1616
<div :class="activeHTML === element[2] ? 'list-group-item-selected' : 'list-group-item'" @dblclick.self="setActiveElement(element)" v-for="(element) in renderList" :key="element[1] + Date.now()">
17-
<i class="fas fa fa-angle-double-down fa-md" @click="setLayer({text: element[0], id: element[2]})"></i>
17+
<!-- <i class="fas fa fa-angle-double-down fa-md" @click="setLayer({text: element[0], id: element[2]})"></i> -->
18+
<i v-if='activeComponent === "" ' class="fas fa fa-angle-double-down fa-md" id="unavailable"></i>
19+
<i v-else class="fas fa fa-angle-double-down fa-md" @click="setLayer({text: element[0], id: element[2]})"></i>
20+
<!-- <i class="fas fa fa-angle-double-down fa-md" @click="setLayer({text: element[0], id: element[2]})"></i> -->
1821
{{ element[0] }}
1922
<i class="fas fa fa-trash fa-md" @click.self="deleteElement([element[1],element[2]])"></i>
2023
</div>
@@ -137,7 +140,7 @@ export default {
137140

138141
<style lang="stylus" scoped>
139142
.home-queue {
140-
height: 100%;
143+
padding-bottom: 40px;
141144
}
142145
li {
143146
list-style-type: none;
@@ -149,6 +152,7 @@ li {
149152
.list-group-item {
150153
display: inline-block;
151154
margin: 2px 1.5%;
155+
min-width: 175px;
152156
width: 30%;
153157
border-radius: 0.5cm;
154158
border: 2px solid $secondary;
@@ -158,37 +162,10 @@ li {
158162
text-align: center;
159163
}
160164
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-
189165
.list-group-item-selected {
190166
display: inline-block;
191167
margin: 2px 1.5%;
168+
min-width: 175px;
192169
width: 30%;
193170
border-radius: 0.5cm;
194171
border: 2px solid white;
@@ -198,35 +175,6 @@ li {
198175
text-align: center;
199176
}
200177
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-
230178
.fa-trash:hover {
231179
cursor: pointer;
232180
color: red;
@@ -261,6 +209,11 @@ li {
261209
color: #41B883;
262210
}
263211
212+
#unavailable {
213+
color: grey;
214+
cursor: default
215+
}
216+
264217
hr {
265218
border: 1px solid grey
266219
}

src/components/HomeSideDropDown.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<div class="q-pa-md" style="max-width: 350px">
33
<q-list padding bordered class="rounded-borders drawer-menu">
44
<q-expansion-item dense dense-toggle expand-separator label="Components">
5-
<q-card>
6-
<q-card-section>
7-
<div class="input-container">
8-
<ComponentList />
9-
</div>
10-
</q-card-section>
11-
</q-card>
5+
<q-card>
6+
<q-card-section>
7+
<div class="input-container" style='height: 130px'>
8+
<ComponentList />
9+
</div>
10+
</q-card-section>
11+
</q-card>
1212
</q-expansion-item>
1313
<q-expansion-item dense dense-toggle expand-separator label="Routes">
1414
<q-card>
1515
<q-card-section>
16-
<div class="input-container">
16+
<div class="input-container" style='height: 150px'>
1717
<RouteDisplay />
1818
<br />
1919
</div>
@@ -48,13 +48,15 @@ export default {
4848
</script>
4949

5050
<style lang="stylus">
51+
5152
.input-add {
5253
margin: 0em 1em 0em 1em;
5354
}
5455
5556
.input-container {
5657
margin-top: 1rem;
5758
background: $subsecondary;
59+
overflow-y: auto;
5860
}
5961
6062
.red {

src/components/HomeSideDropDownItems/ComponentList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default {
5656
...mapState(['routes', 'activeRoute', 'activeComponent']),
5757
activeRouteDisplay () {
5858
let component = this.routes[this.activeRoute]
59-
console.log(component)
59+
console.log('component', component)
6060
return component
6161
},
6262
activeComponentData () {

src/css/app.styl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,19 @@ main {
2929
}
3030
// ::-webkit-scrollbar {
3131
// width: 2px;
32-
// }
32+
// }
33+
34+
::-webkit-scrollbar {
35+
width: 12px;
36+
}
37+
38+
::-webkit-scrollbar-track {
39+
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
40+
border-radius: 10px;
41+
}
42+
43+
::-webkit-scrollbar-thumb {
44+
border-radius: 10px;
45+
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
46+
}
47+

src/layouts/MyLayout.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default {
142142
// background: #272822;
143143
}
144144
145-
::-webkit-scrollbar {
146-
display: none;
147-
}
145+
// ::-webkit-scrollbar {
146+
// display: none;
147+
// }
148148
</style>

src/store/mutations.js

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -379,25 +379,33 @@ const mutations = {
379379
state.parentSelected = payload
380380
},
381381
[types.DELETE_ROUTE]: (state, payload) => {
382+
const newRoutes = { ...state.routes }
383+
const newMap = { ...state.componentMap }
384+
const newImagePath = { ...state.imagePath }
385+
382386
const deleteChildren = (child) => {
383-
if (state.componentMap[child.componentName].children.length) {
384-
child.children.forEach((grandchild) => {
385-
deleteChildren(grandchild)
386-
})
387-
}
388-
delete state.componentMap[child.componentName]
387+
if (newMap[child.componentName].children.length) {
388+
child.children.forEach((grandchild) => {
389+
deleteChildren(grandchild)
390+
})
391+
}
392+
delete newMap[child.componentName]
389393
}
390-
state.routes[payload].forEach((child => {
394+
newRoutes[payload].forEach(child => {
391395
deleteChildren(child)
392-
}))
396+
})
393397

394-
delete state.routes[payload]
395-
delete state.componentMap[payload]
398+
delete newRoutes[payload]
399+
delete newMap[payload]
400+
delete newImagePath[payload]
396401

397-
state.componentMap.App.children = state.componentMap.App.children.filter((route) => {
398-
return route !== payload;
402+
newMap.App.children = newMap.App.children.filter((route) => {
403+
return route !== payload
399404
})
400-
if (!state.routes[state.activeRoute]) state.activeRoute = 'HomeView'
405+
if (!newRoutes[state.activeRoute]) state.activeRoute = 'HomeView'
406+
state.routes = newRoutes
407+
state.componentMap = newMap
408+
state.imagePath = newImagePath
401409
},
402410
[types.DELETE_COMPONENT]: (state, payload) => {
403411
const stateCopy = state
@@ -422,7 +430,7 @@ const mutations = {
422430
// state.imagePath[payload.route] = payload.img
423431
},
424432
[types.CLEAR_IMAGE]: (state, payload) => {
425-
console.log(`clear image invoked`)
433+
console.log(`clear image invoked`, payload)
426434
// console.log('current routes img url: ', state.imagePath[payload.route])
427435
if (state.imagePath[payload.route]) state.imagePath[payload.route] = ''
428436
// console.log('after removal', state.imagePath[payload.route])

test/jest/__tests__/App.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe("Adding actions and state to components", () => {
7070
});
7171
});
7272

73-
describe("userActions mutation", () => {
73+
xdescribe("userActions mutation", () => {
7474
let actions;
7575
let store;
7676
beforeEach(() => {
@@ -88,7 +88,7 @@ describe("userActions mutation", () => {
8888
});
8989
});
9090

91-
describe("userStore mutation", () => {
91+
xdescribe("userStore mutation", () => {
9292
let actions;
9393
let store;
9494
store = {
@@ -126,7 +126,7 @@ describe("userStore mutation", () => {
126126
* `userStore` holds the user defined state objects
127127
*/
128128

129-
describe("Delete state in userStore/componentMap", () => {
129+
xdescribe("Delete state in userStore/componentMap", () => {
130130
let state;
131131
beforeEach(() => {
132132
state = {
@@ -143,7 +143,7 @@ describe("Delete state in userStore/componentMap", () => {
143143
userStore: { state1: true, state2: [] }
144144
};
145145
});
146-
describe('"DELETE_USER_STATE" should delete property from "userStore" object', () => {
146+
xdescribe('"DELETE_USER_STATE" should delete property from "userStore" object', () => {
147147
it("should delete a single state property", () => {
148148
mutations.DELETE_USER_STATE(state, "state1");
149149
expect(state.userStore).toEqual({ state2: [] });

0 commit comments

Comments
 (0)