Skip to content

Commit 7db0f54

Browse files
authored
Merge branch 'dev' into megan/htmlQueueLayerNav
2 parents 796ca0f + bb5f714 commit 7db0f54

File tree

4 files changed

+76
-73
lines changed

4 files changed

+76
-73
lines changed

src/components/ComponentDisplay.vue

Lines changed: 69 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -105,70 +105,44 @@
105105
style="width: 250px; background-color: #201221;"
106106
/>
107107
</q-dialog>
108+
108109
<!-- some irregularity (delete event listener firing on bkspc/del) with the modal when stored locally, so modal open stored in state, and triggers to local reflect only stateful change.-->
109110
<q-dialog v-model="noteModal" @update:model-value="this.handleAddNotes">
110111
<div class="noteBox">
111112
<div class="noteHolder">
112113
<p class="title">Adding notes to {{ this.activeComponent }}</p>
113114
<div class="noteContainer">
114-
<li v-for="(note, index) in this.componentMap[this.activeComponent].noteList" :key="note" @click="deleteNote">
115-
Note #{{index}}:
116-
<div class="noteblock">{{ note }}</div>
117-
</li>
118-
</div>
119-
<q-form class="formBox" autofocus>
120-
<q-input
121-
v-model="noteText"
122-
label="Add your note here"
123-
filled
124-
dark
125-
max-height="15%"
126-
autofocus true
127-
></q-input>
128-
<q-btn
129-
color="secondary"
130-
label="Submit Note"
131-
type="submit"
132-
:disable="noteText.length > 0 ? false : true"
133-
@click="submitNote"
134-
/>
135-
</q-form>
136-
</div>
137-
</div>
138-
</q-dialog>
139-
<!-- some irregularity (delete event listener firing on bkspc/del) with the modal when stored locally, so modal open stored in state, and triggers to local reflect only stateful change.-->
140-
<q-dialog v-model="noteModal" @update:model-value="this.handleAddNotes">
141-
<div class="noteBox">
142-
<div class="noteHolder">
143-
<p class="title">Adding notes to {{ this.activeComponent }}</p>
144-
<div class="noteContainer">
145-
<li v-for="(note, index) in this.componentMap[this.activeComponent].noteList" :key="note" @click="deleteNote">
146-
Note #{{index}}:
147-
<div class="noteblock">{{ note }}</div>
115+
<li v-for="(note, index) in this.componentMap[this.activeComponent].noteList" :key="note">
116+
<span class="noteNum">Note {{index}}: </span>
117+
<div class="noteblock">{{ note }}</div><span id="noteDelete" @click="deleteNote">X</span>
148118
</li>
149119
</div>
150-
<q-form class="formBox" autofocus>
120+
<div class="formBox">
121+
<q-form autofocus v-on:submit.prevent="submitNote">
151122
<q-input
152123
v-model="noteText"
153124
label="Add your note here"
154125
filled
155126
dark
156-
autogrow
157-
max-height=15%
158127
autofocus true
128+
hide-bottom-space
129+
:hint="hint"
130+
@keyup.enter="submitNote"
159131
></q-input>
160132
<q-btn
133+
id="comp-btn"
161134
color="secondary"
162135
label="Submit Note"
163136
:disable="noteText.length > 0 ? false : true"
164137
@click="submitNote"
165138
/>
166139
<q-btn
167-
color="secondary"
140+
id="note-btn-close"
168141
label="Exit Notes"
169142
@click="this.openNoteModal"
170143
/>
171144
</q-form>
145+
</div>
172146
</div>
173147
</div>
174148
</q-dialog>
@@ -447,8 +421,7 @@ export default {
447421
this.noteText = '';
448422
},
449423
deleteNote(e){
450-
//currently just deletes the note based on the text alone.
451-
this.deleteActiveComponentNote(e.target.innerText);
424+
this.deleteActiveComponentNote(e.target.previousElementSibling.innerText);
452425
},
453426
// used when user selects to add child from dropdown
454427
handleSelect(value) {
@@ -477,11 +450,15 @@ export default {
477450
},
478451
watch: {
479452
noteModalOpen (){
480-
console.log('display note, prevent delete?', this.noteModalOpen)
481453
this.noteModal = this.noteModalOpen;
482454
},
483455
activeComponent: {
484456
handler(){
457+
if (this.activeComponent !== '' &&
458+
this.$store.state.showTutorial === true &&
459+
this.$store.state.tutorialFirstOpen === true){
460+
this.$store.commit("TOGGLE_TUTORIAL");
461+
}
485462
this.onActivated(this.activeComponentObj);
486463
},
487464
deep: true,
@@ -498,45 +475,70 @@ li{
498475
}
499476
500477
li:hover{
501-
background-color: $negative;
478+
background-color: $subprimary;
502479
}
503480
.noteblock{
504481
white-space: pre-wrap;
505482
font-weight: normal;
506-
width: 85%;
483+
width: 80%;
507484
margin-left: 10px;
508-
align-self: flex-end;
485+
margin-right: 10px;
509486
}
510487
.noteBox{
511488
background-color: $subprimary;
512489
color: $menutext;
513490
width: 65%;
514-
height: 60vh;
515491
padding: 15px;
492+
height: 65vh;
493+
max-height: 80vh;
494+
}
495+
.noteNum{
496+
width: 10%;
497+
}
498+
#noteDelete{
499+
background-color: $secondary;
500+
width: 20px;
501+
height: 20px;
502+
display: flex;
503+
justify-content: center;
504+
align-self: flex-end;
505+
border-radius: 50%;
506+
color: $menutext;
507+
user-select: none;
508+
align-self: center;
509+
}
510+
#noteDelete:hover{
511+
background-color: $negative;
516512
}
517513
.noteHolder{
518514
background-color: $subsecondary;
519515
width: 100%;
520-
height: 100%;
521516
padding: 10px;
522517
display: flex;
523518
flex-direction: column;
524519
flex-wrap: nowrap;
525520
border-radius: 4px;
526521
overflow-y: hidden;
522+
height: 100%;
527523
}
528-
.noteDisplay{
529-
min-height: 30%;
530-
}
524+
531525
.noteContainer{
532-
max-height: 400px;
526+
height: 280px;
527+
max-height: 280px;
533528
border: 1px solid $primary;
534529
border-radius: 4px;
535530
overflow-y: auto;
531+
word-break: break-all;
532+
max-width: 100%;
533+
display:flex;
534+
flex-direction: column;
535+
justify-content: flex-start;
536536
}
537+
537538
.formBox{
538-
max-height: 15%;
539-
justify-self: flex-end;
539+
display: flex;
540+
flex-direction: column;
541+
justify-content: flex-start;
540542
}
541543
542544
.component-title {
@@ -673,4 +675,19 @@ li:hover{
673675
font-weight: bold;
674676
color: white;
675677
}
678+
679+
#comp-btn{
680+
width: 100%;
681+
box-shadow:inset 0 -0.6em 0 -0.35em rgba(0,0,0,0.17);
682+
}
683+
684+
#note-btn-close {
685+
background-color: rgba($negative, .2);
686+
border: 1px solid $negative;
687+
color: $negative;
688+
width: 100%;
689+
margin-top: 10px;
690+
margin-bottom: 10px;
691+
}
692+
676693
</style>

