Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code to view on prod #646

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sde_collections/models/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ def server_url_test(self) -> str:
encoded_payload = urllib.parse.quote(json.dumps(payload))
return f"{base_url}/app/nasa-sba-smd/#/search?query={encoded_payload}"

@property
def server_url_prod(self) -> str:
base_url = "https://sciencediscoveryengine.nasa.gov"
payload = {
"name": "query-smd-primary",
"scope": "All",
"text": "",
"advanced": {
"collection": f"/SDE/{self.config_folder}/",
},
}
encoded_payload = urllib.parse.quote(json.dumps(payload))
return f"{base_url}/app/nasa-sba-smd/#/search?query={encoded_payload}"

@property
def curation_status_button_color(self) -> str:
color_choices = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<h1>{{ collection.name }}</h1>
</div>
<div class="col-md-6">

<a href="{{ collection.server_url_test }}" target="_blank" style="color:white"><button class="btn btn-primary btn-sm pull-right">View on test server</button></a>
<a href="{{ collection.server_url_test }}" target="_blank" style="color:white"><button class="btn btn-primary btn-sm pull-right">View on test</button></a>
<a href="{{ collection.server_url_prod }}" target="_blank" style="color:white"><button class="btn btn-primary btn-sm pull-right">View on prod</button></a>
</div>
</div>
<table class="table table-striped">
Expand Down