Skip to content

Commit 179802c

Browse files
committed
committing changes
1 parent 2c62f2c commit 179802c

File tree

6 files changed

+124
-132
lines changed

6 files changed

+124
-132
lines changed

src/components/CodeSnippet.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export default {
142142
children.forEach(name => {
143143
childrenComponentNames += ` ${name},\n`
144144
})
145+
// eslint-disable-next-line no-useless-escape
145146
return `\n\n<script>\n${str}\nexport default {\n name: '${componentName}',\n components: {\n${childrenComponentNames} }\n};\n<\/script>\n\n<style scoped>\n</style>`
146147
}
147148
},

src/components/ComponentDetails.vue

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<q-tab name="props" label="Component Props" id="label-text" />
1515
</q-tabs>
1616
<q-tab-panels v-model="tab" animated class="html-bg text-white">
17-
<q-tab-panel name="state" v-model="compoent">
17+
<q-tab-panel name="state">
1818
<ul id="stateList">
1919
<li v-for="comp in activeState" :key="comp">
2020
{{ comp }}
@@ -42,34 +42,34 @@
4242
</template>
4343

4444
<script>
45-
import { mapState } from "vuex";
45+
import { mapState } from 'vuex'
4646
4747
export default {
48-
name: "ComponentDetails",
48+
name: 'ComponentDetails',
4949
computed: {
50-
...mapState(["activeComponentObj"]),
50+
...mapState(['activeComponentObj']),
5151
// component: {
5252
// get(){
5353
// return this.activeComponentObj
5454
// }
5555
// },
5656
activeState: {
57-
get(){
58-
if (this.activeComponentObj) return this.activeComponentObj.state;
59-
return []
60-
}
57+
get () {
58+
if (this.activeComponentObj) return this.activeComponentObj.state
59+
return []
60+
}
6161
},
6262
activeProps: {
63-
get(){
64-
if (this.activeComponentObj) return this.activeComponentObj.props;
65-
return []
66-
}
63+
get () {
64+
if (this.activeComponentObj) return this.activeComponentObj.props
65+
return []
66+
}
6767
},
6868
activeActions: {
69-
get(){
70-
if (this.activeComponentObj) return this.activeComponentObj.actions;
71-
return []
72-
}
69+
get () {
70+
if (this.activeComponentObj) return this.activeComponentObj.actions
71+
return []
72+
}
7373
}
7474
// componentActions: {
7575
// get() {
@@ -87,12 +87,12 @@ export default {
8787
// },
8888
// },
8989
},
90-
data() {
90+
data () {
9191
return {
92-
tab: "state",
93-
};
94-
},
95-
};
92+
tab: 'state'
93+
}
94+
}
95+
}
9696
</script>
9797

9898
<style lang="stylus" scoped>
@@ -156,12 +156,3 @@ i
156156
// give html background color of grey
157157
background-color #202122
158158
</style>
159-
160-
161-
let active = (state.routes[state.activeRoute].filter(comp => {
162-
return comp.componentName === state.activeComponent
163-
})[0])
164-
165-
active.props
166-
active.state
167-
active.actions

src/components/DashboardVuexStore.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,25 @@
3333
</template>
3434

3535
<script>
36-
import { mapState } from "vuex";
36+
import { mapState } from 'vuex'
3737
3838
export default {
39-
name: "VuexStore",
39+
name: 'VuexStore',
4040
computed: {
41-
...mapState(["userActions", "userState"]),
42-
actionOptions() {
43-
return this.userActions;
44-
},
45-
stateOptions() {
46-
return this.userState;
41+
...mapState(['userActions', 'userState']),
42+
actionOptions () {
43+
return this.userActions
4744
},
45+
stateOptions () {
46+
return this.userState
47+
}
4848
},
49-
data() {
49+
data () {
5050
return {
51-
tab: "state",
52-
};
53-
},
54-
};
51+
tab: 'state'
52+
}
53+
}
54+
}
5555
</script>
5656

