diff --git a/app/dev/releases.json b/app/dev/releases.json index d707d35..bff78b9 100644 --- a/app/dev/releases.json +++ b/app/dev/releases.json @@ -1 +1 @@ -[{"version_major":0,"version_minor":7,"version_patch":3,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Rename from \"Madek Exporter\" to \"Madek-Exporter\"\n\nFixes\n=====\n\n* Fix sign in as API-client.\n* Extend auth-info with type, show auth-info when connected as ApiClient.\n* Hide secrets by default: do not show \"internal\" connection parameters\n (password etc) in connection panel.\n"},{"version_major":0,"version_minor":6,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Improve the UX of the sign-in page: swapping tags deletes existing sign in info.\n\nFixes\n=====\n\n* Fix sign in with login and password.\n"},{"version_major":0,"version_minor":5,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Rename the application from \"Madek APP\" to \"Madek Exporter\".\n* Include release info.\n\nFixes\n=====\n\n* Fix export of meta-data of the Type MetaDatum::TextType.\n* Disconnect on the connection page will now delete the saved token, too.\n* Fix spelling and unnecessary involved language in many places.\n"}] \ No newline at end of file +[{"version_major":0,"version_minor":8,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Improve UI and UI when selecting the meta-key prefix.\n"},{"version_major":0,"version_minor":7,"version_patch":3,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Rename from \"Madek Exporter\" to \"Madek-Exporter\"\n\nFixes\n=====\n\n* Fix sign in as API-client.\n* Extend auth-info with type, show auth-info when connected as ApiClient.\n* Hide secrets by default: do not show \"internal\" connection parameters\n (password etc) in connection panel.\n"},{"version_major":0,"version_minor":6,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Improve the UX of the sign-in page: swapping tags deletes existing sign in info.\n\nFixes\n=====\n\n* Fix sign in with login and password.\n"},{"version_major":0,"version_minor":5,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Rename the application from \"Madek APP\" to \"Madek Exporter\".\n* Include release info.\n\nFixes\n=====\n\n* Fix export of meta-data of the Type MetaDatum::TextType.\n* Disconnect on the connection page will now delete the saved token, too.\n* Fix spelling and unnecessary involved language in many places.\n"}] \ No newline at end of file diff --git a/app/prod/releases.json b/app/prod/releases.json index d707d35..bff78b9 100644 --- a/app/prod/releases.json +++ b/app/prod/releases.json @@ -1 +1 @@ -[{"version_major":0,"version_minor":7,"version_patch":3,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Rename from \"Madek Exporter\" to \"Madek-Exporter\"\n\nFixes\n=====\n\n* Fix sign in as API-client.\n* Extend auth-info with type, show auth-info when connected as ApiClient.\n* Hide secrets by default: do not show \"internal\" connection parameters\n (password etc) in connection panel.\n"},{"version_major":0,"version_minor":6,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Improve the UX of the sign-in page: swapping tags deletes existing sign in info.\n\nFixes\n=====\n\n* Fix sign in with login and password.\n"},{"version_major":0,"version_minor":5,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Rename the application from \"Madek APP\" to \"Madek Exporter\".\n* Include release info.\n\nFixes\n=====\n\n* Fix export of meta-data of the Type MetaDatum::TextType.\n* Disconnect on the connection page will now delete the saved token, too.\n* Fix spelling and unnecessary involved language in many places.\n"}] \ No newline at end of file +[{"version_major":0,"version_minor":8,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Improve UI and UI when selecting the meta-key prefix.\n"},{"version_major":0,"version_minor":7,"version_patch":3,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Rename from \"Madek Exporter\" to \"Madek-Exporter\"\n\nFixes\n=====\n\n* Fix sign in as API-client.\n* Extend auth-info with type, show auth-info when connected as ApiClient.\n* Hide secrets by default: do not show \"internal\" connection parameters\n (password etc) in connection panel.\n"},{"version_major":0,"version_minor":6,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Improve the UX of the sign-in page: swapping tags deletes existing sign in info.\n\nFixes\n=====\n\n* Fix sign in with login and password.\n"},{"version_major":0,"version_minor":5,"version_patch":0,"version_pre":null,"version_build":null,"name":null,"description":"\nChanges\n=======\n\n* Rename the application from \"Madek APP\" to \"Madek Exporter\".\n* Include release info.\n\nFixes\n=====\n\n* Fix export of meta-data of the Type MetaDatum::TextType.\n* Disconnect on the connection page will now delete the saved token, too.\n* Fix spelling and unnecessary involved language in many places.\n"}] \ No newline at end of file diff --git a/electron_front/src/all/madek/app/front/connection.cljs b/electron_front/src/all/madek/app/front/connection.cljs index 7d9eb26..7605b8a 100644 --- a/electron_front/src/all/madek/app/front/connection.cljs +++ b/electron_front/src/all/madek/app/front/connection.cljs @@ -234,5 +234,4 @@ [connect-form] [continue-form]) [:div.clearfix] - [debug-component] - ]) + [debug-component]]) diff --git a/electron_front/src/all/madek/app/front/download/step2.cljs b/electron_front/src/all/madek/app/front/download/step2.cljs index 64fbfbf..ae8f34c 100644 --- a/electron_front/src/all/madek/app/front/download/step2.cljs +++ b/electron_front/src/all/madek/app/front/download/step2.cljs @@ -25,6 +25,9 @@ (def download* (reaction (-> @state/jvm-main-db :download))) +(def vocabulary* (reaction + (-> @form-data* :vocabulary presence))) + (def set-value (form-utils/create-update-form-data-setter state/client-db @@ -74,10 +77,7 @@ "This means that only the meta-data of media-entries or sets will be downloaded. " ]]]) -;;; prefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(def vocabulary* (reaction - (-> @form-data* :vocabulary presence))) +;;; prefix meta-key ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn load-vocabulary-meta-keys [] (when-let [vocabulary @vocabulary*] @@ -89,10 +89,18 @@ :callback (fn [resp] (when (:success resp) (set-value vocabulary - (conj (:body resp) - {:label "None" - :id nil - :vocabulary_id vocabulary })))))))) + (conj (->> (:body resp) + (filter #(= (:meta_datum_object_type %) + "MetaDatum::Text")) + (map #(assoc % :key (:id %))) + (sort-by :label) + (into [])) + {:label "NO META-KEY PREFIX" + :id "" + :key "" + :vocabulary_id vocabulary + :meta_datum_object_type "MetaDatum::Text" + })))))))) (add-watch vocabulary* :lazy-load-meta-keys-watch (fn [_ _ _ vocabulary] @@ -106,18 +114,23 @@ [:label "Meta-key:"] [:select.form-control {:on-change #(set-value :prefix_meta_key (.. % -target -value)) - :default-value (or (-> @form-data* :prefix_meta_key) "")} + :value (-> @form-data* :prefix_meta_key)} (for [option meta-keys-options] - [:option {:key (:id option) } (:id option)])] + [:option + {:key (:id option) + :value (:id option)} + (:label option)])] [:p.help-block - "If the blank option is select neither prefix nor underscore will be present. " + "If the " [:code "NO META-KEY PREFIX"] + " option is select neither prefix nor underscore will be present. " "This is probably a good choice for automatized post processing. "] [:p.help-block - "If the value of the corresponding meta-key is plank or if there is no " + "If the value of the corresponding meta-key is blank or if there is no " " such meta-key present for the entity " - " the id will be still prefixed with an underscore."] - [:p.help-block - "Only \"simple\" meta-keys, e.g. text based ones, should be used here." ]])) + " the id will be still prefixed with an underscore."]])) + + +;;; prefix vocabulary ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn load-vocabularies [] (when-not (-> @form-data* :vocabularies) @@ -125,7 +138,10 @@ {:method :get :path "/vocabularies/"} {:title "Fetch Vocabularies"} - :callback (fn [req] (set-value :vocabularies (:body req)))))) + :callback (fn [req] (set-value :vocabularies + (->> (:body req) + (map #(assoc % :key (:id %))) + (sort-by :label))))))) (defn vocabulary-form-group-component [] [:div.form-group.vocabulary @@ -133,17 +149,25 @@ [:select.form-control {:on-change #(let [voc (.. % -target -value)] (when-not (= voc (-> @form-data* :vocabulary)) - (set-value :prefix_meta_key nil)) + (set-value :prefix_meta_key "")) (set-value :vocabulary voc)) - :default-value (-> @form-data* :vocabulary)} - (for [option (or (->> @form-data* :vocabularies) {})] - [:option {:key (:id option)}(:id option)])]]) + :value (-> @form-data* :vocabulary)} + (for [option (or (-> @form-data* :vocabularies) {})] + [:option + {:key (:id option) + :value (:id option) + :data-id (:id option) + :data-label (:label option)} + (:label option)])]]) (defn prefix-vocabulary-component [] (reagent/create-class {:component-did-mount load-vocabularies :render vocabulary-form-group-component})) + +;;; prefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defn prefix-component [] [:div.prefix [:h4 "Prefix"] @@ -154,6 +178,7 @@ [prefix-meta-key-component] ]) + ;;; form ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn form-component [] @@ -183,8 +208,7 @@ [:div.download-form [:h2 "Step 2 - Set Advanced Options" ] [form-component] - [debug-component] - ]) + [debug-component]]) (defn initialize-form-data [] (when-not (:vocabulary @form-data*) @@ -194,7 +218,8 @@ (defn component [] (reagent/create-class - {:component-did-mount initialize-form-data + {;:component-will-mount #(swap! state/client-db assoc-in [:download :download-form] {}) + :component-did-mount initialize-form-data :render main-component })) diff --git a/releases.yml b/releases.yml index d2cf3de..32b947e 100644 --- a/releases.yml +++ b/releases.yml @@ -1,4 +1,21 @@ -##### 0.7.3 ####################################################################### +###### 0.8.0 ####################################################################### + +- version_major: 0 + version_minor: 8 + version_patch: 0 + version_pre: NULL + version_build: NULL + name: NULL + + description: | + + Changes + ======= + + * Improve UI and UI when selecting the meta-key prefix. + + +#### 0.7.3 ####################################################################### - version_major: 0 version_minor: 7