diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug index 9cf8fdefcb61e77fa859f85585a6dc0cd23aa5dd..c48d825899300990073914348935480868ca9f0b 100644 --- a/src/includes/entrepreneur/resources/detail.pug +++ b/src/includes/entrepreneur/resources/detail.pug @@ -120,6 +120,9 @@ sib-conversation( bind-resources nested-field="conversations" + comment-input-label-text="Add a comment" + send-button-text="Send" + comment-input-placeholder-text="Your message here" ) h2.title_form.related=`${data.RelatedResources}` diff --git a/src/includes/mentor/resources/detail.pug b/src/includes/mentor/resources/detail.pug index 4fb9a3b7114ffbf49501f3703c873104c86014ea..fe6187b6a76175dd7481613f315eb4e1835316f8 100644 --- a/src/includes/mentor/resources/detail.pug +++ b/src/includes/mentor/resources/detail.pug @@ -111,6 +111,9 @@ sib-display( sib-conversation( bind-resources nested-field="conversations" + comment-input-label-text="Add a comment" + send-button-text="Send" + comment-input-placeholder-text="Your message here" ) diff --git a/src/includes/public/resources/detail.pug b/src/includes/public/resources/detail.pug index 749eb21625b5fb0c3428a84571120b30f18937da..412b82142f904c1f05f4c046102c6b08120b389f 100644 --- a/src/includes/public/resources/detail.pug +++ b/src/includes/public/resources/detail.pug @@ -122,6 +122,8 @@ sib-conversation( bind-resources nested-field="conversations" + comment-input-label-text="Add a comment" + send-button-text="Send" ) h2.title_form.related=`${data.RelatedResources}` diff --git a/src/includes/public/resources/list.pug b/src/includes/public/resources/list.pug index 702c97f7ba585e14f1006d0a78a8dd28dc2a79d9..2361decd3dbf3b59af371876ed46d8b7bc93a8f7 100644 --- a/src/includes/public/resources/list.pug +++ b/src/includes/public/resources/list.pug @@ -106,8 +106,8 @@ container.block_list.flex.flex_espace sib-display.resource_by_step( data-src=`${endpoints.step1}`, - fields='name, resource_author, format.name, publication_year, description, country, language, fields', - search-fields='search_for_a_resource(name), more_criterias_hidden(format, publication_year, country, language, fields, type)', + fields='name, resource_author, format.name, publication_year, description, country, languages, fields, type', + search-fields='search_for_a_resource(name), more_criterias_hidden(format, publication_year, country, languages, fields, type)', search-range-format=`${endpoints.formats}` search-range-languages=`${endpoints.languages}` search-range-fields=`${endpoints.fields}` @@ -116,8 +116,6 @@ container.block_list.flex.flex_espace search-widget-more_criterias_hidden="hidden-widget" search-widget-search_for_a_resource="hidden-widget" - search-multiple-type='sib-form-dropdown' - search-widget-type='sib-form-auto-completion' search-multiple-format='sib-form-dropdown' search-widget-format='sib-form-auto-completion' search-multiple-country='sib-form-dropdown' @@ -126,7 +124,7 @@ container.block_list.flex.flex_espace search-widget-languages='sib-form-auto-completion' search-multiple-fields='sib-form-dropdown' search-widget-fields='sib-form-auto-completion' - + search-multiple-type='sib-form-dropdown' widget-name='cs-display-property' widget-country='hidden-widget' @@ -134,11 +132,14 @@ container.block_list.flex.flex_espace widget-description='cs-display-property' widget-fields='hidden-widget' widget-languages="hidden-widget" + widget-type="hidden-widget" widget-resource_author="hidden-widget" widget-format.name='cs-display-resource-property' label-format.name='' label-languages='' multiple-languages + label-type='' + multiple-type label-fields='' multiple-fields class="panel" diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index d018da06a9e089b4aca91673e77795d9fea3e872..155d9c1b7a9f10e577aaf1ddb6408b4c9afd2bfb 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -190,7 +190,6 @@ function selectHiddenManagement(select_hidden, option_selected) { select_hidden.setAttribute("value", option_selected.value); //Actually selecting the option if it is the good one select_hidden.value = option_selected.value; - break; } } @@ -234,12 +233,12 @@ function selectHiddenManagementForType(tab, form) { options_hidden = select_hidden.getElementsByTagName("option"); for (let option_hidden of options_hidden) { option_hidden.removeAttribute("selected"); + // if (option_hidden.value == type_field_search) { if (option_hidden.value == '{"@id": "' + type_field_search + '"}') { //Actually selecting the option if it is the good one option_hidden.setAttribute("selected", "selected"); select_hidden.setAttribute("value", option_hidden.value); select_hidden.value = option_hidden.value; - break; } } @@ -275,7 +274,6 @@ function InitManagementForType() { option_hidden.setAttribute("selected", "selected"); select_hidden.setAttribute("value", option_hidden.value); select_hidden.value = option_hidden.value; - break; } } @@ -635,6 +633,26 @@ function listenToInputChangeOnMentorAccountCompletion(originalForm) { } } +async function refreshDatabase(targetElement) { + let form = document.getElementById(targetElement); + form.addEventListener("save", async function() { + let lists = document.getElementsByClassName('resource_by_step'); + + for (let list of lists) { + if (list) { + list.dataset.src = list.dataset.src; + console.log({list, targetElement}); + let listProxy = await list.component.resource; + // Refresh du cache sur la liste + console.log({listProxy}); + if (listProxy) { + listProxy.clearCache(); + } + } + } + }); +} + /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX ON LOAD XXXXXXXXXXXXXXXXXXXXXXX @@ -741,6 +759,7 @@ document.addEventListener("DOMContentLoaded", event => { refreshList("validation_form", "pending_resources"); refreshList("refusal_dialog_form", "pending_resources"); refreshList("improvement_dialog_form", "pending_resources"); + refreshDatabase("validation_form"); refreshUser("entrepreneur_profile_creation", "entrepreneur_info"); refreshUser("entrepreneur_profile_creation", "entrepreneur_contact"); refreshUser("entrepreneur_profile_creation", "entrepreneur_account_picture"); @@ -878,18 +897,23 @@ document.addEventListener("DOMContentLoaded", event => { // Refresh du cache sur la liste listProxy.clearCache(); let confirm_suppress = document.getElementById("confirm_suppress"); - confirm_suppress.setAttribute("hidden", "hidden"); + confirm_suppress.removeAttribute('open'); //If we supress from the detail resource view, we close this view. let mentor_resource_detail = document.getElementById( "mentor-resource-detail" ); - mentor_resource_detail.setAttribute("hidden", "hidden"); - this.dispatchEvent( - new CustomEvent("requestNavigation", { - bubbles: true, - detail: { route: "mentor-dashboard" } - }) - ); + mentor_resource_detail.removeAttribute('open'); + + let lists = document.getElementsByClassName('resource_by_step'); + for (let list of lists) { + list.dataset.src = list.dataset.src; + + let listProxy = await list.component.resource; + // Refresh du cache sur la liste + if (listProxy) { + listProxy.clearCache(); + } + }; }); }; diff --git a/src/styles/index.scss b/src/styles/index.scss index 99d96422c2bb9d9d67bcbdb3ad63350b90ced5d8..2a1c40000d5b4279826f32f284c0178af2646822 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -233,7 +233,7 @@ input[type="submit"].disabled { } .button_base, input[type="submit"], #mentor-resource-detail a, #entrepreneur-resource-detail a, -#mentor-resource-validate a, .sib-conversation form input[type="submit"], +#mentor-resource-validate a, .sib-conversation form input[type="submit"], .solid-conversation form input[type="submit"], #public-resource-detail a, #mentor-database-resource-detail a{ transition: all .3s ease-in-out; background-color: var(--bg-btn-base); @@ -251,7 +251,7 @@ input[type="submit"].disabled { } .button_base:hover, input[type="submit"]:hover, #mentor-resource-detail a:hover, #mentor-resource-validate a:hover, #entrepreneur-resource-detail a:hover,.sib-conversation form input[type="submit"]:hover, #public-resource-detail a:hover, -#mentor-database-resource-detail a:hover{ +#mentor-database-resource-detail a:hover,.solid-conversation form input[type="submit"]:hover{ background-color: var(--bg-block); color: var(--bg-btn-base); } @@ -1824,12 +1824,14 @@ cs-display-mentor-related, cs-display-entrepreneur-related { } -.sib-conversation div.conversation-form{ +.sib-conversation div.conversation-form, +.solid-conversation div.conversation-form{ border: none; position: relative; } -div.sib-conversation textarea{ +div.sib-conversation textarea, +div.solid-conversation textarea{ border-radius: 0; background: white; height: 4.5rem; @@ -1837,7 +1839,8 @@ div.sib-conversation textarea{ font-size: 1.6rem; } -div.sib-conversation div.conversation-form:before{ +div.sib-conversation div.conversation-form:before, +div.solid-conversation div.conversation-form:before{ content: "\f27a"; font-family: "Font Awesome 5 pro"; font-weight: 900; @@ -1850,7 +1853,8 @@ div.sib-conversation div.conversation-form:before{ color: var(--bg-btn-base); } -.sib-conversation form{ +.sib-conversation form, +.solid-conversation form{ overflow: hidden; input[type="submit"]{ float: right; @@ -1895,15 +1899,18 @@ cs-display-user-link { /*XXXXXXXXXXXXXXXXXX Commentaires XXXXXXXXXXXXXXXXXXXXXXXXXXX*/ -.sib-conversation div>.conversation-item{ +.sib-conversation div>.conversation-item, +.solid-conversation div>.conversation-item{ padding: 1.5rem; } -.sib-conversation [name="conversation-content"]{ +.sib-conversation [name="conversation-content"], +.solid-conversation [name="conversation-content"]{ width: 90%; &>*{ width: 100%; } - sib-set-default[name="conversation-head"]>*{ + sib-set-default[name="conversation-head"]>*, + solid-set-default[name="conversation-head"]>*{ width: 100%; text-align: left; font-size: 1.3rem; @@ -1912,17 +1919,20 @@ cs-display-user-link { margin: 0 0 1rem 0; font-weight: lighter; } - sib-set-default[name="conversation-head"]>*:first-child{ + sib-set-default[name="conversation-head"]>*:first-child, + solid-set-default[name="conversation-head"]>*:first-child{ order: 3; position: relative; left: -4rem; top: .5rem; font-size: 1.6rem; } - sib-set-default[name="conversation-head"]>*:last-child{ + sib-set-default[name="conversation-head"]>*:last-child, + solid-set-default[name="conversation-head"]>*:last-child{ order: 1; } - sib-set-default[name="conversation-author"]{ + sib-set-default[name="conversation-author"], + solid-set-default[name="conversation-author"]{ text-align: left; font-size: 1.3rem; } @@ -2246,6 +2256,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/ .sib-conversation [name="conversation-wrapper"], .sib-conversation [name="message-wrapper"], sib-display[nested-field="conversations"], + .solid-conversation [name="conversation-wrapper"], + .solid-conversation [name="message-wrapper"], + solid-display[nested-field="conversations"] sib-display[nested-field="dislikes"], sib-display[nested-field="likes"]{ display: none!important;