Skip to content

Commit

Permalink
Cmr 9086 9087 implement tool variable landing page (#1951)
Browse files Browse the repository at this point in the history
* CMR-9086-9087 change the tool and variable preview version.

* CMR-9086-9087: Updated the metadata preview version

* CMR-9086-9087 testing the new preview version

* CMR-9086-9087: removed the hardcoded preview version.

---------

Co-authored-by: siwei xu <[email protected]>
  • Loading branch information
sxu123 and siwei xu authored Aug 7, 2023
1 parent ada66c0 commit 8c3e87e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
5 changes: 2 additions & 3 deletions search-app/resources/templates/tool-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
{% block title %}CMR Preview{% endblock %}

{% block head-pre-css %}
//replace {{ preview-version }} with MMT-3263-10 temporarily for testing purpose.
<script defer src="{{ preview-root }}/plugin/metadata-preview.MMT-3263-10.js"></script>
<link href="{{ preview-root }}/plugin/metadata-preview.MMT-3263-10.min.css" rel="stylesheet" type="text/css">
<script defer src="{{ preview-root }}/plugin/metadata-preview.{{ preview-version }}.js"></script>
<link href="{{ preview-root }}/plugin/metadata-preview.{{ preview-version }}.min.css" rel="stylesheet" type="text/css">
{% endblock %}

{% block main-content %}
Expand Down
5 changes: 2 additions & 3 deletions search-app/resources/templates/variable-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
{% block title %}CMR Preview{% endblock %}

{% block head-pre-css %}
//replace {{ preview-version }} with MMT-3263-10 temporarily for testing purpose.
<script defer src="{{ preview-root }}/plugin/metadata-preview.MMT-3263-10.js"></script>
<link href="{{ preview-root }}/plugin/metadata-preview.MMT-3263-10.min.css" rel="stylesheet" type="text/css">
<script defer src="{{ preview-root }}/plugin/metadata-preview.{{ preview-version }}.js"></script>
<link href="{{ preview-root }}/plugin/metadata-preview.{{ preview-version }}.min.css" rel="stylesheet" type="text/css">
{% endblock %}

{% block main-content %}
Expand Down
7 changes: 3 additions & 4 deletions search-app/src/cmr/search/api/concepts_lookup.clj
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,15 @@
result-format (if (= result-format :xml) :native result-format)]
(if (= :html result-format)
(let [concept-type (concepts/concept-id->type concept-id)]
(cond
(= concept-type :tool)
(condp = concept-type
:tool
(core-api/search-response ctx
{:results (:body (pages/tool-page ctx concept-id))
:result-format :html})
(= concept-type :variable)
:variable
(core-api/search-response ctx
{:results (:body (pages/variable-page ctx concept-id))
:result-format :html})
:else
(core-api/search-response ctx
{:results (:body (pages/collection-page ctx concept-id))
:result-format :html})))
Expand Down
2 changes: 1 addition & 1 deletion search-app/src/cmr/search/site/data.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

(defconfig metadata-preview-version
"version of the metadata preview plugin"
{:default "0.0.25"})
{:default "23.3.2-1"})

(defmulti get-providers
"Get the providers, based on contextual data.
Expand Down

0 comments on commit 8c3e87e

Please sign in to comment.