Skip to content

Commit

Permalink
Merge pull request #1008 from dpc-sdp/feature/R20-1694-optionally-rem…
Browse files Browse the repository at this point in the history
…ove-footer-logo

[R20-1694] add flag for removing vic branding in footer
  • Loading branch information
dylankelly authored Jan 28, 2024
2 parents 8e175b9 + 3059f2d commit 8e5ae47
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/nuxt-app/test/features/site/theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Feature: Site theme
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
And the footer 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
And the footer vic.gov.au logo should not be displayed
And the cobrand logo should be displayed


3 changes: 2 additions & 1 deletion examples/nuxt-app/test/fixtures/site/disable-vic-logo.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"altText": ""
},
"featureFlags": {
"disablePrimaryLogo": true
"disablePrimaryLogo": true,
"disableFooterLogo": true
},
"menus": {
"menuMain": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ Then('the vic.gov.au logo should be displayed', () => {
Then('the vic.gov.au logo should not be displayed', () => {
cy.get(`[aria-label="Victoria government logo"]`).should('not.exist')
})
Then('the footer vic.gov.au logo should be displayed', () => {
cy.get(`.rpl-footer-vic-gov-logo`).should('exist')
})
Then('the footer vic.gov.au logo should not be displayed', () => {
cy.get(`.rpl-footer-vic-gov-logo`).should('not.exist')
})
Then('the cobrand logo should be displayed', () => {
cy.get('.rpl-primary-nav__secondary-logo-image').should('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 @@ -214,6 +214,10 @@ export interface IRplFeatureFlags {
* @description Disable the primary vic.gov.au logo for sites that are not co-branded
*/
disablePrimaryLogo?: boolean
/**
* @description Disable the footer vic.gov.au logo for sites that are not co-branded
*/
disableFooterLogo?: boolean
/**
* @description Sets which search connector to use for content collection queries
*/
Expand Down
8 changes: 7 additions & 1 deletion packages/ripple-ui-core/src/components/footer/RplFooter.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useBreakpoints } from '@vueuse/core'
import { computed, onMounted, ref } from 'vue'
import { computed, inject, onMounted, ref } from 'vue'
import { bpMin } from '../../lib/breakpoints'
import RplAcknowledgement from '../acknowledgement/RplAcknowledgement.vue'
import RplTextLink from '../text-link/RplTextLink.vue'
Expand All @@ -19,6 +19,7 @@ import {
useRippleEvent,
rplEventPayload
} from '../../composables/useRippleEvent'
import type { IRplFeatureFlags } from '@dpc-sdp/ripple-tide-api/types'
interface Props {
variant?: (typeof RplFooterVariants)[number]
Expand All @@ -44,6 +45,10 @@ const emit = defineEmits<{
const { emitRplEvent } = useRippleEvent('rpl-footer', emit)
const { disableFooterLogo }: IRplFeatureFlags = inject('featureFlags', {
disableFooterLogo: false
})
const isMounted = ref(false)
onMounted(() => {
Expand Down Expand Up @@ -231,6 +236,7 @@ const handleClick = (link) => {
/>
</RplLink>
<RplLink
v-if="!disableFooterLogo"
class="rpl-footer-logo-link rpl-u-focusable-outline rpl-u-focusable-outline--no-border rpl-u-focusable--alt-colour"
:url="vicGovHomeUrl"
@click="
Expand Down

0 comments on commit 8e5ae47

Please sign in to comment.