@asd20/ui 3.2.976 → 3.2.978
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/atoms/Asd20Icon/index.stories.js +1 -2
- package/src/components/organisms/Asd20AccessibilityIssueModal/index.stories.js +20 -0
- package/src/components/organisms/Asd20AccessibilityIssueModal/index.vue +211 -0
- package/src/components/organisms/Asd20PageContent/index.vue +1 -0
- package/src/components/templates/Asd20SalaryCalculatorTemplate/index.vue +225 -225
- package/src/components/templates/Asd20WayfindingAccessibilityTemplate/index.stories.js +68 -0
- package/src/components/templates/Asd20WayfindingAccessibilityTemplate/index.vue +337 -0
- package/src/data/page-queries/landing-page-query-result.json +1 -1
- package/src/helpers/sendAccessibilityIssue.js +47 -0
- /package/src/components/atoms/icons/{Asd20AccessiblitySvg.vue → Asd20AccessibilitySvg.vue} +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { storiesOf } from '@storybook/vue'
|
|
2
|
+
import Asd20AccessibilityIssueModal from '.'
|
|
3
|
+
|
|
4
|
+
const info = {
|
|
5
|
+
summary: 'Asd20AccessibilityIssueModal',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const wrapper = {
|
|
9
|
+
components: { Asd20AccessibilityIssueModal },
|
|
10
|
+
data: () => ({}),
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
storiesOf('Organisms - Asd20AccessibilityIssueModal', module).add(
|
|
14
|
+
'Default',
|
|
15
|
+
() => ({
|
|
16
|
+
...wrapper,
|
|
17
|
+
template: `<Asd20AccessibilityIssueModal :open="true" recipient-id="14776"></Asd20AccessibilityIssueModal>`,
|
|
18
|
+
}),
|
|
19
|
+
{ info }
|
|
20
|
+
)
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<asd20-modal
|
|
3
|
+
:open="open"
|
|
4
|
+
title="Report an Accessibility Issue"
|
|
5
|
+
icon="accessibility"
|
|
6
|
+
dismissable
|
|
7
|
+
windowed
|
|
8
|
+
class="asd20-accessibility-issue-modal"
|
|
9
|
+
@dismiss="$emit('dismiss')"
|
|
10
|
+
>
|
|
11
|
+
<Asd20Viewport scrollable>
|
|
12
|
+
<div v-if="submissionSuccess" class="submission-success">
|
|
13
|
+
<p style="text-align: center; font-weight: bold; font-size: 1.1rem;">
|
|
14
|
+
Thank you! Your issue has been submitted.
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<template v-else>
|
|
19
|
+
<asd20-text-input
|
|
20
|
+
id="firstName"
|
|
21
|
+
label="First Name"
|
|
22
|
+
required
|
|
23
|
+
v-model="form.firstName"
|
|
24
|
+
@validated="validationErrors.firstName = $event"
|
|
25
|
+
/>
|
|
26
|
+
<asd20-text-input
|
|
27
|
+
id="lastName"
|
|
28
|
+
label="Last Name"
|
|
29
|
+
required
|
|
30
|
+
v-model="form.lastName"
|
|
31
|
+
@validated="validationErrors.lastName = $event"
|
|
32
|
+
/>
|
|
33
|
+
<asd20-text-input
|
|
34
|
+
id="email"
|
|
35
|
+
label="Email Address"
|
|
36
|
+
type="email"
|
|
37
|
+
required
|
|
38
|
+
:validator="validateEmailAddress"
|
|
39
|
+
v-model="form.email"
|
|
40
|
+
@validated="validationErrors.email = $event"
|
|
41
|
+
/>
|
|
42
|
+
<asd20-text-input
|
|
43
|
+
id="phone"
|
|
44
|
+
label="Phone Number"
|
|
45
|
+
v-model="form.phone"
|
|
46
|
+
/>
|
|
47
|
+
<asd20-text-input
|
|
48
|
+
id="address"
|
|
49
|
+
label="Mailing Address"
|
|
50
|
+
v-model="form.address"
|
|
51
|
+
/>
|
|
52
|
+
<asd20-text-input
|
|
53
|
+
id="organization"
|
|
54
|
+
label="Organization"
|
|
55
|
+
v-model="form.organization"
|
|
56
|
+
/>
|
|
57
|
+
<asd20-text-area-input
|
|
58
|
+
id="issue"
|
|
59
|
+
label="Describe the Issue"
|
|
60
|
+
help-text="<ul style='margin: 0 0 0.5rem 1rem; font-size: 0.75rem !important;'>
|
|
61
|
+
<li>Please specify the exact URL, program, service, or digital asset you had a problem with.</li>
|
|
62
|
+
<li>Please provide as much detail as possible, including the nature of the accessibility barrier, the date and time it occurred, any assistive technology you were using, or the nature of the program or service being denied.</li>
|
|
63
|
+
<li>Please describe what you believe should be done to resolve the issue.</li>
|
|
64
|
+
</ul>"
|
|
65
|
+
required
|
|
66
|
+
v-model="form.issue"
|
|
67
|
+
@validated="validationErrors.issue = $event"
|
|
68
|
+
/>
|
|
69
|
+
<asd20-button
|
|
70
|
+
label="Submit Issue"
|
|
71
|
+
:disabled="!isValid || sending"
|
|
72
|
+
@click="sendAccessibilityIssue"
|
|
73
|
+
horizontal
|
|
74
|
+
centered
|
|
75
|
+
bordered
|
|
76
|
+
/>
|
|
77
|
+
<!-- <vue-recaptcha
|
|
78
|
+
sitekey="6LfidKoUAAAAAFqr3QEbia3jIkecsZyxBYlMvWrX"
|
|
79
|
+
:loadRecaptchaScript="true"
|
|
80
|
+
size="invisible"
|
|
81
|
+
@verify="captchaVerified"
|
|
82
|
+
>
|
|
83
|
+
<asd20-button
|
|
84
|
+
v-show="isValid && !sending"
|
|
85
|
+
label="Submit Issue"
|
|
86
|
+
horizontal
|
|
87
|
+
/>
|
|
88
|
+
</vue-recaptcha> -->
|
|
89
|
+
<asd20-spinner size="sm" v-if="sending" />
|
|
90
|
+
</template>
|
|
91
|
+
</Asd20Viewport>
|
|
92
|
+
</asd20-modal>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<script>
|
|
96
|
+
import Asd20Modal from '../../molecules/Asd20Modal'
|
|
97
|
+
import Asd20TextInput from '../../molecules/Asd20TextInput'
|
|
98
|
+
import Asd20TextAreaInput from '../../molecules/Asd20TextAreaInput'
|
|
99
|
+
import Asd20Viewport from '../../atoms/Asd20Viewport'
|
|
100
|
+
import Asd20Spinner from '../../atoms/Asd20Spinner'
|
|
101
|
+
import VueRecaptcha from 'vue-recaptcha'
|
|
102
|
+
import Asd20Button from '../../atoms/Asd20Button'
|
|
103
|
+
|
|
104
|
+
// import sendAccessibilityIssue from '../../../helpers/sendAccessibilityIssue.js'
|
|
105
|
+
|
|
106
|
+
export default {
|
|
107
|
+
name: 'Asd20AccessibilityIssueModal',
|
|
108
|
+
components: {
|
|
109
|
+
Asd20Modal,
|
|
110
|
+
Asd20TextInput,
|
|
111
|
+
Asd20TextAreaInput,
|
|
112
|
+
Asd20Viewport,
|
|
113
|
+
Asd20Spinner,
|
|
114
|
+
VueRecaptcha,
|
|
115
|
+
Asd20Button,
|
|
116
|
+
},
|
|
117
|
+
props: {
|
|
118
|
+
open: { type: Boolean, default: false },
|
|
119
|
+
},
|
|
120
|
+
data() {
|
|
121
|
+
return {
|
|
122
|
+
sending: false,
|
|
123
|
+
submissionSuccess: false,
|
|
124
|
+
form: {
|
|
125
|
+
firstName: '',
|
|
126
|
+
lastName: '',
|
|
127
|
+
email: '',
|
|
128
|
+
phone: '',
|
|
129
|
+
address: '',
|
|
130
|
+
organization: '',
|
|
131
|
+
issue: '',
|
|
132
|
+
},
|
|
133
|
+
validationErrors: {
|
|
134
|
+
firstName: [],
|
|
135
|
+
lastName: [],
|
|
136
|
+
email: [],
|
|
137
|
+
issue: [],
|
|
138
|
+
},
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
computed: {
|
|
142
|
+
isValid() {
|
|
143
|
+
return Object.values(this.validationErrors).every(e => e.length === 0)
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
methods: {
|
|
147
|
+
validateEmailAddress({ value, validationErrors }) {
|
|
148
|
+
const pattern = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
|
|
149
|
+
if (!pattern.test(value)) {
|
|
150
|
+
validationErrors.push('A valid email address is required')
|
|
151
|
+
}
|
|
152
|
+
return validationErrors
|
|
153
|
+
},
|
|
154
|
+
captchaVerified(token) {
|
|
155
|
+
// Placeholder: reCAPTCHA not functional yet
|
|
156
|
+
this.submitIssue()
|
|
157
|
+
},
|
|
158
|
+
async sendAccessibilityIssue() {
|
|
159
|
+
if (!this.isValid || !this.$sendAccessibilityIssue) return
|
|
160
|
+
this.sending = true
|
|
161
|
+
|
|
162
|
+
try {
|
|
163
|
+
await this.$sendAccessibilityIssue(
|
|
164
|
+
this.form,
|
|
165
|
+
this.$config.happyfoxEndpoint,
|
|
166
|
+
this.$config.happyfoxApiKey,
|
|
167
|
+
this.$config.happyfoxAuthCode
|
|
168
|
+
)
|
|
169
|
+
this.submissionSuccess = true
|
|
170
|
+
|
|
171
|
+
// Wait 2 seconds, then close the modal
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
this.submissionSuccess = false
|
|
174
|
+
this.$emit('dismiss')
|
|
175
|
+
}, 2000)
|
|
176
|
+
} catch (e) {
|
|
177
|
+
console.error('Accessibility issue submission failed:', e.message || e)
|
|
178
|
+
alert(
|
|
179
|
+
'Something went wrong while submitting the form. Please try again later.'
|
|
180
|
+
)
|
|
181
|
+
} finally {
|
|
182
|
+
this.sending = false
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<style lang="scss" scoped>
|
|
190
|
+
@import '../../../design/_mixins.scss';
|
|
191
|
+
@import '../../../design/_variables.scss';
|
|
192
|
+
|
|
193
|
+
.asd20-accessibility-issue-modal {
|
|
194
|
+
&::v-deep .asd20-modal__content .asd20-viewport {
|
|
195
|
+
padding: space(1);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@media (min-width: 1024px) {
|
|
200
|
+
.asd20-accessibility-issue-modal {
|
|
201
|
+
&::v-deep .asd20-modal__content .asd20-viewport {
|
|
202
|
+
padding: space(1);
|
|
203
|
+
}
|
|
204
|
+
&::v-deep .asd20-modal {
|
|
205
|
+
margin-top: auto;
|
|
206
|
+
margin-bottom: auto;
|
|
207
|
+
max-width: 40vw;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
</style>
|