Skip to content

Commit 1ee9e6f

Browse files
committed
updated icons; updated logo; moved undo redo back up to toolbar; added validation on component name field; added HTML element queue field in create component menu; updated styling
1 parent ec61f47 commit 1ee9e6f

File tree

14 files changed

+285
-59
lines changed

14 files changed

+285
-59
lines changed

src-electron/icons/icon.icns

12.2 KB
Binary file not shown.

src-electron/icons/icon.ico

-109 KB
Binary file not shown.

src-electron/icons/icon.png

8.39 KB
Loading

src/assets/OverVue_navLogo.png

2.4 KB
Loading

src/components/dashboard_items/Dashboard.vue

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@ Description:
2020
name="detail"
2121
label="Component Details"
2222
id="label-text"
23-
style="border-right: 3px solid black"
24-
><i class="fas fa-code"></i
25-
></q-tab>
23+
></q-tab>
2624
<q-tab name="tree" label="Project Tree" id="label-text"
27-
><i class="fas fa-code-branch fa-flip-vertical"
28-
/></q-tab>
25+
></q-tab>
2926
<q-tab name="routes" label="Routes" id="label-text"
30-
><i class="fas fa-project-diagram"></i
31-
></q-tab>
27+
></q-tab>
3228
</q-tabs>
3329
<q-tab-panels v-model="tab" animated class="html-bg text-white">
3430
<q-tab-panel name="detail">
@@ -164,23 +160,23 @@ i {
164160
// changes the length of the tab panels
165161
.q-tab-panels {
166162
padding: 0px !important;
167-
border-top: 3px solid black;
163+
// border-top: 3px solid black;
168164
}
169165
170166
.q-tabs {
171-
background: #11120f;
167+
background: $subprimary;
172168
}
173169
174170
.toolbar-background {
175-
background: black;
171+
background: $subprimary;
176172
}
177173
178174
#dashboard-cards {
179175
display: flex;
180176
flex-direction: column;
181177
height: 100%;
182178
border-radius: 0px;
183-
background: #737578;
179+
background: $subprimary;
184180
}
185181
.html-bg {
186182
/* // give html background color of grey */
@@ -191,8 +187,8 @@ i {
191187
height: 100%;
192188
}
193189
194-
.bord {
195-
border-left: 3px solid black;
196-
border-right: 3px solid black;
197-
}
190+
// .bord {
191+
// border-left: 3px solid black;
192+
// border-right: 3px solid black;
193+
// }
198194
</style>

src/components/dashboard_items/HTMLQueue.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Description:
2020
@dblclick.self="setActiveElement(element)"
2121
v-for="(element) in renderList" :key="element[1] + Date.now()"
2222
>
23-
<i v-if='activeComponent === "" || exceptions.includes(element[0]) ' class="fas fa fa-angle-double-down fa-md" id="unavailable"></i>
23+
<i v-if='activeComponent === "" || exceptions.includes(element[0]) '></i>
2424
<i v-else class="fas fa fa-angle-double-down fa-md" @click="setLayer({text: element[0], id: element[2]})"></i>
2525
{{ element[0] }}
2626
<i class="fas fa fa-trash fa-md" @click.self="deleteElement([element[1],element[2]])"></i>

src/components/dashboard_items/Tree.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,14 @@ export default {
236236
margin: 6px;
237237
min-height: 28px;
238238
color: #FFFFFF;
239-
background-color: #289EAD;
239+
background-color: $secondary;
240240
text-align: center;
241241
line-height: 28px;
242242
}
243243
244244
.tree-node-active {
245-
background-color: #155158;
245+
background-color: $accent;
246+
color: #155158;
246247
border: 2px solid rgb(196, 154, 19);
247248
}
248249

src/components/home_sidebar_items/ComponentTab/ComponentTab.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,20 @@ export default {
3939
#store-cards {
4040
height: 100%;
4141
border-radius: 0px;
42-
background-color: #202122;
42+
background-color: $subprimary;
43+
4344
}
4445
.q-tab-panel {
4546
height: 100%;
46-
// matchs the code editor bg
47+
// matches the code editor bg
4748
background: $subprimary;
4849
// changes the length of the tab panels
4950
}
5051
.q-tab-panels {
5152
height: 100%;
5253
}
5354
.q-tabs {
54-
background: #11120F;
55+
background: $subprimary;
56+
padding: 20px 0;
5557
}
5658
</style>

src/components/home_sidebar_items/ComponentTab/CreateComponent.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ Description:
1717
v-if="activeComponent === ''"
1818
v-on:keyup.delete.stop
1919
v-model="componentNameInputValue"
20-
label="Component Name"
20+
label="Set component name *"
2121
color="accent"
2222
dark
2323
dense
2424
outlined
2525
item-aligned
2626
padding="5px"
2727
class="input-add"
28+
reactive-rules
29+
:rules="[ val => val.length != 0 || 'Please set a component name', val => !Object.keys(this.componentMap).includes(val) || 'A component with this name already exists' ]"
2830
></q-input>
2931
</form>
3032

@@ -39,7 +41,9 @@ Description:
3941
@activeLayer="addNestedNoActive"
4042
/>
4143
</div>
42-
<div class="componentHTML"></div>
44+
<div class="componentHTML">
45+
<CreateComponentHTMLQueue></CreateComponentHTMLQueue>
46+
</div>
4347
<br />
4448

4549
<q-btn
@@ -48,7 +52,7 @@ Description:
4852
color="secondary"
4953
label="Create Component"
5054
@click="createComponent"
51-
:disabled="!componentNameInputValue.trim()"
55+
:disabled="!componentNameInputValue.trim() || Object.keys(this.componentMap).includes(componentNameInputValue.trim())"
5256
/>
5357
</q-expansion-item>
5458
</div>
@@ -58,13 +62,15 @@ Description:
5862
import Icons from "./Icons.vue";
5963
import ParentMultiselect from "./ParentMultiselect.vue";
6064
import ImportComponent from "./ImportComponent.vue"
65+
import CreateComponentHTMLQueue from "./CreateComponentHTMLQueue.vue";
6166
import { mapState, mapActions } from "vuex";
6267
export default {
6368
name: "HomeSidebar",
6469
components: {
6570
Icons,
6671
ParentMultiselect,
67-
ImportComponent
72+
ImportComponent,
73+
CreateComponentHTMLQueue
6874
},
6975
computed: {
7076
...mapState([
@@ -182,6 +188,7 @@ export default {
182188
.componentHTML {
183189
height: 100px;
184190
margin-top: 20px;
191+
background-color: rgba($subsecondary, .5);
185192
overflow-y: scroll;
186193
border: 1px solid rgba(245, 245, 245, 0.3);
187194
border-radius: 5px;
@@ -193,6 +200,10 @@ export default {
193200
#create-component-btn {
194201
width: 100%;
195202
}
203+
.q-expansion-item {
204+
margin-bottom: 10px;
205+
}
206+
196207
// .is-primary {
197208
// height: 45px;
198209
// }
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
<!--
2+
Description:
3+
Display of HTML elements in dashboard
4+
Functionality: delete/set active elements and traverse nested HTML elements
5+
-->
6+
7+
<template>
8+
<section class="html-queue">
9+
<!-- <i v-if='!this.activeLayer.id' class="fas fa fa-chevron-up fa-md" @click="setParentLayer"></i> -->
10+
<!-- <span class='list-title' v-if='this.activeLayer.id !== ""'> Viewing Elements in '{{ depth }}' </span>
11+
<span class='list-title' v-else-if='!this.activeComponent'></span> -->
12+
<!-- <hr> -->
13+
<div
14+
group="people"
15+
class="list-group"
16+
>
17+
<!-- <p v-if='!this.componentMap[this.activeComponent]?.htmlList.length'>No HTML elements in component</p> -->
18+
<div
19+
:class="activeHTML === element[2] ? 'list-group-item-selected' : 'list-group-item'"
20+
@dblclick.self="setActiveElement(element)"
21+
v-for="(element) in renderList" :key="element[1] + Date.now()"
22+
>
23+
<i v-if='activeComponent === "" || exceptions.includes(element[0]) '></i>
24+
<i v-else class="fas fa fa-angle-double-down fa-md" @click="setLayer({text: element[0], id: element[2]})"></i>
25+
{{ element[0] }}
26+
<i class="fas fa fa-trash fa-md" @click.self="deleteElement([element[1],element[2]])"></i>
27+
</div>
28+
29+
</div>
30+
</section>
31+
</template>
32+
33+
<script>
34+
35+
import { mapState, mapActions } from 'vuex'
36+
import { setSelectedElementList, deleteSelectedElement, deleteFromComponentHtmlList } from '../../../store/types'
37+
import { breadthFirstSearch } from '../../../utils/search.util'
38+
39+
export default {
40+
name: 'HTMLQueue',
41+
props: {
42+
name: {
43+
type: String
44+
},
45+
listToRender: {
46+
type: Array
47+
}
48+
},
49+
data () {
50+
return {
51+
exceptions: ['input', 'img', 'link']
52+
}
53+
},
54+
computed: {
55+
...mapState(['selectedElementList', 'componentMap', 'activeComponent', 'activeHTML', 'activeLayer']),
56+
renderList: {
57+
get () {
58+
if (this.activeComponent === '') return this.selectedElementList.map((el, index) => [el.text, index, el.id])
59+
// change activeComponent's htmlList into an array of arrays ([element/component name, index in state])
60+
if (this.activeComponent !== '' && this.activeLayer.id === '') {
61+
let sortedHTML = this.componentMap[this.activeComponent].htmlList.map((el, index) => [el.text, index, el.id]).filter(el => {
62+
return el[0] !== undefined
63+
})
64+
return sortedHTML
65+
}
66+
let activeElement = breadthFirstSearch(this.componentMap[this.activeComponent].htmlList, this.activeLayer.id)
67+
let sortedHTML = activeElement.children.map((el, index) => [el.text, index, el.id]).filter(el => {
68+
return el[0] !== undefined
69+
})
70+
return sortedHTML
71+
},
72+
set (value) {
73+
this.$store.dispatch(setSelectedElementList, value)
74+
}
75+
},
76+
depth: function () {
77+
let newTitle = ''
78+
this.activeLayer.lineage.forEach(el => {
79+
newTitle += ` > ${el}`
80+
})
81+
return newTitle
82+
}
83+
84+
},
85+
methods: {
86+
...mapActions(['setActiveHTML', 'setActiveLayer', 'upOneLayer']),
87+
deleteElement (id) {
88+
if (this.activeComponent === '') this.$store.dispatch(deleteSelectedElement, id[0])
89+
else this.$store.dispatch(deleteFromComponentHtmlList, id[1])
90+
},
91+
setActiveElement (element) {
92+
if (this.activeComponent !== '' && !this.exceptions.includes(element[0])) {
93+
this.setActiveHTML(element)
94+
}
95+
},
96+
setLayer (element) {
97+
this.setActiveLayer(element)
98+
},
99+
setParentLayer () {
100+
if (this.activeLayer.id !== '') {
101+
this.upOneLayer(this.activeLayer.id)
102+
}
103+
}
104+
},
105+
watch: {
106+
activeComponent: function () {
107+
if (this.activeComponent !== '') {
108+
this.component = true
109+
} else {
110+
this.component = false
111+
}
112+
}
113+
}
114+
}
115+
</script>
116+
117+
<style lang='scss' scoped>
118+
.html-queue {
119+
padding-bottom: 40px;
120+
}
121+
122+
li {
123+
list-style-type: none;
124+
}
125+
126+
.list-group {
127+
padding: 10px 0;
128+
display: flex;
129+
flex-direction: column;
130+
justify-content: center;
131+
}
132+
.list-group-item {
133+
display: inline-block;
134+
margin: 2px 1.5%;
135+
min-width: 175px;
136+
width: 30%;
137+
border-radius: 0.5cm;
138+
border: 2px solid $secondary;
139+
background-color: $secondary;
140+
height: 35px;
141+
padding-top: 6px;
142+
text-align: center;
143+
}
144+
145+
.list-group-item-selected {
146+
display: inline-block;
147+
margin: 2px 1.5%;
148+
min-width: 175px;
149+
width: 30%;
150+
border-radius: 0.5cm;
151+
border: 2px solid white;
152+
background-color: $secondary;
153+
height: 35px;
154+
padding-top: 6px;
155+
text-align: center;
156+
}
157+
158+
.fa-trash:hover {
159+
cursor: pointer;
160+
color: #155158;
161+
}
162+
163+
.fa-trash {
164+
position: relative;
165+
top: 2px;
166+
right: 35px;
167+
float: right;
168+
}
169+
.fa-angle-double-down {
170+
position: relative;
171+
top: 2px;
172+
left: 35px;
173+
float: left;
174+
}
175+
176+
.fa-angle-double-down:hover {
177+
cursor: pointer;
178+
color: #41B883;
179+
}
180+
181+
.fa-chevron-up {
182+
position: relative;
183+
}
184+
185+
.fa-chevron-up:hover {
186+
cursor: pointer;
187+
color: #41B883;
188+
}
189+
190+
#unavailable {
191+
color: #686868;
192+
cursor: default
193+
}
194+
195+
hr {
196+
border: 1px solid grey
197+
}
198+
</style>

0 commit comments

Comments
 (0)