5757
<style lang="stylus" scoped>

src/components/HomeSideDropDownItems/VuexForm.vue

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -136,133 +136,133 @@ Description:
136136
</template>
137137
<!-- :disabled="!componentNameInputValue.trim()" -->
138138
<script>
139-
import { mapState, mapActions } from "vuex";
140-
import Multiselect from "vue-multiselect";
139+
import { mapState, mapActions } from 'vuex'
140+
import Multiselect from 'vue-multiselect'
141141
142142
export default {
143-
name: "VuexForm",
143+
name: 'VuexForm',
144144
components: {
145-
Multiselect,
145+
Multiselect
146146
},
147-
data() {
147+
data () {
148148
return {
149-
textAction: "",
150-
textState: "",
151-
textProps: ""
152-
};
149+
textAction: '',
150+
textState: '',
151+
textProps: ''
152+
}
153153
},
154154
computed: {
155155
...mapState([
156-
"routes",
157-
"componentMap",
158-
"activeComponent",
159-
"activeRoute",
160-
"selectedActions",
161-
"selectedState",
162-
"selectedProps",
163-
"userActions",
164-
"userState",
165-
"userProps"
156+
'routes',
157+
'componentMap',
158+
'activeComponent',
159+
'activeRoute',
160+
'selectedActions',
161+
'selectedState',
162+
'selectedProps',
163+
'userActions',
164+
'userState',
165+
'userProps'
166166
]),
167-
actionOptions() {
168-
return this.userActions;
167+
actionOptions () {
168+
return this.userActions
169169
},
170-
propsOptions() {
171-
return this.userProps;
170+
propsOptions () {
171+
return this.userProps
172172
},
173-
stateOptions() {
174-
return this.userState;
173+
stateOptions () {
174+
return this.userState
175175
},
176176
selectAction: {
177-
get() {
178-
return this.$store.state.selectedActions;
179-
},
180-
set(value) {
181-
this.addActionSelected(value);
177+
get () {
178+
return this.$store.state.selectedActions
182179
},
180+
set (value) {
181+
this.addActionSelected(value)
182+
}
183183
},
184184
selectState: {
185-
get() {
186-
return this.$store.state.selectedState;
187-
},
188-
set(value) {
189-
this.addStateSelected(value);
185+
get () {
186+
return this.$store.state.selectedState
190187
},
188+
set (value) {
189+
this.addStateSelected(value)
190+
}
191191
},
192192
selectProps: {
193-
get() {
194-
return this.$store.state.selectedProps;
193+
get () {
194+
return this.$store.state.selectedProps
195195
},
196-
set(value) {
197-
this.addPropsSelected(value);
198-
},
199-
},
200-
196+
set (value) {
197+
this.addPropsSelected(value)
198+
}
199+
}
200+
201201
},
202202
methods: {
203203
...mapActions([
204-
"setActiveComponent",
205-
"createAction",
206-
"createState",
207-
"createProp",
208-
"addActionSelected",
209-
"addStateSelected",
210-
"addPropsSelected",
211-
"addActionToComponent",
212-
"addStateToComponent",
213-
"addPropsToComponent"
204+
'setActiveComponent',
205+
'createAction',
206+
'createState',
207+
'createProp',
208+
'addActionSelected',
209+
'addStateSelected',
210+
'addPropsSelected',
211+
'addActionToComponent',
212+
'addStateToComponent',
213+
'addPropsToComponent'
214214
]),
215-
createNewAction(text) {
215+
createNewAction (text) {
216216
if (!this.$store.state.userActions.includes(text)) {
217-
this.createAction(text);
218-
this.textAction = "";
217+
this.createAction(text)
218+
this.textAction = ''
219219
}
220220
},
221-
addActionToComp() {
222-
this.addActionToComponent(this.selectedActions);
221+
addActionToComp () {
222+
this.addActionToComponent(this.selectedActions)
223223
console.log(
224-
"activeComponent",
224+
'activeComponent',
225225
this.routes[this.activeRoute].filter((comp) => {
226-
return comp.componentName === this.activeComponent;
226+
return comp.componentName === this.activeComponent
227227
})[0]
228-
);
228+
)
229229
},
230230
createNewProp (text) {
231231
if (!this.$store.state.userProps.includes(text)) {
232-
this.createProp(text);
233-
this.textProps = "";
232+
this.createProp(text)
233+
this.textProps = ''
234234
}
235235
},
236-
addPropsToComp() {
237-
this.addPropsToComponent(this.selectedProps);
236+
addPropsToComp () {
237+
this.addPropsToComponent(this.selectedProps)
238238
},
239-
createNewState(text) {
239+
createNewState (text) {
240240
if (!this.$store.state.userState.includes(text)) {
241-
this.createState(text);
242-
this.textState = "";
241+
this.createState(text)
242+
this.textState = ''
243243
}
244244
},
245-
addStateToComp() {
246-
this.addStateToComponent(this.selectedState);
245+
addStateToComp () {
246+
this.addStateToComponent(this.selectedState)
247247
},
248248
249249
// when multiselect is opened activeComponent is deselected to allow for parentSelected action
250-
resetActiveComponent() {
251-
if (this.activeComponent !== "") {
252-
this.setActiveComponent("");
250+
resetActiveComponent () {
251+
if (this.activeComponent !== '') {
252+
this.setActiveComponent('')
253253
}
254-
},
254+
}
255255
},
256256
// clears out value in mutiselect on creation of component
257257
watch: {
258258
componentMap: {
259-
handler() {
259+
handler () {
260260
// console.log('componentMap has changed')
261-
this.value = "";
262-
},
263-
},
264-
},
265-
};
261+
this.value = ''
262+
}
263+
}
264+
}
265+
}
266266
</script>
267267

268268
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>

src/store/mutations.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,19 +144,19 @@ const mutations = {
144144
},
145145

146146
[types.ADD_STATE_TO_COMPONENT]: (state, payload) => {
147-
let active = (state.routes[state.activeRoute].filter(comp => {
148-
return comp.componentName === state.activeComponent
149-
})[0])
147+
// let active = (state.routes[state.activeRoute].filter(comp => {
148+
// return comp.componentName === state.activeComponent
149+
// })[0])
150150

151-
if (!active.state) {
152-
active.state = payload
151+
if (!state.activeComponentObj.state) {
152+
state.activeComponentObj.state = payload
153153
} else {
154154
for (let s of payload) {
155-
if (!active.state.includes(s)) { active.state.push(s) }
155+
if (!state.activeComponentObj.state.includes(s)) { state.activeComponentObj.state.push(s) }
156156
}
157157
}
158158
state.selectedState = []
159-
state.activeComponentObj = active
159+
// state.activeComponentObj
160160
},
161161
// *** HTML ELEMENTS *** //////////////////////////////////////////////
162162

@@ -374,8 +374,8 @@ const mutations = {
374374
[types.SET_ACTIVE_COMPONENT]: (state, payload) => {
375375
state.activeComponent = payload
376376
state.activeComponentObj = state.routes[state.activeRoute].filter((comp) => {
377-
return comp.componentName === state.activeComponent;
378-
})[0];
377+
return comp.componentName === state.activeComponent
378+
})[0]
379379
state.activeHTML = ''
380380
state.activeLayer = {
381381
id: '',

src/store/state/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const newState = {
3434
activeRoute: 'HomeView',
3535
// need to change to activeComponentName
3636
activeComponent: '',
37-
activeComponentObj: undefined,
37+
activeComponentObj: null,
3838
activeHTML: '',
3939
activeLayer: {
4040
id: '',

0 commit comments

Comments
 (0)