Use new published_at field of a container repository tag in UI
Context
The value the frontend uses for the Published <X time ago>
info needs to be fixed.
Before #411387 (closed), we were relying on the createdAt
which was inaccurate. Now, the new registry API includes three new timestamps: created_at
, updated_at
and published_at
, where the latter is the computed value of the most recent of the former two (docs).
Problem: The frontend is currently relying on the createdAt
of the Rails API response, which is currently being set to the value of the tags created_at
from the registry response. So, this is technically correct (we're mapping two creation timestamp fields), but leads to a UX problem: we're now using the real tag creation timestamp and displaying it as the publishing timestamp, which is wrong.
In #432724 (closed), we will add a new field published_at
in the Rails API. This issue is focused on using that new field in the frontend where we show Published <X time ago>
Solution
The published date needs to be updated in two places, the tag row & in the tag details
See screenshot:
Implementation guide
- Add
publishedAt
field inapp/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_tags.query.graphql
- Update
tag.createdAt
totag.publishedAt
inapp/assets/javascripts/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row.vue
- If
tag.publishedAt
isnull
, fallback totag.createdAt
see discussion
- If