-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
20929 - Implemented GET involuntary dissolution configurations endpoint #2819
20929 - Implemented GET involuntary dissolution configurations endpoint #2819
Conversation
412cb99
to
b29f1b6
Compare
Quality Gate passedIssues Measures |
const state = reactive({ | ||
menu: false, | ||
numberOfBusinesses: 0, | ||
numberOfBusinessesEdit: 0, | ||
numberOfBusinessesNonEdit: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, this looks weird (having two properties that look similar). I have an explanation though 😆
The idea is, when the edit panel is open, the schedule summary is going to be reactive to what's being typed in the text field. However, when it is not open, it's going to be what the DB is returning of the current job batch size.
So, I decided to separate those fields. One of the biggest reasons is that, in doing so, I can store the current batch size from the GET call into the nonEdit field. This way, I only need to use the GET call once on mount. Otherwise, I have to do the GET call each time cancel or save is clicked which is really not good haha
Also, this provides so much flexibility and it separates of when the edit panel is open or not.
// Get the batch size current value (number of businesses to be dissolved per job run) | ||
const numDissolutions = staffStore.involuntaryDissolutionConfigurations.configurations.find( | ||
config => config.name === 'NUM_DISSOLUTIONS_ALLOWED').value | ||
state.numberOfBusinessesNonEdit = parseInt(numDissolutions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I mentioned above. Basically, after making the call which will be made ONCE on mount, I'm storing that value here.
/** | ||
* Save button is clicked. Update the dissolution batch size. | ||
* Only save if the inputted number is valid. | ||
* TODO: Implement logic (job) once the BE is done. | ||
*/ | ||
const saveBtnClicked = (): void => { | ||
if (state.numberOfBusinessesRef.validate()) { | ||
staffStore.updateDissolutionBatchSize(state.numberOfBusinesses) | ||
// staffStore.updateDissolutionBatchSize(state.numberOfBusinesses) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FUTURE: When I work on the PUT.
function updateDissolutionBatchOnHold (onHold: boolean) { | ||
state.involuntaryDissolutionBatch.onHold = onHold | ||
} | ||
// function updateDissolutionBatchSize (dissolutionBatchSize: number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented this out for now. Will uncomment next PR.
@@ -45,11 +45,8 @@ | |||
badgeText="Paused" | |||
icon="mdi-calendar-clock" | |||
label="Automated Dissolution Schedule" | |||
:showBadge="isOnHold" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all badge logic here as designs have changed. No more badge.
staffStore.updateDissolutionBatchOnHold(!staffStore.isDissolutionBatchOnHold()) | ||
} | ||
// Get the batch size current value (number of businesses to be dissolved per job run) | ||
const numDissolutions = staffStore.involuntaryDissolutionConfigurations.configurations.find( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/gcbrun |
Temporary Url for review: https://bcregistry-account-dev--pr-2819-b8ecll37.web.app |
Issue #:
bcgov/entity#20929
This PR implements the GET call for now. Next PR will implement the PUT call (the BE is still WIP). I'm doing this now since we're demoing tomorrow and I would like to show this.
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the sbc-auth license (Apache 2.0).