Skip to content

Commit c2fba64

Browse files
committed
committing edit component name action
1 parent 2befc1f commit c2fba64

File tree

4 files changed

+30
-13
lines changed

4 files changed

+30
-13
lines changed

src/components/HomeSideDropDownItems/ComponentList.vue

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ Description:
77
<template>
88
<div class="home-sidebar">
99
<q-input
10-
@keyup.enter.native="editComponentName(newName)"
10+
@keyup.enter.native="editCompName(newName)"
1111
standout="bg-secondary text-white"
1212
bottom-slots
13+
v-on:keyup.delete.stop
1314
v-model="newName"
1415
label="Edit name"
1516
dense
1617
class="input-add"
17-
>
18-
<template v-slot:append>
18+
/>
19+
<!-- <template v-slot:append>
1920
<q-btn
2021
round
2122
dense
2223
flat
23-
icon="add"
24-
@click="createNewAction(textAction)"
24+
icon="fas fa-edit"
25+
@click="editCompName(newName)"
2526
/>
27+
</template> -->
2628
<multiselect
2729
class='multiselect'
2830
v-model="value"
@@ -82,6 +84,10 @@ export default {
8284
// this.setActiveComponent(componentData.componentName)
8385
// this.activeComponentData.isActive = true
8486
// },
87+
//
88+
// deleteCircumvent (e) {
89+
// e.preventDefault()
90+
// },
8591
// Deletes the selected component
8692
deleteSelectedComp (componentData) {
8793
if (componentData) {
@@ -101,15 +107,12 @@ export default {
101107
this.setActiveComponent('')
102108
}
103109
}
110+
},
111+
watch: {
112+
activeComponentObj: function () {
113+
this.newName = this.activeComponentObj.componentName
114+
}
104115
}
105-
// watch: {
106-
// activeComponent: function () {
107-
// // console.log('watching activeComponent in Footer');
108-
// if (this.activeComponent === '' && this.selectedElementList.length !== 0) {
109-
// this.tab = 'html'
110-
// }
111-
// }
112-
// }
113116
}
114117
</script>
115118

src/store/actions.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ const actions = {
155155
},
156156
// End of Vuex Actions section //////////////////////////////////////////
157157

158+
// Action primarily for edit functionality////////////////////////////////////////
159+
[types.editComponentName]: ({ commit }, payload) => {
160+
commit(types.EDIT_COMPONENT_NAME, payload)
161+
},
162+
158163
// Actions dispatched from left hand panel////////////////////////////////////////
159164

160165
[types.addToComponentElementList]: ({ commit }, payload) => {

src/store/mutations.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ const mutations = {
166166
state.activeComponentObj = null
167167
state.activeComponentObj = active
168168
},
169+
170+
// *** EDIT FUNCTIONALITY *** //////////////////////////////////////////////
171+
172+
[types.EDIT_COMPONENT_NAME]: (state, payload) => {
173+
174+
},
175+
169176
// *** HTML ELEMENTS *** //////////////////////////////////////////////
170177

171178
[types.ADD_NESTED_HTML]: (state, payload) => {

src/store/types.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const DELETE_FROM_QUEUE = 'DELETE_FROM_QUEUE'
2828
export const DELETE_PROJECT_TAB = 'DELETE_PROJECT_TAB'
2929
export const DELETE_ROUTE = 'DELETE_ROUTE'
3030
export const DELETE_SELECTED_ELEMENT = 'DELETE_SELECTED_ELEMENT'
31+
export const EDIT_COMPONENT_NAME = 'EDIT_COMPONENT_NAME'
3132
export const EMPTY_STATE = 'EMPTY_STATE'
3233
export const IMPORT_IMAGE = 'IMPORT_IMAGE'
3334
export const INCREMENT_PROJECT_ID = 'INCREMENT_PROJECT_ID'
@@ -79,6 +80,7 @@ export const deleteFromComponentHtmlList = 'deleteFromComponentHtmlList'
7980
export const deleteFromQueue = 'deleteFromQueue'
8081
export const deleteProjectTab = 'deleteProjectTab'
8182
export const deleteSelectedElement = 'deleteSelectedElement'
83+
export const editComponentName = 'editComponentName'
8284
export const importImage = 'importImage'
8385
export const incrementProjectId = 'incrementProjectId'
8486
export const openProject = 'openProject'

0 commit comments

Comments
 (0)