Skip to content

Commit

Permalink
set max length for all inputs (bcgov#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
deetz99 authored Dec 14, 2024
1 parent 4e1769e commit cafb6ae
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 8 deletions.
3 changes: 2 additions & 1 deletion strr-base-web/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"app-inner-container",
"connect-date-picker",
"connect-date-picker__err",
"prose-bcGov"
"prose-bcGov",
"max-w-bcGovInput"
]
}],
"no-use-before-define": "off"
Expand Down
4 changes: 4 additions & 0 deletions strr-base-web/app/components/connect/form/address/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ const addId = useId()
:aria-invalid="error !== undefined"
:aria-describedby="schemaPrefix + 'street-' + addId"
:disabled="disabledFields?.includes('street')"
maxlength="1000"
@keypress.once="addressComplete(id + '-street')"
@click="addressComplete(id + '-street')"
/>
Expand Down Expand Up @@ -236,6 +237,7 @@ const addId = useId()
:placeholder="$t('label.line2')"
:aria-label="$t('label.line2')"
:disabled="disabledFields?.includes('streetAdditional')"
maxlength="1000"
/>
</UFormGroup>
<div v-if="!checkFieldsExcluded(['city', 'region', 'postalCode'])" class="flex flex-col gap-3 sm:flex-row">
Expand Down Expand Up @@ -288,6 +290,7 @@ const addId = useId()
:aria-invalid="error !== undefined"
:aria-describedby="schemaPrefix + 'region-' + addId"
:disabled="disabledFields?.includes('region')"
maxlength="1000"
/>
</template>

Expand Down Expand Up @@ -329,6 +332,7 @@ const addId = useId()
:disabled="disabledFields?.includes('locationDescription')"
class="w-full"
data-testid="address-location-description"
maxlength="1000"
/>
</UFormGroup>
</div>
Expand Down
4 changes: 3 additions & 1 deletion strr-base-web/app/components/connect/form/field/Group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const props = defineProps({
size: { type: String, default: 'lg' },
ariaLabel: { type: String, default: undefined },
type: { type: String, default: 'text' },
mask: { type: String, default: undefined }
mask: { type: String, default: undefined },
maxlength: { type: Number, default: 1000 }
})
const inputId = useId()
Expand All @@ -46,6 +47,7 @@ const errorId = `${props.name}-error-${inputId}`
:error-id="errorId"
:aria-label="ariaLabel"
size="lg"
:maxlength
/>
</slot>
</template>
Expand Down
4 changes: 3 additions & 1 deletion strr-base-web/app/components/connect/form/field/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ defineProps({
errorId: { type: String, default: undefined },
ariaLabel: { type: String, default: undefined },
type: { type: String, default: 'text' },
mask: { type: String, default: undefined }
mask: { type: String, default: undefined },
maxlength: { type: Number, default: 1000 }
})
defineExpose({ model })
Expand All @@ -36,6 +37,7 @@ defineExpose({ model })
:aria-invalid="isInvalid"
:aria-describedby="helpId"
:aria-label="ariaLabel"
:maxlength
/>
<!-- :aria-errormessage="errorId" -->
<!-- Doesnt look like aria-errormessage is well supported, need to look into this more -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const phoneId = useId()
defineExpose({ number })
</script>
<template>
<div class="flex w-full max-w-bcGovInput flex-col gap-3 sm:flex-row">
<div class="max-w-bcGovInput flex w-full flex-col gap-3 sm:flex-row">
<UFormGroup :name="name + '.countryCode'" class="grow sm:max-w-[130px]">
<template #default="{ error }">
<ConnectFormPhoneNumberCountryCode
Expand Down
2 changes: 1 addition & 1 deletion strr-base-web/app/components/form/common/Contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ defineProps<{
name="fullName"
:placeholder="t('label.fullName')"
/>
<div v-else class="flex max-w-bcGovInput flex-col gap-3 sm:flex-row">
<div v-else class="max-w-bcGovInput flex flex-col gap-3 sm:flex-row">
<ConnectFormFieldGroup
v-if="firstName !== undefined"
:id="idPrefix + '-first-name'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const addId = useId()
:disabled="disabled"
:loading="loading"
class="w-full grow"
maxlength="1000"
@keypress.once="addressComplete(id + '-street')"
@click="addressComplete(id + '-street')"
/>
Expand Down
4 changes: 4 additions & 0 deletions strr-host-pm-web/app/components/form/UnitAddress/Manual.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ watch(postalCode, () => {
data-testid="address-region-input"
:aria-required="true"
:disabled="true"
maxlength="1000"
/>
</UFormGroup>
<!-- unit number / street number / name & type -->
Expand Down Expand Up @@ -100,6 +101,7 @@ watch(postalCode, () => {
:aria-label="$t('label.siteNameOpt')"
:aria-describedby="schemaPrefix + 'streetAdditional-' + addId"
:disabled="disabledFields?.includes('streetAdditional')"
maxlength="1000"
/>
<template #help>
<span :id="schemaPrefix + 'streetAdditional-' + addId">
Expand Down Expand Up @@ -134,6 +136,7 @@ watch(postalCode, () => {
data-testid="address-region-input"
:aria-required="true"
:disabled="true"
maxlength="1000"
/>
</UFormGroup>
<!-- postal code input -->
Expand Down Expand Up @@ -162,6 +165,7 @@ watch(postalCode, () => {
:disabled="disabledFields?.includes('locationDescription')"
class="w-full"
data-testid="address-location-description"
maxlength="1000"
/>
</UFormGroup>
</div>
Expand Down
2 changes: 1 addition & 1 deletion strr-host-pm-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "strr-host-pm-web",
"private": true,
"type": "module",
"version": "0.0.9",
"version": "0.0.10",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
Expand Down
2 changes: 1 addition & 1 deletion strr-platform-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "strr-platform-web",
"private": true,
"type": "module",
"version": "0.0.23",
"version": "0.0.24",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
Expand Down
2 changes: 1 addition & 1 deletion strr-strata-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "strr-strata-web",
"private": true,
"type": "module",
"version": "0.0.19",
"version": "0.0.20",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
Expand Down

0 comments on commit cafb6ae

Please sign in to comment.