Skip to content

Add HostingPolicyRenderer Component#1151

Open
tarrow wants to merge 1 commit into
mainfrom
T432340-2
Open

Add HostingPolicyRenderer Component#1151
tarrow wants to merge 1 commit into
mainfrom
T432340-2

Conversation

@tarrow

@tarrow tarrow commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This commit introduces the HostingPolicyRenderer component which calls the Platform API to render the hosting-policy routes looking like /hosting-policy/:activeFrom

It follows a similar pattern to the TermsOfUseRenderer but doesn't include a navigation component since we do not have multiple versions to consider yet.

It also introduces a stub hosting policy content for viewing on staging. This won't be visible on production because there is not a corresponding Policy object in the production DB

This commit also adjusts the TermsOfUseRenderer to determine the vue component to load using the content_vue_file key from the API response rather than by trying to determine it from the active_from date.

Bug: T432340

This commit introduces the HostingPolicyRenderer component which calls the Platform API
to render the hosting-policy routes looking like /hosting-policy/:activeFrom

It follows a similar pattern to the TermsOfUseRenderer but doesn't include
a navigation component since we do not have multiple versions to consider yet.

It also introduces a stub hosting policy content for
viewing on staging. This won't be visible on production because
there is not a corresponding Policy object in the production DB

This commit also adjusts the TermsOfUseRenderer to determine the
vue component to load using the content_vue_file key from the
API response rather than by trying to determine it from the
active_from date.

Bug: T432340
@github-actions

Copy link
Copy Markdown

Deployment previews on netlify for branch refs/pull/1151/merge will be at the following locations (when build is done):

<v-main>
<v-container class="fill-height" fluid>
<v-row justify="center">
<v-col cols="11" md="4" order-md="last">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should you put PolicyNavigationPanel here?

this.policy = versions[metadata.content_vue_file]
} catch (error) {
console.error(error)
alert('Failed to load policy.')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The error message is very generic, and alert() is a poor UX for a Vue/Vuetify app. Should we use snackbar like other components?

const response = await this.$api.policyByDate({ policyType, activeFrom })

const metadata = await response.metadata
this.policy = versions[metadata.content_vue_file]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm wondering if content_vue_file is empty, then this.policy becomes undefined and the UI will silently render nothing. Should we throw or show an error when key is unknown?

this.policy = versions[metadata.content_vue_file]
} catch (error) {
console.error(error)
alert('Failed to load policy.')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tested and cannot load version1 and was hit with this alert instead. Did I do something wrong?

Image

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.

2 participants