Skip to content

Commit

Permalink
23353 POC for new continuation in design (#734)
Browse files Browse the repository at this point in the history
* - app version = 5.12.0
- generalized page blurb functionality
- always show fee summary
- added special case for page header
- added special case for fee summary label
- added special route checks for continuation in authorization vs application
- added special continuation in authorization steps
- added special case for file and pay button label (submit vs resubmit)
- added special cases for validation in file and pay method
- added special case for no payment
- reverted Effective Date Time radio labels
- updated file upload error messages
- renamed ContinuationInBusinessHome -> ContinuationInAuthorizationPage
- added file name validation for ISO-8859-1 encoding
- renamed ContinuationAuthorization -> AuthorizationProof
- added filename ISO8859-1 encoding check
- updated misc existing business information layout, labels, etc
- removed confirmation checkbox
- cleaned up summary page
- fixed alignment on summary page
- renamed some getters
- added special case for dialog filing title
- renamed route + view + enums + getters + interfaces
- added special case for no fee when restoring draft
- added page blurbs to continuation in resource files
- separated auth step from the rest
- renumbered steps + hide stepper for step 0
- deleted obsolete dissolution resource objects
- added some store getters
- added Authorization Contact Information to step 0 page
- updated continuation in authorization page validation
- added special case to show pages errors and scroll properly
- removed draft-only checks on FED and staff payment components
- updated/added unit tests

* - temporary status override bypass for testing

* - improved button layout

---------

Co-authored-by: Severin Beauvais <[email protected]>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Oct 1, 2024
1 parent 5d44f91 commit b841af3
Show file tree
Hide file tree
Showing 43 changed files with 537 additions and 673 deletions.
40 changes: 32 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "5.11.26",
"version": "5.12.0",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand All @@ -25,7 +25,7 @@
"@bcrs-shared-components/corp-type-module": "1.0.16",
"@bcrs-shared-components/correct-name": "1.0.55",
"@bcrs-shared-components/court-order-poa": "3.0.11",
"@bcrs-shared-components/date-picker": "1.3.1",
"@bcrs-shared-components/date-picker": "1.3.3",
"@bcrs-shared-components/document-delivery": "1.2.0",
"@bcrs-shared-components/effective-date-time": "1.1.15",
"@bcrs-shared-components/enums": "1.1.11",
Expand Down
78 changes: 57 additions & 21 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,10 @@
</header>

<p
v-if="isFirmDissolution"
v-if="getPageBlurb"
class="mt-4"
>
Confirm the following information, select the dissolution date and certify
your dissolution before filing.
{{ getPageBlurb }}
</p>

<Stepper
Expand Down Expand Up @@ -199,9 +198,8 @@
cols="12"
lg="3"
>
<!-- Render fee summary only after data is loaded, -->
<!-- and if this isn't a change-requested filing. -->
<aside v-if="haveData && getFilingStatus !== FilingStatus.CHANGE_REQUESTED">
<!-- Render fee summary only after data is loaded. -->
<aside v-if="haveData">
<affix
relative-element-selector=".col-lg-9"
:offset="{ top: 100, bottom: -100 }"
Expand Down Expand Up @@ -273,6 +271,7 @@ import { EntityStates, ErrorTypes, FilingCodes, FilingNames, FilingStatus, Filin
StaffPaymentOptions } from '@/enums'
import { SessionStorageKeys } from 'sbc-common-components/src/util/constants'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'
import { ContinuationInStepsAuthorization } from './resources/ContinuationIn/steps'
@Component({
components: {
Expand Down Expand Up @@ -302,6 +301,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
@Getter(useStore) getFilingType!: FilingTypes
@Getter(useStore) getHaveChanges!: boolean
@Getter(useStore) getOrgInformation!: OrgInformationIF
@Getter(useStore) getPageBlurb!: string
@Getter(useStore) getSteps!: Array<StepIF>
@Getter(useStore) getUserFirstName!: string
@Getter(useStore) getUserLastName!: string
Expand All @@ -310,6 +310,8 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// @Getter(useStore) isAmalgamationFilingHorizontal!: boolean
// @Getter(useStore) isAmalgamationFilingRegular!: boolean
// @Getter(useStore) isAmalgamationFilingVertical!: boolean
@Getter(useStore) isAuthorizationStatus!: boolean
// @Getter(useStore) isContinuationInAuthorization!: boolean
@Getter(useStore) isContinuationInFiling!: boolean
@Getter(useStore) isDissolutionFiling!: boolean
@Getter(useStore) isIncorporationFiling!: boolean
Expand Down Expand Up @@ -417,9 +419,10 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
return `${this.getFilingName} (Horizontal Short-form)`
} else if (this.isAmalgamationFilingVertical) {
return `${this.getFilingName} (Vertical Short-form)`
} else {
return this.getFilingName
} else if (this.isContinuationInAuthorization) {
return 'Continuation Authorization'
}
return this.getFilingName
}
/** Data for fee summary component. */
Expand Down Expand Up @@ -475,15 +478,14 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
)
}
/** Whether the current filing is a firm dissolution. */
get isFirmDissolution (): boolean {
return (this.isEntityFirm && this.isDissolutionFiling)
}
/** The fee summary filing label. */
/** The (optional) fee summary filing label. */
get filingLabel (): string {
// text override for firm dissolutions
return this.isFirmDissolution ? 'Dissolution' : null
// special case for firm dissolutions
if (this.isEntityFirm && this.isDissolutionFiling) return 'Dissolution'
// special case for continuation in authorizations
if (this.isContinuationInAuthorization) return 'Continuation Authorization'
// otherwise, no special label
return null
}
/** The About text. */
Expand Down Expand Up @@ -771,6 +773,24 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
await this.loadPartiesInformation(this.getBusinessId)
}
// special route checks for Continuation In filing
if (this.isContinuationInFiling) {
if (this.isAuthorizationStatus) {
// make sure user is on the Continuation In Authorization route
if (this.$route.name !== RouteNames.CONTINUATION_IN_AUTHORIZATION) {
this.$router.replace(RouteNames.CONTINUATION_IN_AUTHORIZATION).catch(() => {})
return
}
} else {
// make sure user is on Continuation In Business BC route
if (this.$route.name !== RouteNames.CONTINUATION_IN_BUSINESS_BC) {
this.$router.replace(RouteNames.CONTINUATION_IN_BUSINESS_BC).catch(() => {})
return
}
}
}
// default route check:
// if user is on a route not valid for the current filing type
// then try to re-route them
if (this.$route.meta.filingType !== this.getFilingType) {
Expand All @@ -785,8 +805,8 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
}
return
case FilingTypes.CONTINUATION_IN:
this.$router.replace(RouteNames.CONTINUATION_IN_BUSINESS_HOME).catch(() => {})
return
// should never get here -- already handled above
throw new Error('Invalid code path for Continuation In')
case FilingTypes.DISSOLUTION:
if (this.isEntityFirm) {
this.$router.replace(RouteNames.DISSOLUTION_FIRM).catch(() => {})
Expand Down Expand Up @@ -867,7 +887,9 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// NB: will throw if API error
let draftFiling = await LegalServices.fetchFirstTask(businessId)
// set filing type and status
this.setFilingType(draftFiling.header.name)
this.setFilingStatus(draftFiling.header.status)
// check if filing is in a valid state to be edited
this.filingNotExistDialog = (draftFiling?.header?.status !== FilingStatus.DRAFT)
Expand Down Expand Up @@ -924,13 +946,19 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// NB: will throw if API error
let draftFiling = await LegalServices.fetchFirstOrOnlyFiling(tempId)
// set filing type and status
this.setFilingType(draftFiling.header.name)
this.setFilingStatus(draftFiling.header.status)
// *** TODO: remove after testing
if (draftFiling.header.status === FilingStatus.CHANGE_REQUESTED) {
this.setFilingStatus(FilingStatus.APPROVED)
}
// check if filing is in a valid state to be edited
this.filingNotExistDialog = (
draftFiling?.header?.status !== FilingStatus.DRAFT &&
draftFiling?.header?.status !== FilingStatus.CHANGE_REQUESTED
draftFiling?.header?.status !== FilingStatus.CHANGE_REQUESTED &&
draftFiling?.header?.status !== FilingStatus.APPROVED
)
if (this.filingNotExistDialog) return null // don't continue
Expand Down Expand Up @@ -958,6 +986,10 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
}
this.parseContinuationInDraft(draftFiling)
resources = ContinuationInResources.find(x => x.entityType === this.getEntityType) as ResourceIF
// special case for Continuation In Authorizations
if (this.isAuthorizationStatus) {
resources.steps = ContinuationInStepsAuthorization
}
break
case FilingTypes.INCORPORATION_APPLICATION:
draftFiling = {
Expand Down Expand Up @@ -1320,7 +1352,10 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
}
}
/** Called initially and when $route property changes (ie, on step changes). */
/**
* Called when $route property changes (ie, on step changes).
* Is also called initially without needing { immediate: true }.
*/
@Watch('$route', { immediate: false })
private async onRouteChanged (): Promise<void> {
// init only if we are not on signin or signout route
Expand Down Expand Up @@ -1368,7 +1403,8 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
this.setShowErrors(true)
}
// enable validation right away if user is changing a submitted filing
// enable validation right away if user is editing a submitted filing
// used for continuation in filings only atm
if (this.getFilingStatus === FilingStatus.CHANGE_REQUESTED) {
this.setShowErrors(true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-->
<div
v-if="authorization"
id="continuation-authorization"
id="authorization-proof"
>
<!-- Authorization Date -->
<v-card
Expand Down Expand Up @@ -200,7 +200,7 @@ import { Action, Getter } from 'pinia-class'
import { StatusCodes } from 'http-status-codes'
import { useStore } from '@/store/store'
import { DocumentMixin } from '@/mixins'
import { ContinuationAuthorizationIF, ExistingBusinessInfoIF, PresignedUrlIF } from '@/interfaces'
import { AuthorizationProofIF, ExistingBusinessInfoIF, PresignedUrlIF } from '@/interfaces'
import { FilingStatus } from '@/enums'
import { VuetifyRuleFunction } from '@/types'
import FileUploadPreview from '@/components/common/FileUploadPreview.vue'
Expand All @@ -218,24 +218,24 @@ import MessageBox from '@/components/common/MessageBox.vue'
AutoResize
}
})
export default class ExtraproRegistration extends Mixins(DocumentMixin) {
export default class AuthorizationProof extends Mixins(DocumentMixin) {
// Refs
$refs!: {
authorizationDateRef: DatePickerShared,
fileUploadPreview: FileUploadPreview
}
@Getter(useStore) getContinuationAuthorization!: ContinuationAuthorizationIF
@Getter(useStore) getContinuationInAuthorizationProof!: AuthorizationProofIF
@Getter(useStore) getCurrentDate!: string
@Getter(useStore) getExistingBusinessInfo!: ExistingBusinessInfoIF
@Getter(useStore) getFilingStatus!: FilingStatus
@Getter(useStore) getKeycloakGuid!: string
@Getter(useStore) getShowErrors!: boolean
@Action(useStore) setContinuationAuthorization!: (x: ContinuationAuthorizationIF) => void
@Action(useStore) setContinuationAuthorization!: (x: AuthorizationProofIF) => void
// Local properties
authorization = null as ContinuationAuthorizationIF
authorization = null as AuthorizationProofIF
authorizationDateValid = false
fileValidity = false
customErrorMessage = ''
Expand Down Expand Up @@ -302,8 +302,8 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
/** Called when this component is mounted. */
mounted (): void {
this.authorization = this.getContinuationAuthorization ||
{ files: [], date: null } as ContinuationAuthorizationIF
this.authorization = this.getContinuationInAuthorizationProof ||
{ files: [], date: null } as AuthorizationProofIF
}
/** When user has clicked the Add button, opens the file selection dialog. */
Expand Down Expand Up @@ -334,6 +334,12 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
* @param file the file to add
*/
async onFileSelected (file: File): Promise<void> {
/** Returns True if given string contains only Latin 1 (ie, ISO8859-1) characters. */
function isValidLatin1 (str: string): boolean {
// eslint-disable-next-line no-control-regex
return !/[^\u0000-\u00ff]/g.test(str)
}
// verify that file is specified and is valid
if (file && this.fileValidity) {
// verify that file doesn't already exist
Expand All @@ -343,6 +349,13 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
return // don't add to array
}
// verify file name encoding
if (!isValidLatin1(file.name)) {
// put file uploader into manual error mode by setting custom error message
this.customErrorMessage = 'Invalid character in file name.'
return // don't add to array
}
// try to upload to Minio
let psu: PresignedUrlIF
try {
Expand Down
Loading

0 comments on commit b841af3

Please sign in to comment.