@worksafevictoria/wcl7.5 1.1.0-beta.92 → 1.1.0-beta.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/Containers/HomepageHeader/index.stories.js +60 -36
- package/src/components/Containers/HomepageHeader/index.vue +21 -32
- package/src/components/Containers/HomepageHeaderNew/index.stories.js +14 -15
- package/src/components/Containers/HomepageHeaderNew/index.vue +8 -23
- package/src/components/Paragraphs/BrowseContent/index.vue +228 -204
- package/src/components/Paragraphs/BrowseContent/setup.vue +284 -0
- package/src/components/Paragraphs/Directory/Records/HSCP/index.stories.js +11 -4
- package/src/components/Paragraphs/Directory/Records/HSCP/index.vue +136 -16
- package/src/components/SubComponents/FormInstance/models/overrides/file.js +1 -3
- package/src/index.js +8 -2
package/package.json
CHANGED
|
@@ -2,43 +2,66 @@ import HomepageHeader from './index.vue'
|
|
|
2
2
|
|
|
3
3
|
const header = {
|
|
4
4
|
title: 'This is sentence 1. This is sentence 2.',
|
|
5
|
-
description: 'description text'
|
|
5
|
+
description: 'description text',
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
8
|
+
// This is generated server side with useAsyncData
|
|
9
|
+
// const fetchMenu = () =>
|
|
10
|
+
// Promise.resolve([
|
|
11
|
+
// {
|
|
12
|
+
// title: 'Report an incident',
|
|
13
|
+
// relative: '/report-incident'
|
|
14
|
+
// },
|
|
15
|
+
// {
|
|
16
|
+
// title: 'Report a case of COVID-19',
|
|
17
|
+
// relative: '/report-confirmed-positive-case-covid-19'
|
|
18
|
+
// },
|
|
19
|
+
// {
|
|
20
|
+
// title: 'Make a claim',
|
|
21
|
+
// relative: '/before-claim'
|
|
22
|
+
// },
|
|
23
|
+
// {
|
|
24
|
+
// title: 'Apply for a licence',
|
|
25
|
+
// relative: '/apply-for-licence'
|
|
26
|
+
// },
|
|
27
|
+
// {
|
|
28
|
+
// title: 'Pay or renew your insurance',
|
|
29
|
+
// relative: '/pay-or-renew-your-workcover-insurance-premium'
|
|
30
|
+
// }
|
|
31
|
+
// ])
|
|
32
|
+
const headerLinks = [
|
|
33
|
+
{
|
|
34
|
+
text: 'Report an incident',
|
|
35
|
+
path: '/report-incident',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
text: 'Report a case of COVID-19',
|
|
39
|
+
path: '/report-confirmed-positive-case-covid-19',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
text: 'Make a claim',
|
|
43
|
+
path: '/before-claim',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
text: 'Apply for a licence',
|
|
47
|
+
path: '/apply-for-licence',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
text: 'Pay or renew your insurance',
|
|
51
|
+
path: '/pay-or-renew-your-workcover-insurance-premium',
|
|
52
|
+
},
|
|
53
|
+
]
|
|
31
54
|
|
|
32
55
|
const contentParser = () => {
|
|
33
56
|
return Promise.resolve({
|
|
34
57
|
results: [
|
|
35
58
|
{
|
|
36
59
|
title: 'Content title 1',
|
|
37
|
-
description: 'Content description 2'
|
|
38
|
-
}
|
|
60
|
+
description: 'Content description 2',
|
|
61
|
+
},
|
|
39
62
|
],
|
|
40
63
|
offset: 0,
|
|
41
|
-
numFound: 1000
|
|
64
|
+
numFound: 1000,
|
|
42
65
|
})
|
|
43
66
|
}
|
|
44
67
|
|
|
@@ -48,31 +71,32 @@ export default {
|
|
|
48
71
|
argTypes: {
|
|
49
72
|
fetchMenu: {
|
|
50
73
|
control: 'function',
|
|
51
|
-
table: { disable: true }
|
|
74
|
+
table: { disable: true },
|
|
52
75
|
},
|
|
53
76
|
contentParser: {
|
|
54
77
|
control: 'function',
|
|
55
|
-
table: { disable: true }
|
|
56
|
-
}
|
|
78
|
+
table: { disable: true },
|
|
79
|
+
},
|
|
57
80
|
},
|
|
58
81
|
args: {
|
|
59
82
|
heroHeader: header,
|
|
60
|
-
fetchMenu: fetchMenu,
|
|
61
|
-
contentParser: contentParser
|
|
62
|
-
|
|
83
|
+
// fetchMenu: fetchMenu,
|
|
84
|
+
contentParser: contentParser,
|
|
85
|
+
headerLinks: headerLinks,
|
|
86
|
+
},
|
|
63
87
|
}
|
|
64
88
|
|
|
65
89
|
const DefaultHH = (args) => ({
|
|
66
90
|
components: { HomepageHeader },
|
|
67
91
|
setup() {
|
|
68
|
-
return { args }
|
|
92
|
+
return { args }
|
|
69
93
|
},
|
|
70
94
|
mounted() {
|
|
71
95
|
setTimeout(() => {
|
|
72
96
|
this.$refs.hh.renderMenu()
|
|
73
97
|
})
|
|
74
98
|
},
|
|
75
|
-
template: '<homepage-header v-bind="args" ref="hh" />'
|
|
99
|
+
template: '<homepage-header v-bind="args" ref="hh" />',
|
|
76
100
|
})
|
|
77
101
|
|
|
78
|
-
export const Default = DefaultHH.bind({})
|
|
102
|
+
export const Default = DefaultHH.bind({})
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<template v-slot:side>
|
|
31
31
|
<div>
|
|
32
32
|
<cta-button
|
|
33
|
-
v-for="(link, i) in
|
|
33
|
+
v-for="(link, i) in headerLinks"
|
|
34
34
|
:key="i"
|
|
35
35
|
class="iebtn"
|
|
36
36
|
:url="link.path"
|
|
@@ -51,45 +51,34 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
</hero-header>
|
|
53
53
|
</template>
|
|
54
|
-
<script
|
|
54
|
+
<script>
|
|
55
55
|
import Search from './../../SubComponents/Search/index.vue'
|
|
56
56
|
import CtaButton from './../../SubComponents/CtaButton/index.vue'
|
|
57
57
|
import HeroHeader from './../../Global/HeroHeader/index.vue'
|
|
58
58
|
import earthIcon from './../../../assets/icons/earth.svg?url'
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
export default {
|
|
61
|
+
name: 'HomepageHeader',
|
|
62
|
+
components: {
|
|
63
|
+
Search,
|
|
64
|
+
CtaButton,
|
|
65
|
+
HeroHeader,
|
|
64
66
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
props: {
|
|
68
|
+
contentParser: {
|
|
69
|
+
type: Function,
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
heroHeader: {
|
|
73
|
+
type: Object,
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
headerLinks: { type: Array, required: true },
|
|
68
77
|
},
|
|
69
|
-
fetchMenu: {
|
|
70
|
-
type: Function,
|
|
71
|
-
required: true,
|
|
72
|
-
},
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
const links = ref([])
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
} catch (err) {
|
|
81
|
-
console.log('🚀 ~ err:', err)
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
async function renderMenu() {
|
|
86
|
-
const menu = await props.fetchMenu()
|
|
87
|
-
links.value = (Array.isArray(menu) ? menu : []).map((item) => {
|
|
88
|
-
return {
|
|
89
|
-
text: item.title,
|
|
90
|
-
path: item.relative || item.absolute,
|
|
91
|
-
}
|
|
92
|
-
})
|
|
79
|
+
data: () => ({
|
|
80
|
+
earthIcon,
|
|
81
|
+
}),
|
|
93
82
|
}
|
|
94
83
|
</script>
|
|
95
84
|
<style lang="scss" scoped>
|
|
@@ -2,29 +2,28 @@ import HomepageHeader from './index.vue'
|
|
|
2
2
|
import { mockCarouselItems } from '../../../mock/carousel-items'
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
Promise.resolve([
|
|
5
|
+
const headerLinks = [
|
|
7
6
|
{
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
text: 'Report an incident',
|
|
8
|
+
path: '/report-incident'
|
|
10
9
|
},
|
|
11
10
|
{
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
text: 'Report a case of COVID-19',
|
|
12
|
+
path: '/report-confirmed-positive-case-covid-19'
|
|
14
13
|
},
|
|
15
14
|
{
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
text: 'Make a claim',
|
|
16
|
+
path: '/before-claim'
|
|
18
17
|
},
|
|
19
18
|
{
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
text: 'Apply for a licence',
|
|
20
|
+
path: '/apply-for-licence'
|
|
22
21
|
},
|
|
23
22
|
{
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
text: 'Pay or renew your insurance',
|
|
24
|
+
path: '/pay-or-renew-your-workcover-insurance-premium'
|
|
26
25
|
}
|
|
27
|
-
]
|
|
26
|
+
]
|
|
28
27
|
|
|
29
28
|
const contentParser = () => {
|
|
30
29
|
return Promise.resolve({
|
|
@@ -53,10 +52,10 @@ export default {
|
|
|
53
52
|
}
|
|
54
53
|
},
|
|
55
54
|
args: {
|
|
56
|
-
fetchMenu: fetchMenu,
|
|
57
55
|
slideList: mockCarouselItems,
|
|
58
56
|
isStorybook: true,
|
|
59
|
-
contentParser: contentParser
|
|
57
|
+
contentParser: contentParser,
|
|
58
|
+
headerLinks: headerLinks,
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
>
|
|
34
34
|
<div>
|
|
35
35
|
<cta-button
|
|
36
|
-
v-for="(link, i) in
|
|
36
|
+
v-for="(link, i) in headerLinks"
|
|
37
37
|
:key="i"
|
|
38
38
|
class="iebtn"
|
|
39
39
|
:url="link.path"
|
|
@@ -73,11 +73,7 @@ export default {
|
|
|
73
73
|
type: Function,
|
|
74
74
|
required: true,
|
|
75
75
|
},
|
|
76
|
-
|
|
77
|
-
type: Function,
|
|
78
|
-
required: true,
|
|
79
|
-
},
|
|
80
|
-
slideList: {
|
|
76
|
+
slideList: {
|
|
81
77
|
type: Array,
|
|
82
78
|
required: true,
|
|
83
79
|
// default: mockCarouselItems
|
|
@@ -85,27 +81,16 @@ export default {
|
|
|
85
81
|
isStorybook: {
|
|
86
82
|
type: Boolean,
|
|
87
83
|
default: false
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
},
|
|
85
|
+
headerLinks: {
|
|
86
|
+
type: Array,
|
|
87
|
+
required: true
|
|
88
|
+
},
|
|
92
89
|
},
|
|
93
90
|
|
|
94
91
|
data: () => ({
|
|
95
|
-
links: [],
|
|
96
92
|
earthIcon,
|
|
97
|
-
})
|
|
98
|
-
methods: {
|
|
99
|
-
async renderMenu() {
|
|
100
|
-
const menu = await this.fetchMenu()
|
|
101
|
-
this.links = (Array.isArray(menu) ? menu : []).map((item) => {
|
|
102
|
-
return {
|
|
103
|
-
text: item.title,
|
|
104
|
-
path: item.relative || item.absolute,
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
},
|
|
108
|
-
},
|
|
93
|
+
})
|
|
109
94
|
}
|
|
110
95
|
</script>
|
|
111
96
|
|
|
@@ -38,226 +38,250 @@
|
|
|
38
38
|
</card-group>
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
|
-
<script
|
|
41
|
+
<script>
|
|
42
42
|
import CardGroup from '../../SubComponents/CardGroup/index.vue'
|
|
43
43
|
import DirectoryFilters from '../../Global/DirectoryFilters/index.vue'
|
|
44
44
|
import Switcher from './switcher.vue'
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const displayLimit = ref(0)
|
|
53
|
-
const allCards = ref(undefined)
|
|
54
|
-
const filters = ref({
|
|
55
|
-
taxonomies: [],
|
|
56
|
-
selected: {},
|
|
57
|
-
availableBundles: [],
|
|
58
|
-
})
|
|
59
|
-
const props = defineProps({
|
|
60
|
-
background: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: 'grey',
|
|
63
|
-
},
|
|
64
|
-
title: {
|
|
65
|
-
type: String,
|
|
66
|
-
default: '',
|
|
67
|
-
},
|
|
68
|
-
titleTag: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: 'h2',
|
|
71
|
-
},
|
|
72
|
-
bundle: {
|
|
73
|
-
type: Array,
|
|
74
|
-
default: () => [''],
|
|
75
|
-
},
|
|
76
|
-
columns: {
|
|
77
|
-
type: Number,
|
|
78
|
-
default: 0,
|
|
79
|
-
},
|
|
80
|
-
initialDisplyLimit: {
|
|
81
|
-
type: Number,
|
|
82
|
-
default: 0,
|
|
83
|
-
},
|
|
84
|
-
fetchContent: {
|
|
85
|
-
type: Function,
|
|
86
|
-
required: true,
|
|
87
|
-
},
|
|
88
|
-
fetchFilters: {
|
|
89
|
-
type: Function,
|
|
90
|
-
required: false,
|
|
91
|
-
default: null,
|
|
92
|
-
},
|
|
93
|
-
enableBundleFilter: {
|
|
94
|
-
type: Boolean,
|
|
46
|
+
export default {
|
|
47
|
+
name: 'BrowseContent',
|
|
48
|
+
components: {
|
|
49
|
+
CardGroup,
|
|
50
|
+
DirectoryFilters,
|
|
51
|
+
Switcher,
|
|
95
52
|
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
53
|
+
props: {
|
|
54
|
+
background: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: 'grey',
|
|
57
|
+
},
|
|
58
|
+
title: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: '',
|
|
61
|
+
},
|
|
62
|
+
titleTag: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: 'h2',
|
|
65
|
+
},
|
|
66
|
+
bundle: {
|
|
67
|
+
type: Array,
|
|
68
|
+
default: () => [''],
|
|
69
|
+
},
|
|
70
|
+
columns: {
|
|
71
|
+
type: Number,
|
|
72
|
+
default: 0,
|
|
73
|
+
},
|
|
74
|
+
initialDisplyLimit: {
|
|
75
|
+
type: Number,
|
|
76
|
+
default: 0,
|
|
77
|
+
},
|
|
78
|
+
fetchContent: {
|
|
79
|
+
type: Function,
|
|
80
|
+
required: true,
|
|
81
|
+
},
|
|
82
|
+
fetchFilters: {
|
|
83
|
+
type: Function,
|
|
84
|
+
required: false,
|
|
85
|
+
default: null,
|
|
86
|
+
},
|
|
87
|
+
enableBundleFilter: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
},
|
|
90
|
+
getBundleAlias: {
|
|
91
|
+
type: Function,
|
|
92
|
+
required: false,
|
|
93
|
+
default: null,
|
|
94
|
+
},
|
|
95
|
+
showMore: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
},
|
|
98
|
+
type: {
|
|
99
|
+
type: String,
|
|
100
|
+
required: true,
|
|
101
|
+
},
|
|
103
102
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
// Temp use of mounted to replace fetch
|
|
104
|
+
async mounted() {
|
|
105
|
+
if (this.displayedCards.length === 0) {
|
|
106
|
+
await this.loadFiltersAndContent()
|
|
107
|
+
}
|
|
107
108
|
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
hasMorePages.value = false
|
|
128
|
-
displayedCards.value = []
|
|
129
|
-
bundleCache.value = {}
|
|
130
|
-
}
|
|
131
|
-
async function fetchCards(currentDisplayedCards, allCards, addMoreBy, bundles) {
|
|
132
|
-
const shouldMakeNewFetchCall =
|
|
133
|
-
currentDisplayedCards.length + addMoreBy > allCards.cards.length
|
|
134
|
-
if (shouldMakeNewFetchCall) {
|
|
135
|
-
const cardBundles = await Promise.all(
|
|
136
|
-
bundles.map((bundle, index) => getBundle(bundle, addMoreBy, index)),
|
|
137
|
-
)
|
|
138
|
-
allCards = getShuffledCards(cardBundles)
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
props.type === 'paragraph--cards_group_latest' ||
|
|
142
|
-
props.type === 'paragraph--browse_content'
|
|
143
|
-
) {
|
|
144
|
-
allCards.cards = sortByDate(allCards.cards)
|
|
109
|
+
// TODO useAsyncData <script setup>
|
|
110
|
+
// async fetch() {
|
|
111
|
+
// if (this.displayedCards.length === 0) {
|
|
112
|
+
// await this.loadFiltersAndContent()
|
|
113
|
+
// }
|
|
114
|
+
// },
|
|
115
|
+
data() {
|
|
116
|
+
return {
|
|
117
|
+
hasMorePages: false,
|
|
118
|
+
displayedCards: [],
|
|
119
|
+
loading: true,
|
|
120
|
+
bundleCache: {},
|
|
121
|
+
displayLimit: 0,
|
|
122
|
+
allCards: undefined,
|
|
123
|
+
filters: {
|
|
124
|
+
taxonomies: [],
|
|
125
|
+
selected: {},
|
|
126
|
+
availableBundles: [],
|
|
127
|
+
},
|
|
145
128
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
129
|
+
},
|
|
130
|
+
fetchKey: 'ws-browscontent',
|
|
131
|
+
methods: {
|
|
132
|
+
async loadFiltersAndContent() {
|
|
133
|
+
await Promise.all([
|
|
134
|
+
this.fetchFilters ? this.loadFilters() : Promise.resolve(),
|
|
135
|
+
this.loadMoreCards(true),
|
|
136
|
+
])
|
|
137
|
+
},
|
|
138
|
+
init() {
|
|
139
|
+
this.allCards = {
|
|
140
|
+
total: 0,
|
|
141
|
+
cards: [],
|
|
142
|
+
}
|
|
143
|
+
this.displayLimit = 0
|
|
144
|
+
this.hasMorePages = false
|
|
145
|
+
this.displayedCards = []
|
|
146
|
+
this.bundleCache = {}
|
|
147
|
+
},
|
|
148
|
+
async fetchCards(currentDisplayedCards, allCards, addMoreBy, bundles) {
|
|
149
|
+
const shouldMakeNewFetchCall =
|
|
150
|
+
currentDisplayedCards.length + addMoreBy > allCards.cards.length
|
|
151
|
+
if (shouldMakeNewFetchCall) {
|
|
152
|
+
const cardBundles = await Promise.all(
|
|
153
|
+
bundles.map((bundle, index) =>
|
|
154
|
+
this.getBundle(bundle, addMoreBy, index),
|
|
155
|
+
),
|
|
156
|
+
)
|
|
157
|
+
allCards = this.getShuffledCards(cardBundles)
|
|
149
158
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
initial()
|
|
159
|
-
}
|
|
160
|
-
loading.value = true
|
|
161
|
-
const addMoreBy = props.initialDisplyLimit
|
|
162
|
-
displayLimit.value += addMoreBy
|
|
163
|
-
const bundles =
|
|
164
|
-
filters.value.availableBundles.length > 0
|
|
165
|
-
? filters.value.availableBundles
|
|
166
|
-
: props.bundle
|
|
167
|
-
allCards.value = await fetchCards(
|
|
168
|
-
displayedCards.value,
|
|
169
|
-
allCards.value,
|
|
170
|
-
addMoreBy,
|
|
171
|
-
bundles,
|
|
172
|
-
)
|
|
173
|
-
hasMorePages.value = allCards.value.total > allCards.value.cards.length
|
|
174
|
-
displayedCards.value = allCards.value.cards.slice(0, displayLimit.value)
|
|
175
|
-
loading.value = false
|
|
176
|
-
}
|
|
177
|
-
async function getBundle(bundle, addMoreBy, index) {
|
|
178
|
-
let start
|
|
179
|
-
const rows = addMoreBy
|
|
180
|
-
const cache = (bundleCache.value[bundle] = bundleCache.value[bundle] || {
|
|
181
|
-
response: {
|
|
182
|
-
results: [],
|
|
183
|
-
numFound: 0,
|
|
159
|
+
if (
|
|
160
|
+
this.type === 'paragraph--cards_group_latest' ||
|
|
161
|
+
this.type === 'paragraph--browse_content'
|
|
162
|
+
) {
|
|
163
|
+
allCards.cards = this.sortByDate(allCards.cards)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return allCards
|
|
184
167
|
},
|
|
185
|
-
|
|
186
|
-
|
|
168
|
+
async loadMoreCards(init) {
|
|
169
|
+
const attrs = {
|
|
170
|
+
group: this.$pageStore?.content?.title,
|
|
171
|
+
}
|
|
172
|
+
if (this.$gtm && !init) {
|
|
173
|
+
this.$gtm.push({ event: 'custom.interaction.showmore.click', ...attrs })
|
|
174
|
+
}
|
|
175
|
+
if (init) {
|
|
176
|
+
this.init()
|
|
177
|
+
}
|
|
178
|
+
this.loading = true
|
|
179
|
+
const addMoreBy = this.initialDisplyLimit
|
|
180
|
+
this.displayLimit += addMoreBy
|
|
181
|
+
const bundles =
|
|
182
|
+
this.filters.availableBundles.length > 0
|
|
183
|
+
? this.filters.availableBundles
|
|
184
|
+
: this.bundle
|
|
185
|
+
this.allCards = await this.fetchCards(
|
|
186
|
+
this.displayedCards,
|
|
187
|
+
this.allCards,
|
|
188
|
+
addMoreBy,
|
|
189
|
+
bundles,
|
|
190
|
+
)
|
|
191
|
+
this.hasMorePages = this.allCards.total > this.allCards.cards.length
|
|
192
|
+
this.displayedCards = this.allCards.cards.slice(0, this.displayLimit)
|
|
193
|
+
this.loading = false
|
|
187
194
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
let response = await props.fetchContent(qs, filters.value.selected)
|
|
202
|
-
cache.qs.start = qs.start
|
|
203
|
-
cache.response.numFound = response.numFound
|
|
204
|
-
cache.response.results.push(...response.results)
|
|
205
|
-
return cache.response
|
|
206
|
-
}
|
|
207
|
-
function getShuffledCards(cardBundles) {
|
|
208
|
-
const shuffled = []
|
|
209
|
-
const bundleWithMostCards = cardBundles.reduce(
|
|
210
|
-
(a, b) => (a.results.length > b.results.length ? a : b),
|
|
211
|
-
{ results: [] },
|
|
212
|
-
).results.length
|
|
195
|
+
getBundle(bundle, addMoreBy, index) {
|
|
196
|
+
let start
|
|
197
|
+
const rows = addMoreBy
|
|
198
|
+
const cache = (this.bundleCache[bundle] = this.bundleCache[bundle] || {
|
|
199
|
+
response: {
|
|
200
|
+
results: [],
|
|
201
|
+
numFound: 0,
|
|
202
|
+
},
|
|
203
|
+
qs: {
|
|
204
|
+
start,
|
|
205
|
+
},
|
|
206
|
+
})
|
|
213
207
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if (
|
|
217
|
-
|
|
208
|
+
if (cache.qs.start === undefined) {
|
|
209
|
+
start = 0
|
|
210
|
+
} else if (cache.response.numFound > cache.response.results.length) {
|
|
211
|
+
start = cache.response.results.length
|
|
212
|
+
} else {
|
|
213
|
+
return Promise.resolve(cache.response)
|
|
218
214
|
}
|
|
219
|
-
})
|
|
220
|
-
}
|
|
221
215
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
216
|
+
const qs = {
|
|
217
|
+
bundle,
|
|
218
|
+
rows,
|
|
219
|
+
start,
|
|
220
|
+
}
|
|
221
|
+
return this.fetchContent(qs, this.filters.selected, index).then(
|
|
222
|
+
(response) => {
|
|
223
|
+
cache.qs.start = qs.start
|
|
224
|
+
cache.response.numFound = response.numFound
|
|
225
|
+
cache.response.results.push(...response.results)
|
|
226
|
+
return cache.response
|
|
227
|
+
},
|
|
228
|
+
)
|
|
229
|
+
},
|
|
230
|
+
getShuffledCards(cardBundles) {
|
|
231
|
+
const shuffled = []
|
|
232
|
+
const bundleWithMostCards = cardBundles.reduce(
|
|
233
|
+
(a, b) => (a.results.length > b.results.length ? a : b),
|
|
234
|
+
{ results: [] },
|
|
235
|
+
).results.length
|
|
236
|
+
|
|
237
|
+
for (let i = 0; i < bundleWithMostCards; i++) {
|
|
238
|
+
cardBundles.forEach((bundle) => {
|
|
239
|
+
if (bundle.results[i]) {
|
|
240
|
+
shuffled.push(bundle.results[i])
|
|
241
|
+
}
|
|
242
|
+
})
|
|
243
|
+
}
|
|
225
244
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return props.fetchFilters().then((taxonomies) => {
|
|
230
|
-
filters.value.taxonomies = taxonomies
|
|
245
|
+
const total = cardBundles.reduce((acc, bundle) => {
|
|
246
|
+
return acc + bundle.numFound
|
|
247
|
+
}, 0)
|
|
231
248
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
249
|
+
return { cards: shuffled, total }
|
|
250
|
+
},
|
|
251
|
+
loadFilters() {
|
|
252
|
+
return this.fetchFilters().then((taxonomies) => {
|
|
253
|
+
this.filters.taxonomies = taxonomies
|
|
254
|
+
return Promise.resolve(taxonomies)
|
|
255
|
+
})
|
|
256
|
+
},
|
|
257
|
+
onFilter(filters) {
|
|
258
|
+
this.bundleCache = {}
|
|
259
|
+
Object.keys(filters).forEach((filter) => {
|
|
260
|
+
this.filters.selected[filter] = filters[filter].map((obj) => obj.tid)
|
|
261
|
+
})
|
|
262
|
+
this.loadMoreCards(true)
|
|
263
|
+
},
|
|
264
|
+
onSwitcher(switchToBundle) {
|
|
265
|
+
this.filters.selected = {}
|
|
266
|
+
this.filters.availableBundles.length = 0
|
|
267
|
+
if (switchToBundle) {
|
|
268
|
+
this.filters.availableBundles.push(switchToBundle)
|
|
269
|
+
}
|
|
270
|
+
this.loadMoreCards(true)
|
|
271
|
+
},
|
|
272
|
+
async reset() {
|
|
273
|
+
this.bundleCache = {}
|
|
274
|
+
this.filters.selected = {}
|
|
275
|
+
this.filters.availableBundles.length = 0
|
|
276
|
+
await this.loadMoreCards(true)
|
|
277
|
+
},
|
|
278
|
+
sortByDate(cards) {
|
|
279
|
+
const sorted = cards.sort((a, b) => {
|
|
280
|
+
return new Date(b.dateSort) - new Date(a.dateSort)
|
|
281
|
+
})
|
|
282
|
+
return sorted
|
|
283
|
+
},
|
|
284
|
+
},
|
|
261
285
|
}
|
|
262
286
|
</script>
|
|
263
287
|
<style lang="scss" scoped>
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<card-group
|
|
3
|
+
:title="title"
|
|
4
|
+
:title-tag="titleTag"
|
|
5
|
+
:background="background"
|
|
6
|
+
:cards="displayedCards"
|
|
7
|
+
:loading="loading"
|
|
8
|
+
:columns="columns"
|
|
9
|
+
:show-load-more="showMore && hasMorePages"
|
|
10
|
+
:class="`wcl-browse-content card_group__card--col-${columns}`"
|
|
11
|
+
:card-browse-content="true"
|
|
12
|
+
@loadMore="() => loadMoreCards(false)"
|
|
13
|
+
>
|
|
14
|
+
<template
|
|
15
|
+
v-if="enableBundleFilter && bundle.length > 1"
|
|
16
|
+
v-slot:cardGroupFilter
|
|
17
|
+
>
|
|
18
|
+
<switcher
|
|
19
|
+
v-if="enableBundleFilter"
|
|
20
|
+
:options="bundle"
|
|
21
|
+
class="wcl-browse-content__switcher"
|
|
22
|
+
:get-option-alias="getBundleAlias"
|
|
23
|
+
@switched="onSwitcher"
|
|
24
|
+
@reset="onSwitcher"
|
|
25
|
+
/>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<template v-if="filters.taxonomies.length > 0" v-slot:cardGroupPreContent>
|
|
29
|
+
<directory-filters
|
|
30
|
+
class="wcl-browse-content__filter"
|
|
31
|
+
:filters="filters"
|
|
32
|
+
:results="allCards.total"
|
|
33
|
+
:is-filtering="loading"
|
|
34
|
+
@onFilter="onFilter"
|
|
35
|
+
@onReset="reset"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
</card-group>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script setup>
|
|
42
|
+
import CardGroup from '../../SubComponents/CardGroup/index.vue'
|
|
43
|
+
import DirectoryFilters from '../../Global/DirectoryFilters/index.vue'
|
|
44
|
+
import Switcher from './switcher.vue'
|
|
45
|
+
|
|
46
|
+
const nuxtApp = useNuxtApp()
|
|
47
|
+
|
|
48
|
+
const hasMorePages = ref(false)
|
|
49
|
+
const displayedCards = ref([])
|
|
50
|
+
const loading = ref(true)
|
|
51
|
+
const bundleCache = ref({})
|
|
52
|
+
const displayLimit = ref(0)
|
|
53
|
+
const allCards = ref(undefined)
|
|
54
|
+
const filters = ref({
|
|
55
|
+
taxonomies: [],
|
|
56
|
+
selected: {},
|
|
57
|
+
availableBundles: [],
|
|
58
|
+
})
|
|
59
|
+
const props = defineProps({
|
|
60
|
+
background: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: 'grey',
|
|
63
|
+
},
|
|
64
|
+
title: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: '',
|
|
67
|
+
},
|
|
68
|
+
titleTag: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'h2',
|
|
71
|
+
},
|
|
72
|
+
bundle: {
|
|
73
|
+
type: Array,
|
|
74
|
+
default: () => [''],
|
|
75
|
+
},
|
|
76
|
+
columns: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: 0,
|
|
79
|
+
},
|
|
80
|
+
initialDisplyLimit: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: 0,
|
|
83
|
+
},
|
|
84
|
+
fetchContent: {
|
|
85
|
+
type: Function,
|
|
86
|
+
required: true,
|
|
87
|
+
},
|
|
88
|
+
fetchFilters: {
|
|
89
|
+
type: Function,
|
|
90
|
+
required: false,
|
|
91
|
+
default: null,
|
|
92
|
+
},
|
|
93
|
+
enableBundleFilter: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
},
|
|
96
|
+
getBundleAlias: {
|
|
97
|
+
type: Function,
|
|
98
|
+
required: false,
|
|
99
|
+
default: null,
|
|
100
|
+
},
|
|
101
|
+
showMore: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
},
|
|
104
|
+
type: {
|
|
105
|
+
type: String,
|
|
106
|
+
required: true,
|
|
107
|
+
},
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
await useAsyncData('fetchData', async () => {
|
|
111
|
+
try {
|
|
112
|
+
await Promise.all([
|
|
113
|
+
props.fetchFilters ? loadFilters() : Promise.resolve(),
|
|
114
|
+
loadMoreCards(true),
|
|
115
|
+
])
|
|
116
|
+
} catch (err) {
|
|
117
|
+
console.log('🚀 ~ err:', err)
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
function initial() {
|
|
122
|
+
allCards.value = {
|
|
123
|
+
total: 0,
|
|
124
|
+
cards: [],
|
|
125
|
+
}
|
|
126
|
+
displayLimit.value = 0
|
|
127
|
+
hasMorePages.value = false
|
|
128
|
+
displayedCards.value = []
|
|
129
|
+
bundleCache.value = {}
|
|
130
|
+
}
|
|
131
|
+
async function fetchCards(currentDisplayedCards, allCards, addMoreBy, bundles) {
|
|
132
|
+
const shouldMakeNewFetchCall =
|
|
133
|
+
currentDisplayedCards.length + addMoreBy > allCards.cards.length
|
|
134
|
+
if (shouldMakeNewFetchCall) {
|
|
135
|
+
const cardBundles = await Promise.all(
|
|
136
|
+
bundles.map((bundle, index) => getBundle(bundle, addMoreBy, index)),
|
|
137
|
+
)
|
|
138
|
+
allCards = getShuffledCards(cardBundles)
|
|
139
|
+
|
|
140
|
+
if (
|
|
141
|
+
props.type === 'paragraph--cards_group_latest' ||
|
|
142
|
+
props.type === 'paragraph--browse_content'
|
|
143
|
+
) {
|
|
144
|
+
allCards.cards = sortByDate(allCards.cards)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return allCards
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async function loadMoreCards(init) {
|
|
151
|
+
const attrs = {
|
|
152
|
+
group: nuxtApp.$pageStore?.content?.title,
|
|
153
|
+
}
|
|
154
|
+
if (nuxtApp.$gtm && !init) {
|
|
155
|
+
nuxtApp.$gtm.push({ event: 'custom.interaction.showmore.click', ...attrs })
|
|
156
|
+
}
|
|
157
|
+
if (init) {
|
|
158
|
+
initial()
|
|
159
|
+
}
|
|
160
|
+
loading.value = true
|
|
161
|
+
const addMoreBy = props.initialDisplyLimit
|
|
162
|
+
displayLimit.value += addMoreBy
|
|
163
|
+
const bundles =
|
|
164
|
+
filters.value.availableBundles.length > 0
|
|
165
|
+
? filters.value.availableBundles
|
|
166
|
+
: props.bundle
|
|
167
|
+
allCards.value = await fetchCards(
|
|
168
|
+
displayedCards.value,
|
|
169
|
+
allCards.value,
|
|
170
|
+
addMoreBy,
|
|
171
|
+
bundles,
|
|
172
|
+
)
|
|
173
|
+
hasMorePages.value = allCards.value.total > allCards.value.cards.length
|
|
174
|
+
displayedCards.value = allCards.value.cards.slice(0, displayLimit.value)
|
|
175
|
+
loading.value = false
|
|
176
|
+
}
|
|
177
|
+
async function getBundle(bundle, addMoreBy, index) {
|
|
178
|
+
let start
|
|
179
|
+
const rows = addMoreBy
|
|
180
|
+
const cache = (bundleCache.value[bundle] = bundleCache.value[bundle] || {
|
|
181
|
+
response: {
|
|
182
|
+
results: [],
|
|
183
|
+
numFound: 0,
|
|
184
|
+
},
|
|
185
|
+
qs: {
|
|
186
|
+
start,
|
|
187
|
+
},
|
|
188
|
+
})
|
|
189
|
+
if (cache.qs.start === undefined) {
|
|
190
|
+
start = 0
|
|
191
|
+
} else if (cache.response.numFound > cache.response.results.length) {
|
|
192
|
+
start = cache.response.results.length
|
|
193
|
+
} else {
|
|
194
|
+
return Promise.resolve(cache.response)
|
|
195
|
+
}
|
|
196
|
+
const qs = {
|
|
197
|
+
bundle,
|
|
198
|
+
rows,
|
|
199
|
+
start,
|
|
200
|
+
}
|
|
201
|
+
let response = await props.fetchContent(qs, filters.value.selected)
|
|
202
|
+
cache.qs.start = qs.start
|
|
203
|
+
cache.response.numFound = response.numFound
|
|
204
|
+
cache.response.results.push(...response.results)
|
|
205
|
+
return cache.response
|
|
206
|
+
}
|
|
207
|
+
function getShuffledCards(cardBundles) {
|
|
208
|
+
const shuffled = []
|
|
209
|
+
const bundleWithMostCards = cardBundles.reduce(
|
|
210
|
+
(a, b) => (a.results.length > b.results.length ? a : b),
|
|
211
|
+
{ results: [] },
|
|
212
|
+
).results.length
|
|
213
|
+
|
|
214
|
+
for (let i = 0; i < bundleWithMostCards; i++) {
|
|
215
|
+
cardBundles.forEach((bundle) => {
|
|
216
|
+
if (bundle.results[i]) {
|
|
217
|
+
shuffled.push(bundle.results[i])
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const total = cardBundles.reduce((acc, bundle) => {
|
|
223
|
+
return acc + bundle.numFound
|
|
224
|
+
}, 0)
|
|
225
|
+
|
|
226
|
+
return { cards: shuffled, total }
|
|
227
|
+
}
|
|
228
|
+
function loadFilters() {
|
|
229
|
+
return props.fetchFilters().then((taxonomies) => {
|
|
230
|
+
filters.value.taxonomies = taxonomies
|
|
231
|
+
|
|
232
|
+
return Promise.resolve(taxonomies)
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
const onFilter = (fltrs) => {
|
|
236
|
+
bundleCache.value = {}
|
|
237
|
+
Object.keys(fltrs).forEach((filter) => {
|
|
238
|
+
filters.values.selected[filter] = fltrs[filter].map((obj) => obj.tid)
|
|
239
|
+
})
|
|
240
|
+
loadMoreCards(true)
|
|
241
|
+
}
|
|
242
|
+
const onSwitcher = (switchToBundle) => {
|
|
243
|
+
filters.value.selected = {}
|
|
244
|
+
filters.value.availableBundles.length = 0
|
|
245
|
+
if (switchToBundle) {
|
|
246
|
+
filters.value.availableBundles.push(switchToBundle)
|
|
247
|
+
}
|
|
248
|
+
loadMoreCards(true)
|
|
249
|
+
}
|
|
250
|
+
const reset = async () => {
|
|
251
|
+
bundleCache.value = {}
|
|
252
|
+
filters.value.selected = {}
|
|
253
|
+
filters.value.availableBundles.length = 0
|
|
254
|
+
await loadMoreCards(true)
|
|
255
|
+
}
|
|
256
|
+
function sortByDate(cards) {
|
|
257
|
+
const sorted = cards.sort((a, b) => {
|
|
258
|
+
return new Date(b.dateSort) - new Date(a.dateSort)
|
|
259
|
+
})
|
|
260
|
+
return sorted
|
|
261
|
+
}
|
|
262
|
+
</script>
|
|
263
|
+
<style lang="scss" scoped>
|
|
264
|
+
.wcl-browse-content {
|
|
265
|
+
&__filter {
|
|
266
|
+
align-items: flex-end;
|
|
267
|
+
place-content: flex-end;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
&.card_group__card--col-4 {
|
|
271
|
+
:deep(.card-grid__column .card-grid-item__description) {
|
|
272
|
+
display: none;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
:deep(.card_group__card--blue .card_item__desc p) {
|
|
277
|
+
margin-top: 12px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
:deep(.card_group__card--red .card_item__desc p) {
|
|
281
|
+
margin-top: 12px;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
</style>
|
|
@@ -4,12 +4,19 @@ const cpData =
|
|
|
4
4
|
{
|
|
5
5
|
title: 'Australian Nurses and Midwifery Federation - Victorian Branch',
|
|
6
6
|
fulladdress: 'Level 8/535 Elizabeth St Melbourne VIC 3000',
|
|
7
|
-
workphone: '03
|
|
8
|
-
tollfreephone: '1800
|
|
9
|
-
email: 'ohs@
|
|
7
|
+
workphone: '03 9555 9333',
|
|
8
|
+
tollfreephone: '1800 555 333',
|
|
9
|
+
email: 'ohs@test.com.au',
|
|
10
10
|
website: 'https://www.anmfvic.asn.au/education-and-training/hsr-training/events',
|
|
11
|
+
contact1: 'Christina Groebl',
|
|
12
|
+
phone1: '03 9555 0222',
|
|
13
|
+
email1: 'cgroebl@test.com.au',
|
|
14
|
+
contact2: 'Joey Bradford',
|
|
15
|
+
phone2: '03 9555 0666',
|
|
16
|
+
email2: 'jbradford@test.com.au',
|
|
11
17
|
courses: ['HSR Initial', 'HSR Refresher'],
|
|
12
|
-
|
|
18
|
+
trainingvenues: ['Melbourne CBD', 'All Regional Victoria - HQ in Melbourne'],
|
|
19
|
+
id: '1'
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="paragraph--directory__records--hscp">
|
|
3
3
|
<container>
|
|
4
|
+
<!-- Main details -->
|
|
4
5
|
<row>
|
|
5
6
|
<column class="title">
|
|
6
|
-
|
|
7
|
+
<a href="javascript:void(0)" @click="this.visible = !this.visible">
|
|
7
8
|
{{ item.title }}
|
|
8
|
-
|
|
9
|
+
</a>
|
|
9
10
|
</column>
|
|
10
11
|
<column class="address">
|
|
11
12
|
<a target="_blank" :href="gMapLink">
|
|
@@ -13,25 +14,120 @@
|
|
|
13
14
|
</a>
|
|
14
15
|
</column>
|
|
15
16
|
<column class="contact">
|
|
16
|
-
<div class="
|
|
17
|
+
<div class="label">Email</div>
|
|
17
18
|
<a target="_blank" :href="`mailto:${item.email}`"><span class="sr-only visually-hidden">Email address</span>
|
|
18
19
|
{{ item.email }}
|
|
19
20
|
</a>
|
|
20
21
|
</column>
|
|
21
22
|
<column class="contact">
|
|
22
|
-
<div class="
|
|
23
|
+
<div class="label">Website</div>
|
|
23
24
|
<a target="_blank" :href="`${item.website}`"><span class="sr-only visually-hidden">Website address</span>
|
|
24
25
|
{{ item.website }}
|
|
25
26
|
</a>
|
|
26
27
|
</column>
|
|
27
28
|
<column class="contact">
|
|
28
|
-
<div class="
|
|
29
|
+
<div class="label">Phone</div>
|
|
29
30
|
<a :href="`tel:${item.tollfreephone || item.workphone}`"><span class="sr-only visually-hidden">Phone number</span>
|
|
30
31
|
{{ item.tollfreephone || item.workphone }}
|
|
31
|
-
</a
|
|
32
|
-
>
|
|
32
|
+
</a>
|
|
33
|
+
</column>
|
|
34
|
+
<column class="hscp-caret" sm="1">
|
|
35
|
+
<a v-if="visible" href="javascript:void(0)" @click="this.visible = false">
|
|
36
|
+
<img
|
|
37
|
+
style="float: right;"
|
|
38
|
+
:src="CaretUp"
|
|
39
|
+
height="12"
|
|
40
|
+
width="17"
|
|
41
|
+
alt="Expand Detail">
|
|
42
|
+
</a>
|
|
43
|
+
<a v-if="!visible" href="javascript:void(0)" @click="this.visible = true">
|
|
44
|
+
<img
|
|
45
|
+
style="float: right;"
|
|
46
|
+
:src="CaretDown"
|
|
47
|
+
height="12"
|
|
48
|
+
width="17"
|
|
49
|
+
alt="Expand Detail">
|
|
50
|
+
</a>
|
|
33
51
|
</column>
|
|
34
52
|
</row>
|
|
53
|
+
<!-- Additional Content -->
|
|
54
|
+
<template v-if="this.visible">
|
|
55
|
+
<row class="row-hscp-additional">
|
|
56
|
+
<column>
|
|
57
|
+
<h4>Contact Information</h4>
|
|
58
|
+
</column>
|
|
59
|
+
</row>
|
|
60
|
+
<row>
|
|
61
|
+
<column sm="3" class="label">
|
|
62
|
+
Contact
|
|
63
|
+
</column>
|
|
64
|
+
<column sm="3">
|
|
65
|
+
{{item.contact1}}
|
|
66
|
+
</column>
|
|
67
|
+
<column sm="3" class="label">
|
|
68
|
+
Contact
|
|
69
|
+
</column>
|
|
70
|
+
<column sm="3">
|
|
71
|
+
{{item.contact2}}
|
|
72
|
+
</column>
|
|
73
|
+
</row>
|
|
74
|
+
<row>
|
|
75
|
+
<column sm="3" class="label">
|
|
76
|
+
Phone
|
|
77
|
+
</column>
|
|
78
|
+
<column sm="3">
|
|
79
|
+
{{item.phone1}}
|
|
80
|
+
</column>
|
|
81
|
+
<column sm="3" class="label">
|
|
82
|
+
Phone
|
|
83
|
+
</column>
|
|
84
|
+
<column sm="3">
|
|
85
|
+
{{item.phone2}}
|
|
86
|
+
</column>
|
|
87
|
+
</row>
|
|
88
|
+
<row>
|
|
89
|
+
<column sm="3" class="label">
|
|
90
|
+
Email
|
|
91
|
+
</column>
|
|
92
|
+
<column sm="3">
|
|
93
|
+
{{item.email1}}
|
|
94
|
+
</column>
|
|
95
|
+
<column sm="3" class="label">
|
|
96
|
+
Email
|
|
97
|
+
</column>
|
|
98
|
+
<column sm="3">
|
|
99
|
+
{{item.email2}}
|
|
100
|
+
</column>
|
|
101
|
+
</row>
|
|
102
|
+
<row class="row-hscp-additional">
|
|
103
|
+
<column>
|
|
104
|
+
<h4>Training Venue Locations</h4>
|
|
105
|
+
</column>
|
|
106
|
+
</row>
|
|
107
|
+
<row>
|
|
108
|
+
<column>
|
|
109
|
+
<ul>
|
|
110
|
+
<li v-for="(venue) in item.trainingvenues" :key="venue.id">
|
|
111
|
+
{{venue}}
|
|
112
|
+
</li>
|
|
113
|
+
</ul>
|
|
114
|
+
</column>
|
|
115
|
+
</row>
|
|
116
|
+
<row class="row-hscp-additional">
|
|
117
|
+
<column>
|
|
118
|
+
<h4>Training Courses</h4>
|
|
119
|
+
</column>
|
|
120
|
+
</row>
|
|
121
|
+
<row>
|
|
122
|
+
<column>
|
|
123
|
+
<ul>
|
|
124
|
+
<li v-for="(course) in item.courses" :key="course.id">
|
|
125
|
+
{{course}}
|
|
126
|
+
</li>
|
|
127
|
+
</ul>
|
|
128
|
+
</column>
|
|
129
|
+
</row>
|
|
130
|
+
</template>
|
|
35
131
|
</container>
|
|
36
132
|
</div>
|
|
37
133
|
</template>
|
|
@@ -39,6 +135,8 @@
|
|
|
39
135
|
import Container from '../../../../Containers/Container/index.vue'
|
|
40
136
|
import Row from '../../../../Containers/Row/index.vue'
|
|
41
137
|
import Column from '../../../../Containers/Column/index.vue'
|
|
138
|
+
import CaretUp from './../../../../../assets/icons/caret-up.svg?url'
|
|
139
|
+
import CaretDown from './../../../../../assets/icons/caret-down.svg?url'
|
|
42
140
|
|
|
43
141
|
export default {
|
|
44
142
|
components: {
|
|
@@ -56,21 +154,43 @@ export default {
|
|
|
56
154
|
default: false
|
|
57
155
|
}
|
|
58
156
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return `https://www1.worksafe.vic.gov.au/vwa/serviceproviderdirec.nsf/pages/${this.item.companyid}`
|
|
66
|
-
} */
|
|
157
|
+
data() {
|
|
158
|
+
return {
|
|
159
|
+
visible: false,
|
|
160
|
+
CaretUp,
|
|
161
|
+
CaretDown,
|
|
162
|
+
}
|
|
67
163
|
},
|
|
164
|
+
methods: {
|
|
165
|
+
handleClick(title) {
|
|
166
|
+
this.visible = !this.visible
|
|
167
|
+
if (this.$gtm) {
|
|
168
|
+
if (this.visible) {
|
|
169
|
+
this.$gtm.push({ event: 'custom.search.prs.open', title })
|
|
170
|
+
} else {
|
|
171
|
+
this.$gtm.push({
|
|
172
|
+
event: 'custom.search.prs.close',
|
|
173
|
+
title
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
68
179
|
}
|
|
69
180
|
</script>
|
|
70
181
|
|
|
71
182
|
<style lang="scss" scoped>
|
|
72
183
|
@import '../styles.scss';
|
|
73
184
|
|
|
185
|
+
.row-hscp-additional {
|
|
186
|
+
margin-top: 20px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.hscp-caret {
|
|
190
|
+
justify-content: end;
|
|
191
|
+
align-content: end;
|
|
192
|
+
border-radius: 0px;
|
|
193
|
+
}
|
|
74
194
|
.paragraph--directory__records--hscp {
|
|
75
195
|
|
|
76
196
|
a {
|
|
@@ -107,7 +227,7 @@ export default {
|
|
|
107
227
|
color: inherit;
|
|
108
228
|
}
|
|
109
229
|
}
|
|
110
|
-
.
|
|
230
|
+
.label {
|
|
111
231
|
font-size: 15px;
|
|
112
232
|
font-weight: bold;
|
|
113
233
|
}
|
|
@@ -18,7 +18,7 @@ export class FileFormElement extends BaseFormElement {
|
|
|
18
18
|
const blob = new Blob([byteArray], { type: 'text/plain' })
|
|
19
19
|
|
|
20
20
|
return axios.post(
|
|
21
|
-
`https://content-dev-v2.api.worksafe.vic.gov.au/webform_rest/${this.webformElement['#webform']}/upload
|
|
21
|
+
`https://content-dev-v2.api.worksafe.vic.gov.au/webform_rest/${this.webformElement['#webform']}/upload/${this.webformElement['#webform_key']}`,
|
|
22
22
|
blob,
|
|
23
23
|
{
|
|
24
24
|
headers: {
|
|
@@ -43,8 +43,6 @@ export class FileFormElement extends BaseFormElement {
|
|
|
43
43
|
value: '',
|
|
44
44
|
},
|
|
45
45
|
],
|
|
46
|
-
key: 'file',
|
|
47
|
-
type: 'file',
|
|
48
46
|
input: true,
|
|
49
47
|
fileKey: `files[${this.webformElement['#name']}]`,
|
|
50
48
|
}
|
package/src/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import RichText from './components/Paragraphs/RichText/index.vue'
|
|
|
25
25
|
import TextMedia from './components/Paragraphs/TextMedia/index.vue'
|
|
26
26
|
import Accordion from './components/Paragraphs/Accordion/index.vue'
|
|
27
27
|
import TabbedCards from './components/Paragraphs/TabbedCards/index.vue'
|
|
28
|
-
|
|
28
|
+
import BrowseContent from './components/Paragraphs/BrowseContent/index.vue'
|
|
29
29
|
import TaskFinder from './components/Paragraphs/TaskFinder/index.vue'
|
|
30
30
|
import ListGroup from './components/Paragraphs/ListGroup/index.vue'
|
|
31
31
|
import ScrollSpy from './components/Paragraphs/ScrollSpy/index.vue'
|
|
@@ -56,6 +56,9 @@ import Search from './components/SubComponents/Search/index.vue'
|
|
|
56
56
|
import VideoThumbnail from './components/SubComponents/VideoThumbnail/index.vue'
|
|
57
57
|
import ResourceGroup from './components/SubComponents/ResourceGroup/index.vue'
|
|
58
58
|
|
|
59
|
+
// Temp Components for testing
|
|
60
|
+
import BrowseContent2 from './components/Paragraphs/BrowseContent/setup.vue'
|
|
61
|
+
|
|
59
62
|
// Export Global Components
|
|
60
63
|
export {
|
|
61
64
|
Container,
|
|
@@ -89,7 +92,7 @@ export {
|
|
|
89
92
|
TextMedia,
|
|
90
93
|
Accordion,
|
|
91
94
|
TabbedCards,
|
|
92
|
-
|
|
95
|
+
BrowseContent,
|
|
93
96
|
ListGroup,
|
|
94
97
|
ScrollSpy,
|
|
95
98
|
Directory,
|
|
@@ -128,3 +131,6 @@ export {
|
|
|
128
131
|
DirectoryFilters,
|
|
129
132
|
Switcher,
|
|
130
133
|
}
|
|
134
|
+
|
|
135
|
+
// Temp Components for testing
|
|
136
|
+
export { BrowseContent2 }
|