Skip to content

Commit 538936b

Browse files
committed
after merge
2 parents e6845c3 + d9bbf8f commit 538936b

File tree

6 files changed

+44
-20
lines changed

6 files changed

+44
-20
lines changed

src/components/home_sidebar_items/ComponentTab/ComponentTab.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Functionality includes: if active component is selected, will switch view to editing mode. If not, it will be in create mode -->
33
<template>
44
<q-card id="store-cards">
5+
<!-- <UploadImage v-if="activeComponent === ''" /> -->
56
<CreateComponent v-if="activeComponent === ''"/>
67
<EditDeleteComponents v-if="activeComponent !== ''"/>
78
</q-card>
@@ -11,6 +12,7 @@ Functionality includes: if active component is selected, will switch view to edi
1112
import CreateComponent from './CreateComponent.vue'
1213
import EditDeleteComponents from './EditDeleteComponents.vue'
1314
import { mapState } from 'vuex'
15+
// import UploadImage from '../UploadImage.vue'
1416
1517
export default {
1618
data () {
@@ -27,6 +29,7 @@ export default {
2729
components: {
2830
CreateComponent,
2931
EditDeleteComponents,
32+
// UploadImage,
3033
}
3134
}
3235
</script>

src/components/home_sidebar_items/ComponentTab/CreateComponent.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Description:
1212
>
1313
<!-- will render if creating new component -->
1414
<q-input
15-
v-if="activeComponent === ''"
1615
standout="bg-secondary text-white"
1716
bottom-slots
1817
v-on:keyup.delete.stop
@@ -32,11 +31,10 @@ Description:
3231
@activeLayer="addNestedNoActive"
3332
/>
3433
</div>
35-
<ParentMultiselect v-if="activeComponent === ''"></ParentMultiselect>
34+
<ParentMultiselect></ParentMultiselect>
3635
<br />
3736

3837
<q-btn
39-
v-if="activeComponent ===''"
4038
id="add-component-btn"
4139
color="secondary"
4240
label="Create Component"

src/components/home_sidebar_items/ComponentTab/EditDeleteComponents.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export default {
347347
'deleteActiveComponent',
348348
'editComponentName',
349349
// 'deleteActionFromComponent',
350-
// 'deletePropsFromComponent',
350+
'deletePropsFromComponent',
351351
// 'deleteStateFromComponent',
352352
'updateComponentLayer',
353353
'updateActiveComponentChildrenValue',
@@ -375,10 +375,10 @@ export default {
375375
// },
376376
377377
// delete selected props from active component
378-
// deleteProp (prop) {
379-
// this.deletePropsFromComponent(prop)
380-
// console.log(this.activeComponentObj)
381-
// },
378+
deleteProp (prop) {
379+
this.deletePropsFromComponent(prop)
380+
console.log(this.activeComponentObj)
381+
},
382382
// Set component as active component from left side dropdown
383383
onActivated (componentData) {
384384
this.setActiveComponent(componentData.componentName)

src/components/home_sidebar_items/StoreTab/StoreTab.vue

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ Functionality:
3535
</template>
3636
</q-input>
3737
<p v-if='!this.stateOptions.length'>No state in store</p>
38-
<ul id="stateList">
38+
<!-- <ul v-else id="stateList">
3939
<li v-for="state in stateOptions" v-bind:key="state">
4040
{{ state }}
4141
</li>
42-
</ul>
43-
<!-- <a
42+
</ul> -->
43+
<a
4444
v-else
4545
v-for="state in stateOptions"
4646
:key="state"
@@ -52,12 +52,12 @@ Functionality:
5252
<div class="component-info">
5353
{{ state }}
5454
</div>
55-
<q-btn round flat icon="highlight_off" v-on:click.stop="deleteUserState(state)" />
55+
<q-btn round flat icon="highlight_off" v-on:click.stop="deleteState(state)" />
5656
</div>
5757
</q-item-section>
5858
</q-item>
5959
</q-list>
60-
</a> -->
60+
</a>
6161
</q-tab-panel>
6262
<!-- store actions tab -->
6363
<q-tab-panel name="actions">
@@ -83,12 +83,12 @@ Functionality:
8383
</template>
8484
</q-input>
8585
<p v-if='!this.actionOptions.length'>No actions in store</p>
86-
<ul id="actionList">
86+
<!-- <ul id="actionList">
8787
<li v-for="action in actionOptions" :key="action">
8888
{{ action }}
8989
</li>
90-
</ul>
91-
<!-- <a
90+
</ul> -->
91+
<a
9292
v-else
9393
v-for="action in actionOptions"
9494
:key="action"
@@ -100,12 +100,12 @@ Functionality:
100100
<div class="component-info">
101101
{{ action }}
102102
</div>
103-
<q-btn round flat icon="highlight_off" v-on:click.stop="deleteUserActions(action)" />
103+
<q-btn round flat icon="highlight_off" v-on:click.stop="deleteAction(action)" />
104104
</div>
105105
</q-item-section>
106106
</q-item>
107107
</q-list>
108-
</a> -->
108+
</a>
109109
</q-tab-panel>
110110
</q-tab-panels>
111111
</q-card>
@@ -140,6 +140,8 @@ export default {
140140
...mapActions([
141141
'createAction',
142142
'createState',
143+
'deleteUserActions',
144+
'deleteUserState',
143145
]),
144146
// Creates a new action in userActions in the store
145147
createNewAction (text) {
@@ -156,8 +158,15 @@ export default {
156158
}
157159
},
158160
// Delete a selected action in the store
161+
deleteAction (action) {
162+
//if delete request comes in, send to actions
163+
this.deleteUserActions(action);
164+
},
159165
// Delete a selected state in the store
160-
166+
deleteState (state) {
167+
console.log('state: ', state);
168+
this.deleteUserState(state);
169+
}
161170
}
162171
}
163172
</script>

src/store/actions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,16 @@ const actions = {
166166
[types.deleteUserActions]: ({ state, commit }, payload) => {
167167
commit(types.DELETE_USER_ACTIONS, payload)
168168
},
169+
169170
[types.deleteUserState]: ({ state, commit }, payload) => {
170-
171171
// loops through component map and deletes all props
172172
// Object.keys(state.componentMap).forEach(prop => {
173173
// commit(types.SET_ACTIVE_COMPONENT, prop.componentName)
174174
// commit(types.REMOVE_ACTION_FROM_COMPONENT, payload)
175175
// })
176176
commit(types.DELETE_USER_STATE, payload)
177177
},
178+
178179
// End of Vuex Actions section //////////////////////////////////////////
179180

180181
// Action primarily for edit functionality////////////////////////////////////////

src/store/mutations.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,19 @@ const mutations = {
219219
state.activeComponentObj = temp
220220
},
221221

222+
[types.DELETE_USER_STATE]: (state, payload) => {
223+
// delete state.userState[payload];
224+
// console.log('userState: ', state.userState);
225+
let index = state.userState.indexOf(payload);
226+
state.userState.splice(index, 1);
227+
},
228+
229+
[types.DELETE_USER_ACTIONS]: (state, payload) => {
230+
// payload should be a string of the name of the action to remove
231+
let index = state.userActions.indexOf(payload);
232+
state.userActions.splice(index, 1);
233+
},
234+
222235
// *** EDIT FUNCTIONALITY *** //////////////////////////////////////////////
223236

224237
[types.EDIT_COMPONENT_NAME]: (state, payload) => {

0 commit comments

Comments
 (0)