src/components/home_sidebar_items/ComponentTab/CreateComponent.vue

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -214,25 +214,4 @@ export default {
214214
margin-bottom: 10px;
215215
}
216216
217-
// .is-primary {
218-
// height: 45px;
219-
// }
220-
// #add-component-btn {
221-
// height: 15px;
222-
// margin: 0.75rem;
223-
// width: 90%;
224-
// }
225-
// #import-component-btn {
226-
// height: 15px;
227-
// margin: 0 0.75rem;
228-
// width: 90%;
229-
// }
230-
// .inner-div {
231-
// display: flex;
232-
// flex-direction: column;
233-
// justify-content: flex-start;
234-
// padding-left: 15px;
235-
// padding-right: 15px;
236-
// height: 100%;
237-
// }
238217
</style>

src/store/mutations.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const mutations = {
3333
},
3434

3535
[types.TOGGLE_TUTORIAL]: (state) => {
36+
if (state.tutorialFirstOpen === true){
37+
state.tutorialFirstOpen = false;
38+
}
3639
state.showTutorial = !state.showTutorial;
3740
},
3841

@@ -702,6 +705,9 @@ const mutations = {
702705
if (!state.componentMap[state.activeComponent].hasOwnProperty('noteList')){
703706
state.componentMap[state.activeComponent].noteList = [];
704707
}
708+
while(state.componentMap[state.activeComponent].noteList.includes(payload)){
709+
payload = 'DUPLICATE: ' + payload
710+
}
705711
state.componentMap[state.activeComponent].noteList.push(payload)
706712
},
707713

src/store/state/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const newState = {
5959
pastedComponent: {},
6060
exportAsTypescript: 'off',
6161
showTutorial: true,
62+
tutorialFirstOpen: true,
6263
}
6364

6465
// closured method to ensure we only ever write the default state ONCE

0 commit comments

Comments
 (0)