Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 902e6e81 authored by VIAUD Nathan's avatar VIAUD Nathan
Browse files

improvement: display chapter title on top of the chapter node

parent 324f561e
No related branches found
No related tags found
1 merge request!128Resolve "Display chapter title in the chapter node"
Pipeline #963943 passed
...@@ -127,60 +127,4 @@ const activityIndex = computed(() => { ...@@ -127,60 +127,4 @@ const activityIndex = computed(() => {
.vue-flow__node.selected .node { .vue-flow__node.selected .node {
border: 2px dashed var(--editor-blue); border: 2px dashed var(--editor-blue);
} }
.node.hover:has(.ghost) {
&.node-list {
padding: 1.5rem;
}
}
.container.hover {
.node {
transition: all 0.2s ease-in-out;
background-color: var(--node-hover);
box-shadow: 0 2px 5px 0 var(--shadow-outer);
}
}
.vue-flow__handle {
width: 12px;
height: 12px;
top: calc(30px + 1rem + 1px);
&-left {
left: -6px;
}
&-right {
right: -6px;
}
}
.not-connected {
background-color: var(--editor-red);
}
.container {
position: relative;
&:hover {
.node-title {
overflow-x: visible;
}
}
}
.node-title {
height: 1.5rem;
margin: 0;
padding: 0.2rem;
top: -1.75rem;
max-width: calc(60px + 1.8rem);
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
&.active {
color: var(--editor-blue);
}
}
</style> </style>
...@@ -61,33 +61,42 @@ const connectedBadges = computed(() => getConnectedBadges(currentNode.data.conte ...@@ -61,33 +61,42 @@ const connectedBadges = computed(() => getConnectedBadges(currentNode.data.conte
</script> </script>
<template> <template>
<div class="node-chapter"> <div>
<div v-if="connectedBadges.length > 0" class="badge-notification badge-notification-left"> <div class="node-chapter">
<img src="/img/badge/notification.svg" alt="notification" /> <div v-if="connectedBadges.length > 0" class="badge-notification badge-notification-left">
<small>{{ connectedBadges.length }}</small> <img src="/img/badge/notification.svg" alt="notification" />
<small>{{ connectedBadges.length }}</small>
</div>
<p
class="node-title"
:class="{ active: editorStore.openedElementId ? editorStore.openedElementId === props.id : false }"
>
{{ currentNode.data.formValues.title }}
</p>
<ContentButton
:id="currentNode.data.contentId"
:data-testid="`chapter-${currentNode.data.index}`"
:icon="currentNode.data.action.icon"
:is-draggable="false"
:class-list="classList"
:is-active="editorStore.openedElementId ? editorStore.openedElementId === currentNode.id : false"
:subtitle="subtitle"
@click="openForm()"
@mousedown="mouseDown"
@contextmenu="onContextMenu"
/>
</div> </div>
<ContentButton <!-- ! mousedown.stop important in vue-flow v1.16.4 on non draggable node -->
:id="currentNode.data.contentId" <Handle
:data-testid="`chapter-${currentNode.data.index}`" :data-testid="`source-chapter-${currentNode.data.index}`"
:icon="currentNode.data.action.icon" type="source"
:is-draggable="false" :position="Position.Right"
:class-list="classList" :connectable="!isSource && !editorStore.selectNodeMode"
:is-active="editorStore.openedElementId ? editorStore.openedElementId === currentNode.id : false" :class="{ 'not-connected': !isSource }"
:subtitle="subtitle" @mousedown.stop
@click="openForm()"
@mousedown="mouseDown"
@contextmenu="onContextMenu"
/> />
</div> </div>
<!-- ! mousedown.stop important in vue-flow v1.16.4 on non draggable node -->
<Handle
:data-testid="`source-chapter-${currentNode.data.index}`"
type="source"
:position="Position.Right"
:connectable="!isSource && !editorStore.selectNodeMode"
:class="{ 'not-connected': !isSource }"
@mousedown.stop
/>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -129,70 +129,4 @@ const pageIndex = computed(() => { ...@@ -129,70 +129,4 @@ const pageIndex = computed(() => {
:connectable="connectable && !editorStore.selectNodeMode" :connectable="connectable && !editorStore.selectNodeMode"
/> />
</div> </div>
</template> </template>
\ No newline at end of file
<style scoped lang="scss">
.node.hover:has(.ghost) {
&.node-list {
padding: 1.5rem;
}
}
.container.hover {
.node {
transition: all 0.2s ease-in-out;
box-shadow: 0 2px 5px 0 var(--shadow-outer);
&:not(.active) {
background-color: var(--node-hover);
}
&.active {
// #E1F4FA == node-active
background-color: darken(#e1f4fa, 5%);
}
}
}
.vue-flow__handle {
width: 12px;
height: 12px;
top: calc(30px + 1rem + 1px);
z-index: 20;
&-left {
left: -6px;
}
&-right {
right: -6px;
}
}
.not-connected {
background-color: var(--editor-red);
}
.container {
position: relative;
&:hover {
.node-title {
overflow-x: visible;
}
}
}
.node-title {
height: 1.5rem;
margin: 0;
padding: 0.2rem;
top: -1.75rem;
max-width: calc(60px + 1.8rem);
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
&.active {
color: var(--editor-blue);
}
}
</style>
.node.hover:has(.ghost) {
&.node-list {
padding: 1.5rem;
}
}
.container.hover {
.node {
transition: all 0.2s ease-in-out;
background-color: var(--node-hover);
box-shadow: 0 2px 5px 0 var(--shadow-outer);
}
}
.vue-flow__handle {
width: 12px;
height: 12px;
top: calc(30px + 1rem + 1px);
&-left {
left: -6px;
}
&-right {
right: -6px;
}
}
.not-connected {
background-color: var(--editor-red);
}
.container {
position: relative;
}
.node-title {
height: 1.5rem;
margin: 0;
padding: 0 0.2rem;
top: -1.75rem;
max-width: calc(60px + 1.8rem);
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
border-radius: 4px;
&.active {
color: var(--editor-blue);
}
&:hover {
overflow: visible;
}
}
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
@import '_icon'; @import '_icon';
@import '_tinymce'; @import '_tinymce';
@import 'src/features/ePocFlow/nodes/_nodes';
html, html,
body, body,
#app { #app {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment