bcgov / bcgov/entity

Filings UI: interfaces should import other interfaces directly

Open
#16,440 0 comments 0 reactions 0 assignees View on GitHub
ENTITY - DO NOT USE techdebt
Dominant language
JavaScript
Stars
23
Forks
62
Avg merge
24m
Merged PRs (30d)
1

Description

- [ ] Do this for Filings UI
- [ ] Create new tickets for Create UI and Edit UI

Some small changes should be done to prevent things used before they're imported, which can give this kind of error in Dev:

![Screenshot (68).png](https://images.zenhubusercontent.com/5d0a7edda4644173e93bf808/a53853bc-a49f-4d85-abf5-505b6ef346c8)

In this case, it was resolved by exporting "officer-interface" before it is used in "director-interface":
https://github.com/bcgov/business-filings-ui/commit/54a6b1d0b91f15739ab2daffb5fbe6baa345fdf6

It is believed that this error was seen in Dev but not locally because of the way that Webpack builds chunks. This may also be related to the newer version of Typescript (4.5.5) that this project is now using (vs 3.9.10).

A better solution is for an interface file to directly import any other intefaces it needs. From this:
```
import { EmptyOfficer } from '@/interfaces'
```
To this:
```
import { EmptyOfficer } from '@/interfaces/officer-interface'
```

This change should be tested in Filings UI for all interfaces. If OK then the same change should be made to Create UI and Edit UI. (Create new tickets if needed.)

cc: @JazzarKarim @seeker25

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Filings UI interface files, especially the relationship between officer-interface and director-interface, and review commit 54a6b1d0b91f15739ab2daffb5fbe6baa345fdf6. Check all Filings UI interfaces for imports through the shared interfaces entry point, then test the Filings UI build in Dev. Done means the interfaces use direct imports and the reported import-order error is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.