-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Enhance IMS Content Package Import UI
- Loading branch information
Manav Aggarwal
authored and
Manav Aggarwal
committed
Aug 22, 2023
1 parent
ba1e0d4
commit 90102de
Showing
6 changed files
with
641 additions
and
557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
contentcuration/contentcuration/frontend/channelEdit/components/edit/EditListItems.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<template> | ||
|
||
<VList two-line class="pl-3"> | ||
<EditListItem | ||
:key="nodeId" | ||
v-model="selected" | ||
:nodeId="nodeId" | ||
@input="trackSelect" | ||
@removed="handleRemoved" | ||
/> | ||
<div v-if="getChildren !== undefined"> | ||
<EditListItems | ||
v-for="childId in getChildren" | ||
:key="childId" | ||
v-model="selected" | ||
:nodeId="childId" | ||
:nodes="nodes" | ||
:nodeIds="nodeIds" | ||
@input="trackSelect" | ||
@removed="handleRemoved" | ||
/> | ||
</div> | ||
</VList> | ||
|
||
</template> | ||
|
||
<script> | ||
import EditListItem from './EditListItem'; | ||
export default { | ||
name: 'EditListItems', | ||
components: { | ||
EditListItem, | ||
}, | ||
props: { | ||
value: { | ||
type: Array, | ||
default: () => [], | ||
}, | ||
nodeIds: { | ||
type: Array, | ||
default: () => [], | ||
}, | ||
nodeId: { | ||
type: String, | ||
require: true, | ||
default: null, | ||
}, | ||
nodes: { | ||
type: Object, | ||
default: () => {}, | ||
}, | ||
}, | ||
computed: { | ||
selected: { | ||
get() { | ||
return this.value; | ||
}, | ||
set(items) { | ||
this.$emit('input', items); | ||
}, | ||
}, | ||
getChildren() { | ||
const childrens = []; | ||
Object.keys(this.nodes).forEach(nodeId => { | ||
if (this.nodes[nodeId] === this.nodeId) { | ||
childrens.push(nodeId); | ||
} | ||
}); | ||
return childrens; | ||
}, | ||
}, | ||
methods: { | ||
handleRemoved(nodeId) { | ||
this.$emit('removed', nodeId); | ||
}, | ||
trackSelect(value) { | ||
this.$emit('input', value); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.v-divider { | ||
margin-top: 0; | ||
} | ||
</style> |
Oops, something went wrong.