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

chore: cleanup some console/linter warnings #1268

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/nuxt-ripple/components/TideBaseLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export interface Props {
footerImageCaption?: string
topicTags?: TideTopicTag[]
updatedDate?: string | null
siteSection: TideSiteSection | null
page: any
siteSection?: TideSiteSection | null
page?: any
showContentRating?: boolean
}

Expand All @@ -123,6 +123,7 @@ const props = withDefaults(defineProps<Props>(), {
topicTags: () => [],
updatedDate: null,
siteSection: null,
page: null,
showContentRating: false
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Then(`the data map component tabs should exist`, () => {
cy.get('.rpl-tabs').should('exist')
})

Then(`the data map tabs should be labelled:`, (dataTable) => {
Then(`the data map tabs should be labelled:`, (dataTable: DataTable) => {
const items = dataTable.raw()
cy.get('.rpl-tabs .rpl-tab').as('items')
items.forEach((row, i: number) => {
Expand Down Expand Up @@ -170,7 +170,7 @@ Then(
cy.location().should((loc) => {
const params = new URLSearchParams(loc.search)

items.forEach((row, i: number) => {
items.forEach((row) => {
expect(params.get(`location[${row.key}]`)).to.eq(`${row.value}`)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const amount = computed(() => {
return null
})

const isOnGoing = computed(() =>
getSearchResultValue(props.result, 'field_node_on_going')
const isOnGoing = computed(
() => getSearchResultValue(props.result, 'field_node_on_going') ?? false
)

const dateFrom = computed(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ defineProps<{
description?: string
numbered: boolean
items: Array<any>
hasSidebar?: boolean
hasTitle?: boolean
pageBackground?: string
}>()
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface TideContentPage extends TidePageBase {
}

interface Props {
id: string
id?: string
title: string
introText?: string
autocompleteQuery?: boolean
Expand Down
5 changes: 3 additions & 2 deletions packages/ripple-tide-search/components/TideSearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import { useRippleEvent } from '@dpc-sdp/ripple-ui-core'
import type { rplEventPayload } from '@dpc-sdp/ripple-ui-core'

interface Props {
id: string
id?: string
pageTitle: string
filtersConfig: AppSearchFilterConfigItem[]
searchDriverOptions: Omit<SearchDriverOptions, 'apiConnector'>
searchResultsMappingFn: (item: any) => MappedSearchResult<any>
scrollToResults: boolean
scrollToResults?: boolean
}

const props = withDefaults(defineProps<Props>(), {
Expand Down Expand Up @@ -316,6 +316,7 @@ watch(
</div>
</div>
<RplFormActions
id="tide-search-page-actions"
:label="submitFiltersLabel"
resetLabel="Clear search filters"
:displayResetButton="true"
Expand Down
4 changes: 2 additions & 2 deletions packages/ripple-tide-search/utils/rplAddressSuggestionsFn.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { capitalCase } from 'change-case'

const getSuburbSuggestions = async (query, args) => {
const getSuburbSuggestions = async (query) => {
const suggestionsIndex = 'vicpol-postcode-localities'

const searchUrl = `/api/tide/app-search/${suggestionsIndex}/elasticsearch/_search`
Expand Down Expand Up @@ -50,7 +50,7 @@ const getSuburbSuggestions = async (query, args) => {
})
}

const getAddressSuggestions = async (query, args) => {
const getAddressSuggestions = async (query) => {
const geocodeServerUrl =
'https://corp-geo.mapshare.vic.gov.au/arcgis/rest/services/Geocoder/VMAddressEZIAdd/GeocodeServer'

Expand Down
7 changes: 5 additions & 2 deletions packages/ripple-ui-core/src/components/slider/RplSlider.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, ref, useSlots, watch } from 'vue'
import { computed, ref, useSlots, watch, onMounted } from 'vue'
import RplPagination from '../pagination/RplPagination.vue'
import { bpMin } from '../../lib/breakpoints'
import { RplSlidesPerView } from './constants'
Expand Down Expand Up @@ -44,6 +44,7 @@ const emit = defineEmits<{
(e: 'change', payload: rplEventPayload & { action: 'prev' | 'next' }): void
}>()

const mounted = ref(false)
const container = ref()
const swiper = ref()
const activePage = ref(1)
Expand Down Expand Up @@ -118,6 +119,8 @@ watch(
(slide) => swiper.value.$el.swiper.slideTo(slide)
)

onMounted(() => (mounted.value = true))

const paginationClick = ({ action, text, value }) => {
paginate.value = true
swiper.value.$el.swiper.slideTo(value - 1)
Expand Down Expand Up @@ -206,7 +209,7 @@ const slideChangeNotice = computed(() => {
</SwiperSlide>
</Swiper>
<div
v-if="changeNotice"
v-if="mounted && changeNotice"
aria-live="polite"
aria-atomic="true"
class="rpl-u-visually-hidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ const plugins = computed(
<FormKit
:id="id"
v-slot="{ value }"
:name="id"
type="form"
:plugins="plugins"
form-class="rpl-form"
Expand Down