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

Frontend Status Badges #224

Merged
merged 7 commits into from
Oct 25, 2024
Merged

Frontend Status Badges #224

merged 7 commits into from
Oct 25, 2024

Conversation

JVickery-TBS
Copy link
Contributor

feat(templates): status badges;

  • Added status badges.

As promised back in February (here: #200 (comment)), this adds frontend badges stating the status of the xloadering and availability in the datastore.

Threw in the French (at least French Canadian) badges as well.

- Added status badges.
ckanext/xloader/helpers.py Outdated Show resolved Hide resolved
- Reverse debug badge logic.
@ThrawnCA ThrawnCA changed the base branch from master to develop October 15, 2024 05:10
@ThrawnCA ThrawnCA changed the base branch from develop to master October 15, 2024 05:11
Copy link
Collaborator

@duttonw duttonw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readme needs to be updated with the new config options:

ckanext.xloader.show_badges : boolean (default True)
ckanext.xloader.debug_badges : boolean (default False)

@duttonw
Copy link
Collaborator

duttonw commented Oct 15, 2024

running it via qld-gov-au data.qld.gov.au site for end to end testing via qld-gov-au#108

@duttonw
Copy link
Collaborator

duttonw commented Oct 16, 2024

Hi @JVickery-TBS ,

We tried this in dev.data.qld.gov.au and we already run into a bug, a i18n bug ;)

Carl @ThrawnCA has raised a discussion point on having better 404 handling if a i18n file is not found (use default)
ckan/ckan#8487

https://dev.data.qld.gov.au/static/badges/en_AU/datastore-running.svg
but
https://dev.data.qld.gov.au/static/badges/en/datastore-running.svg
exists

My suggestion is to ditch the images and use i18n in text form only. I.e. borrow from the validations plugin.

from

<a href="/dataset/7795b370-eef5-4808-9844-812d7c6b302a/resource_data/550bcdfe-3ced-48a0-abcb-65d7e74c91ea" 
class="loader-badge">
<img src="/static/badges/en_AU/datastore-running.svg" 
alt="Loading data into DataStore" title="October 16, 2024, 13:37 (AEST)">
</a>

to

<a href="/dataset/7795b370-eef5-4808-9844-812d7c6b302a/resource_data/550bcdfe-3ced-48a0-abcb-65d7e74c91ea" 
class="validation-badge" 
title="Loading data into DataStore: October 16, 2024, 13:38 (AEST)" >
<span class="prefix">Datastore</span>
<span class="status success">Running</span>
</a>

image

What do you think?

I'll see if I can get round to this update as what you have is very nice. (if you don't beat me to it).

Regards

@duttonw

p.s. I've just built a pypi github actions deployment pipeline (still needs improvements) but its now on ckna/ckanext-xloader :) You can read a bit more about it here: #229

@duttonw duttonw merged commit cf437f1 into ckan:master Oct 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants