From 8c7ec350f92c4c99cf8bebd1f5f67f522ff6130d Mon Sep 17 00:00:00 2001
From: Benoit Alessandroni <benoit@happy-dev.fr>
Date: Tue, 28 Jan 2020 11:27:57 +0100
Subject: [PATCH] Adding proper target select

---
 src/config.sample.json                         | 2 ++
 src/includes/entrepreneur/resources/detail.pug | 2 +-
 src/includes/mentor/resources/create.pug       | 7 +++++--
 src/includes/mentor/resources/detail.pug       | 2 +-
 src/includes/mentor/resources/edit.pug         | 3 +--
 src/includes/mentor/resources/validate.pug     | 2 +-
 src/includes/public/resources/detail.pug       | 2 +-
 7 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/config.sample.json b/src/config.sample.json
index bd53a21b..6fbcf4ce 100644
--- a/src/config.sample.json
+++ b/src/config.sample.json
@@ -16,6 +16,8 @@
     "step5": "https://api.coopstarter.happy-dev.fr/sources/steps/5/resources/validated/",
     "step6": "https://api.coopstarter.happy-dev.fr/sources/steps/6/resources/validated/",
     "users": "https://api.coopstarter.happy-dev.fr/users/",
+    "criterias": "https://api.coopstarter.happy-dev.fr/sharingcriterias/",
+    "targets": "https://api.coopstarter.happy-dev.fr/targets/",
     "organisations": "https://api.coopstarter.happy-dev.fr/organisations/",
     "entrepreneurs": "https://api.coopstarter.happy-dev.fr/entrepreneurs/",
     "mentors": "https://api.coopstarter.happy-dev.fr/mentors/",
diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug
index 71ba9a01..c62b9aea 100644
--- a/src/includes/entrepreneur/resources/detail.pug
+++ b/src/includes/entrepreneur/resources/detail.pug
@@ -13,7 +13,7 @@
     fields='name, steps, format.name, \
             submitter_info(submitter.account.picture, submitter.name, \
             submitter.mentorProfile.organisation.name, skills, uri, broken),\
-            content(preview_image, iframe_link, tags),\
+            content(preview_image, iframe_link),\
             description, review.reviewer.account.picture, review.reviewer.name,\
             copyright, specifications(\
             header_specifications, author, country.name, language.name,\
diff --git a/src/includes/mentor/resources/create.pug b/src/includes/mentor/resources/create.pug
index be06ba6e..60092172 100644
--- a/src/includes/mentor/resources/create.pug
+++ b/src/includes/mentor/resources/create.pug
@@ -8,7 +8,7 @@ p.p_entete=`${data.ThankYouEnrichingDatabase}`
         fields="mandatory_information(header_mandatory, name, country, language, uri,\
                 format, fields, author, publication_year, skills),\
                 complementary_information(header_complementary, description, iframe_link,\
-                preview_image, tags),classification(header_classification, target, type, steps),\
+                preview_image),classification(header_classification, target, type, steps),\
                 access(header_access, sharing),related_section(header_related, related)"
         
         widget-header_mandatory='cs-section_header'
@@ -18,6 +18,8 @@ p.p_entete=`${data.ThankYouEnrichingDatabase}`
         widget-header_related='cs-section_header'
 
         range-type=`${endpoints.types}`
+        range-target=`${endpoints.targets}`
+        range-sharing=`${endpoints.criterias}`
         range-format=`${endpoints.formats}`
         range-steps=`${endpoints.steps}`
         range-language=`${endpoints.languages}`
@@ -43,7 +45,6 @@ p.p_entete=`${data.ThankYouEnrichingDatabase}`
         label-description=`${data.Description}`
         label-iframe_link=`${data.IframeLink}`
         label-preview_image=`${data.UploadPreviewImage}`
-        label-tags=`${data.AddTags}`
         
         label-target=`${data.ResourceTargetReq}`
         label-type=`${data.TypeContentReq}`
@@ -59,6 +60,8 @@ p.p_entete=`${data.ThankYouEnrichingDatabase}`
         multiple-type='sib-multiple-select'
         widget-type='sib-form-auto-completion'
 
+        widget-sharing='sib-form-auto-completion'
+        widget-target='sib-form-auto-completion'
         widget-format='sib-form-auto-completion'
 
         multiple-steps='sib-multiple-select'
diff --git a/src/includes/mentor/resources/detail.pug b/src/includes/mentor/resources/detail.pug
index 7746e26f..a84fe371 100644
--- a/src/includes/mentor/resources/detail.pug
+++ b/src/includes/mentor/resources/detail.pug
@@ -14,7 +14,7 @@
     fields='name, steps, format.name,\
             submitter_info(submitter.account.picture, submitter.name, \
             submitter.mentorProfile.organisation.name, skills, uri, broken),\
-            content(preview_image, iframe_link, tags),\
+            content(preview_image, iframe_link),\
             description, review.reviewer.account.picture, review.reviewer.name,\
             copyright, specifications(\
             header_specifications, author, country, language.name,\
diff --git a/src/includes/mentor/resources/edit.pug b/src/includes/mentor/resources/edit.pug
index 6fdc52f5..e0342a31 100644
--- a/src/includes/mentor/resources/edit.pug
+++ b/src/includes/mentor/resources/edit.pug
@@ -9,7 +9,7 @@ p.p_entete=`${data.ThankYouEnrichingDatabase}`
         fields="mandatory_information(header_mandatory, name, country, language, uri,\
                 format, field, author, publication_year, skills),\
                 complementary_information(header_complementary, description, iframe_link,\
-                preview_image, tags),classification(header_classification, target, type, steps),\
+                preview_image),classification(header_classification, target, type, steps),\
                 access(header_access, sharing),related_section(header_related, related)"
         
         widget-header_mandatory='cs-section_header'
@@ -45,7 +45,6 @@ p.p_entete=`${data.ThankYouEnrichingDatabase}`
         label-description=`${data.Description}`
         label-iframe_link=`${data.IframeLink}`
         label-preview_image=`${data.UploadPreviewImage}`
-        label-tags=`${data.AddTags}`
         
         label-target=`${data.ResourceTargetReq}`
         label-type=`${data.TypeContentReq}`
diff --git a/src/includes/mentor/resources/validate.pug b/src/includes/mentor/resources/validate.pug
index 294fedb7..f274e00b 100644
--- a/src/includes/mentor/resources/validate.pug
+++ b/src/includes/mentor/resources/validate.pug
@@ -19,7 +19,7 @@ sib-router
     fields='name, steps, format.name,\
             submitter_info(submitter.account.picture, submitter.name, \
             submitter.mentorProfile.organisation.name, skills, uri, broken),\
-            content(preview_image, tags),\
+            content(preview_image),\
             description, copyright, specifications(\
             header_specifications, author, country.name, language.name,\
             publication_year, fields, sharing)',
diff --git a/src/includes/public/resources/detail.pug b/src/includes/public/resources/detail.pug
index 3ed71dbc..400b6ec7 100644
--- a/src/includes/public/resources/detail.pug
+++ b/src/includes/public/resources/detail.pug
@@ -14,7 +14,7 @@
     fields='name, steps, format.name,\
             submitter_info(submitter.account.picture, submitter.name, \
             submitter.mentorProfile.organisation.name, skills, uri, broken),\
-            content(preview_image, iframe_link, tags),\
+            content(preview_image, iframe_link),\
             description, review.reviewer.account.picture, review.reviewer.name,\
             copyright, specifications(\
             header_specifications, author, country.name, language.name,\
-- 
GitLab