Skip to content

Commit

Permalink
feat(@dpc-sdp/ripple-ui-core): ✨ add ability to disable primary vic l…
Browse files Browse the repository at this point in the history
…ogo via flag
  • Loading branch information
dylankelly committed Aug 23, 2023
1 parent 5f49e5b commit c4a1b98
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/nuxt-app/test/features/site/theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,13 @@ Feature: Site theme
Then the site footer should have the "neutral" theme applied
And ripple buttons should have the "neutral" theme applied
And the hero banner should have the "neutral" theme applied
And the vic.gov.au logo should be displayed

@mockserver
Scenario: Feature flags can disable vic logo
Given the site endpoint returns fixture "/site/disable-vic-logo" with status 200
And the page endpoint for path "/" returns fixture "/landingpage/image-banner" with status 200
Given I visit the page "/"
Then the vic.gov.au logo should not be displayed


32 changes: 32 additions & 0 deletions examples/nuxt-app/test/fixtures/site/disable-vic-logo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "Test site for neutral theme",
"acknowledgementHeader": "Test hero acknowledgement",
"acknowledgementFooter": "Test footer acknowledgement",
"socialImages": {
"twitter": {},
"og": {}
},
"featureFlags": {
"disablePrimaryLogo": true
},
"menus": {
"menuMain": [
{
"text": "Demo Landing Page",
"url": "/demo-landing-page",
"uuid": "29bc9750-a335-455e-9e9a-4166c0bd73df",
"parent": null,
"weight": 0
}
],
"menuFooter": [
{
"text": "Demo Landing Page",
"url": "/demo-landing-page",
"uuid": "04e44b77-20df-4a73-b0d1-cf2d3d614754",
"parent": null,
"weight": 0
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ Then(
cy.get(`.rpl-header`).should('have.class', `rpl-header--${theme}`)
}
)

Then('the vic.gov.au logo should be displayed', (theme: string) => {
cy.get(`[aria-label="Victoria government logo"]`).should('exist')
})
Then('the vic.gov.au logo should not be displayed', (theme: string) => {
cy.get(`[aria-label="Victoria government logo"]`).should('not.exist')
})
4 changes: 4 additions & 0 deletions packages/ripple-tide-api/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ export interface IRplFeatureFlags {
* @description Sets the theme variant of the site footer component
*/
footerTheme?: 'neutral' | 'default'
/**
* @description Disable the primary vic.gov.au logo for sites that are not co-branded
*/
disablePrimaryLogo?: boolean
/**
* @description Sets which search connector to use for content collection queries
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import {
rplEventPayload
} from '../../../../composables/useRippleEvent'
import VicGovLogo from './../../../../assets/logos/logo-vic-gov.svg?component'
import type { IRplFeatureFlags } from '@dpc-sdp/ripple-tide-api/types'
const { disablePrimaryLogo }: IRplFeatureFlags = inject('featureFlags', {
disablePrimaryLogo: false
})
interface Props {
primaryLogo: IRplPrimaryNavLogo
Expand Down Expand Up @@ -77,6 +82,7 @@ const handleToggleItem = (level: number, item) => {
<RplLink
class="rpl-primary-nav__primary-logo-link rpl-u-focusable-outline rpl-u-focusable-outline--no-border"
:url="primaryLogo.href"
v-if="!disablePrimaryLogo"
>
<VicGovLogo
v-if="!primaryLogo?.src"
Expand Down

0 comments on commit c4a1b98

Please sign in to comment.