Skip to content
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

Deployment PR - 1404 #1987

Merged
merged 232 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
6c58957
fix non-lfng users getting access to portal review by manually changi…
Abradat Nov 15, 2024
156b3f1
Merge pull request #1986 from bcgov/bugifx/ALCS-2385
Abradat Nov 15, 2024
4de6610
Merge pull request #1988 from bcgov/backport/2024-11-18
Abradat Nov 18, 2024
5bed63f
fix submission review error for non-authorized users
Abradat Nov 18, 2024
0d241ac
change isAllowed to false by default
Abradat Nov 18, 2024
afd483c
Merge pull request #1989 from bcgov/bugfix/ALCS-2385-2
Abradat Nov 18, 2024
daf1970
Merge branch 'main' into develop
fbarreta Nov 19, 2024
02112db
ALCS-2302 Implement NOI decision type into admin
fbarreta Nov 20, 2024
7325b6c
ALCS-2302 Cleanup
fbarreta Nov 20, 2024
3e47a44
ALCS-2060 Remove superseded field from conditions
fbarreta Nov 21, 2024
14d5737
ALCS-2302 Fix edit state
fbarreta Nov 21, 2024
8f8d55d
Merge pull request #1992 from bcgov/feature/ALCS-2060-remove-supersed…
fbarreta Nov 21, 2024
004766b
Merge pull request #1991 from bcgov/feature/ALCS-2302-noi-condition-t…
fbarreta Nov 21, 2024
3d1e591
ALCS-2074 Approval Dependent UI removal
fbarreta Nov 21, 2024
24ac05f
Merge pull request #1996 from bcgov/feature/ALCS-2072-remove-approval…
fbarreta Nov 21, 2024
f6938bb
extend admin fields for decision condition types for applications
Abradat Nov 21, 2024
d53888b
Merge branch 'develop' into feature/ALCS-2311-2393
Abradat Nov 21, 2024
6843777
ALCS-2399 Order by label on retrieving codes
fbarreta Nov 21, 2024
fcde0df
fix data.content optional check
Abradat Nov 21, 2024
be31e6e
remove console log
Abradat Nov 22, 2024
dc2bb50
fix tests
Abradat Nov 22, 2024
16c9663
add admin decision condition types to NOIs
Abradat Nov 22, 2024
0470f0f
fix tests
Abradat Nov 22, 2024
0580cf6
Merge pull request #1997 from bcgov/bugfix/ALCS-2399-order-condition-…
fbarreta Nov 22, 2024
d3b8efc
ALCS-2311 Edit conditions on admin
fbarreta Nov 22, 2024
04a4d65
ALCS-2397 Mappings and DTos
fbarreta Nov 25, 2024
e78347a
ALCS-2393 Test fix
fbarreta Nov 25, 2024
02897e3
ALCS-2393 Render components and validation according to type
fbarreta Nov 25, 2024
895d9d5
Add is_active to DB for apps/NOI's
trslater Nov 25, 2024
0f56abd
Add is_active to condition type DTO's
trslater Nov 25, 2024
8525fac
Add is_active to condition type services
trslater Nov 25, 2024
dc56530
Add is_active to frontend DTO's
trslater Nov 25, 2024
feb51b4
ALCS-2393 Save single date on condition
fbarreta Nov 25, 2024
8bfd2f9
Add status column to conditions admin UI
trslater Nov 25, 2024
99f5a1e
Add status field to condition type dialog
trslater Nov 25, 2024
a49ef9d
Add delete button/functionality
trslater Nov 25, 2024
1aa900a
ALCS-2393 View conditions page and conditions input layout
fbarreta Nov 25, 2024
acec594
add custom colors to checkbox and switch
Abradat Nov 25, 2024
9b166b7
Merge branch 'feature/ALCS-2311-2393' of https://github.com/bcgov/alc…
Abradat Nov 25, 2024
9573783
Use proper NOI DTO instead of apps DTO
trslater Nov 25, 2024
1f468b1
fix switch color when enabled by default
Abradat Nov 26, 2024
206bea6
ALCS-2394 Implement conditions to NOIs
fbarreta Nov 26, 2024
a51780a
Merge branch 'feature/ALCS-2311-2393' of https://github.com/bcgov/alc…
fbarreta Nov 26, 2024
2e3226f
ALCS-2394 Tests fix
fbarreta Nov 26, 2024
745aac1
Allow delete error message to be set by backend
trslater Nov 26, 2024
d6af4e4
ALCS-2394 Tests fix 2
fbarreta Nov 26, 2024
87981a1
fix decision condition layout and form submission for application and…
Abradat Nov 26, 2024
417c875
Throw error if trying to delete condition type associated with undele…
trslater Nov 26, 2024
cb3efb5
Fix mistakenly added delete method to condition service
trslater Nov 26, 2024
100da12
Log errors as errors
trslater Nov 26, 2024
a232b80
Merge pull request #1998 from bcgov/feature/ALCS-2311-2393
Abradat Nov 26, 2024
80ecd26
Merge branch 'develop' into feature/ALCS-2322
trslater Nov 27, 2024
ebbef72
Filter out inactive conditions from new condition list
trslater Nov 27, 2024
afed751
Rename non-sensical type variable
trslater Nov 27, 2024
dcc37c4
Fix failing API test
trslater Nov 27, 2024
9a0acb8
Rename stuff in condition type test to match what it's actually testing
trslater Nov 27, 2024
a474a2d
Rename condition types service test file
trslater Nov 27, 2024
84971cc
Fix ALCS frontend tests
trslater Nov 27, 2024
a0eca7e
Explicitly soft delete condition types
trslater Nov 27, 2024
2a8e2a9
Remove unused import
trslater Nov 27, 2024
bf2d343
Use appropriate exceptions
trslater Nov 27, 2024
a7a5ecf
Merge pull request #1999 from bcgov/feature/ALCS-2322
trslater Nov 27, 2024
947d995
ALCS-2092 Create migration
fbarreta Nov 28, 2024
9faab6d
ALCS-2092 Add na comment
fbarreta Nov 28, 2024
4eb9987
Merge pull request #2001 from bcgov/feature/ALCS-2092-add-due-date-to…
fbarreta Nov 28, 2024
f1b9818
fix application and NOIs decision condition type bugs
Abradat Nov 28, 2024
b7353b3
Merge pull request #2002 from bcgov/feature/ALCS-2311-2
trslater Nov 29, 2024
eab439e
Merge pull request #2003 from bcgov/backport-2024-11-27
Abradat Nov 29, 2024
897a0bd
Setup multiple condition dates backend
trslater Nov 29, 2024
96d4325
Add date methods to ALCS condition service
trslater Nov 29, 2024
9d0be42
Fetch dates in edit condition component
trslater Nov 29, 2024
ce8df67
reorder conditions page components
Abradat Nov 29, 2024
66c3f18
ALCS-2099 Dates UI removal
fbarreta Nov 29, 2024
afa212f
ALCS-2099 Migration script
fbarreta Nov 29, 2024
1cc443e
ALCS-2099 NOI dates removal
fbarreta Nov 29, 2024
ebefd18
add multiple date to decision condition type entity
Abradat Nov 29, 2024
8b1b88b
ALCS-2099 Remove date fields from view components
fbarreta Nov 29, 2024
ca43069
add multiple date to admin
Abradat Nov 30, 2024
4b88e0b
Merge branch 'develop' into feature/ALCS-2312
Abradat Nov 30, 2024
d44ed89
Fix wrong type
trslater Dec 2, 2024
e172211
Convert date type 2 bools to enums
trslater Dec 2, 2024
01d1a04
ALCS-2092 New changes to accommodate the data type fields
fbarreta Dec 2, 2024
4f36f98
Add NOI condition date entity, DTO, service, controller, migration
trslater Dec 2, 2024
d684ea4
Add completion date to condition dates
trslater Dec 2, 2024
67e133f
Remove single condition dates
trslater Dec 2, 2024
0196bbb
Fix condition completion date
trslater Dec 2, 2024
ee8d850
ALCS-2092 Change date type field
fbarreta Dec 2, 2024
f85e459
Remove single condition dates from automapper
trslater Dec 3, 2024
6c92c99
Improve condition date backend
trslater Dec 3, 2024
4fbdced
Remove single dates from frontend DTO's
trslater Dec 3, 2024
db1c627
Fix app frontend DTO
trslater Dec 3, 2024
f7cff96
Add condition dates to NOI frontend service/DTO
trslater Dec 3, 2024
2512f35
Clear old dates and set status based on new dates in view conditions …
trslater Dec 4, 2024
b589c1d
Add completed date to condition date tables
trslater Dec 4, 2024
7e2e95f
ALCS-1858 Added string index
fbarreta Dec 4, 2024
03eecd6
Merge branch 'feature/ALCS-2312' into feature/ALCS-1858-update-condit…
fbarreta Dec 4, 2024
8584859
Fix undefined app component name
trslater Dec 5, 2024
dd59682
Apply same change to NOI's
trslater Dec 5, 2024
fbf6c2b
Add success toast when deleting condition types
trslater Dec 5, 2024
80f8c50
Fix failing test
trslater Dec 5, 2024
4c96f27
Merge pull request #2006 from bcgov/feature/ALCS-2322-QA-1
trslater Dec 5, 2024
6586d1e
Merge branch 'develop' into feature/ALCS-2312
trslater Dec 5, 2024
c37f6ac
ALCS-1858 Pill status updates
fbarreta Dec 5, 2024
34e03aa
Create condition date editor dialog
trslater Dec 6, 2024
63596d7
Create condition date editor dialog
trslater Dec 6, 2024
50b6900
Condition multi-date UI
trslater Dec 6, 2024
9266284
Only hide delete button if required
trslater Dec 6, 2024
5dbbfdb
Change save button and include add button when `isAdding`
trslater Dec 6, 2024
c5317bd
Add date list to multidate conditions
trslater Dec 6, 2024
3aad969
Fix minor admin condition type dialog typo
trslater Dec 6, 2024
8e14980
Clean up debug log
trslater Dec 6, 2024
cc86b6b
Change backend to set batch dates
trslater Dec 9, 2024
5cbcc71
Save dates
trslater Dec 9, 2024
c7a93ad
Add single update endpoint to API
trslater Dec 9, 2024
4d7a22d
Add single frontend service update date
trslater Dec 9, 2024
ca9ac36
Fix error message
trslater Dec 9, 2024
754a3a8
ALCS-1858 Call function to retrieve condition status
fbarreta Dec 9, 2024
b6aba6d
Make date comment nullable
trslater Dec 9, 2024
f0f51be
Fix backend
trslater Dec 9, 2024
035533c
ALCS-2099 Change migration to add dates
fbarreta Dec 9, 2024
0334835
Save dates with decision rather than on add
trslater Dec 10, 2024
66c3c83
Clean up unused service methods and API endpoints
trslater Dec 10, 2024
799538e
Clean up last remaining unused service methods
trslater Dec 10, 2024
b09a7e6
Wrap dates
trslater Dec 10, 2024
d9ce7e0
Save single date field
trslater Dec 10, 2024
598c95a
Fix failing tests
trslater Dec 10, 2024
537a0df
Get and map dates with condtions
trslater Dec 10, 2024
df8e6f5
Fetch and map dates for NOI's as well
trslater Dec 10, 2024
4c75217
Populate dates from condition rather than date method
trslater Dec 10, 2024
990c648
Clean up unused field control
trslater Dec 10, 2024
e7831c0
Fix date delete button
trslater Dec 10, 2024
9bce32a
Validate multiple dates and show errors
trslater Dec 10, 2024
9be0b4d
Make ALCS shared error message editable
trslater Dec 10, 2024
41c78b0
add code validation prevent overwriting in admin
Abradat Dec 10, 2024
4d6feb8
ALCS-1858 End point naming change
fbarreta Dec 10, 2024
9334c92
fix existing codes name change
Abradat Dec 10, 2024
0e63742
ALCS-2098 Created migration
fbarreta Dec 10, 2024
304484a
adjust error message for board and columns in admin
Abradat Dec 10, 2024
74a282c
add backend validation on code entries in admin
Abradat Dec 10, 2024
d014100
fix directory names and tests
Abradat Dec 11, 2024
98389ae
Add getting conditions by type code to front/backend services, contro…
trslater Dec 11, 2024
5e09e83
Pass condition service down to condition type admin dialog
trslater Dec 11, 2024
6f904c8
Merge pull request #2007 from bcgov/feature/ALCS-2404
Abradat Dec 11, 2024
6b50c5c
Include dates in conditions by type requests
trslater Dec 11, 2024
23b5fba
Prevent removing dates from condition that already has dates associated
trslater Dec 11, 2024
86a9147
Merge branch 'develop' into feature/ALCS-2312
trslater Dec 11, 2024
06f1234
Fix failing tests
trslater Dec 11, 2024
4490e2e
Fix failing test
trslater Dec 11, 2024
76f4812
Merge pull request #2004 from bcgov/feature/ALCS-2312
trslater Dec 11, 2024
4630f79
Merge branch 'develop' into feature/ALCS-2098-migration-to-create-end…
fbarreta Dec 11, 2024
9699480
Merge pull request #2008 from bcgov/feature/ALCS-2098-migration-to-cr…
fbarreta Dec 11, 2024
a1c0725
Merge branch 'develop' into feature/alcs-2092-new-migration-to-add-fee
fbarreta Dec 11, 2024
2646c1b
Merge pull request #2009 from bcgov/feature/alcs-2092-new-migration-t…
fbarreta Dec 11, 2024
7ca0350
Merge branch 'develop' into feature/ALCS-2099-components-script-and-d…
fbarreta Dec 11, 2024
34fa55a
Merge branch 'develop' into feature/ALCS-1858-update-condition-pills
fbarreta Dec 11, 2024
6f7f6ec
Merge pull request #2005 from bcgov/feature/ALCS-2099-components-scri…
fbarreta Dec 11, 2024
588615e
Merge branch 'develop' into feature/ALCS-1858-update-condition-pills
fbarreta Dec 11, 2024
c9039fb
ALCS-2099 Delete Migration and create a new one
fbarreta Dec 11, 2024
6bc43e4
Merge pull request #2010 from bcgov/bugfix/ALCS-2099-fix-migration-order
fbarreta Dec 11, 2024
ecd2d60
Merge branch 'develop' into feature/ALCS-1858-update-condition-pills
fbarreta Dec 11, 2024
b2a8fc2
Fix date label missing
trslater Dec 11, 2024
e1bba2e
ALCS-1858 Remove single date patch
fbarreta Dec 11, 2024
63e1e5e
Clean up condition validator
trslater Dec 11, 2024
b1c4982
Remove check for condition UUID
trslater Dec 11, 2024
8442fbb
ALCS-1858 test fixes
fbarreta Dec 12, 2024
3360061
Move migration dependent on 2312 after 2312 migrations
trslater Dec 12, 2024
56d9f9f
ALCS-1858 Cleanup
fbarreta Dec 12, 2024
5c0f3f6
Merge pull request #2012 from bcgov/feature/ALCS-2313-QA-1
trslater Dec 12, 2024
9169fee
ALCS-2092 Fix the data field name
fbarreta Dec 12, 2024
02db183
Merge pull request #2013 from bcgov/feature/ALCS-2092-fix-date-filed-…
fbarreta Dec 12, 2024
6dc29d7
fix admin condition type code check on deleted items
Abradat Dec 12, 2024
1dcd77c
ALCS-1858 Remove fetchDate function
fbarreta Dec 12, 2024
b402d8f
Merge branch 'develop' into feature/ALCS-2091
Abradat Dec 12, 2024
1d3f437
rename functions and remove redundant DTO
Abradat Dec 12, 2024
dc92c90
Fix not nullable date field not allowing to save empty date
trslater Dec 12, 2024
4ae5c7f
Merge pull request #2015 from bcgov/feature/ACLS-2312-QA-2
trslater Dec 12, 2024
dd29074
rename functions
Abradat Dec 12, 2024
0573c26
Merge pull request #2014 from bcgov/feature/ALCS-2404-2
Abradat Dec 12, 2024
cd457f4
ALCS-1858 Move get status to parent component
fbarreta Dec 13, 2024
32c2663
ALCS-1858 Cleanup
fbarreta Dec 13, 2024
12ce000
Merge pull request #2011 from bcgov/feature/ALCS-1858-update-conditio…
fbarreta Dec 13, 2024
c909012
Merge branch 'develop' into feature/ALCS-2091
Abradat Dec 14, 2024
7a3f481
Add max height to prevent unscrollable overflow
trslater Dec 16, 2024
cfd5f76
Merge pull request #2016 from bcgov/bugfix/ALCS-2429
trslater Dec 16, 2024
ef3dedf
ALCS-2361 Leave total set on component
fbarreta Dec 16, 2024
9753dc9
Allow saving of dates to unsaved conditions
trslater Dec 16, 2024
a05a236
ALCS-2332 Added 5 decimal places validation and user hint
fbarreta Dec 16, 2024
c9d34d4
Merge pull request #2017 from bcgov/bugfix/ALCS-2361-fix-inbox-mobile…
fbarreta Dec 16, 2024
a2b3002
Merge pull request #2019 from bcgov/bugfix/ALCS-2332-fix-map-area-hec…
fbarreta Dec 16, 2024
4f8bd33
Fix browser error on cancel date dialog
trslater Dec 16, 2024
56fd31b
Sort condition dates on setting
trslater Dec 16, 2024
788641b
Merge pull request #2020 from bcgov/feature/ALCS-2312-QA-3
trslater Dec 17, 2024
6087e6c
Delete newly orphaned condition dates
trslater Dec 17, 2024
e34ed5d
ALCS1858 Ui Fixes and Function logic changes
fbarreta Dec 17, 2024
3b59f04
Clean up orphaned condition dates
trslater Dec 17, 2024
41142df
Make condition UUID not nullable to prevent orphaned dates
trslater Dec 17, 2024
dcff84b
add single and multiple date support to conditions page for applications
Abradat Dec 17, 2024
dd75e43
Merge pull request #2022 from bcgov/feature/ALCS-2312-fix-orphaned-dates
trslater Dec 17, 2024
9d8a475
ALCS-1858 Fix multiple dates check
fbarreta Dec 17, 2024
25a7cf1
Reverse not null condition UUID
trslater Dec 17, 2024
d1c4b82
Merge pull request #2024 from bcgov/feature/ALCS-2312-fix-non-nullabl…
trslater Dec 17, 2024
c49ac10
remove comment
Abradat Dec 17, 2024
dade014
Remove date from Non Farm Use
fbarreta Dec 17, 2024
93b7271
change multiple date table background color to transparent
Abradat Dec 17, 2024
8fe86f1
add single and multiple date support to conditions page for NOIs
Abradat Dec 17, 2024
2f3a75a
Merge pull request #2021 from bcgov/feature/ALCS-1858-status-pills-QA1
fbarreta Dec 17, 2024
badd18c
Merge pull request #2025 from bcgov/feature/ALCS-2099-nfu-component-d…
fbarreta Dec 17, 2024
13a051f
fix tests and multiple delete table issue on applications and NOIs
Abradat Dec 17, 2024
52b0132
rename API endpoints
Abradat Dec 17, 2024
304ef9f
ALCS-1850 Change expiry comparision and compare only date portions
fbarreta Dec 17, 2024
5e026ea
remove DTO transformers
Abradat Dec 17, 2024
d25953e
Merge pull request #2023 from bcgov/feature/ALCS-2091
Abradat Dec 17, 2024
91057b5
ALCS-1858 Change ongoing and past due
fbarreta Dec 17, 2024
f78af93
Merge pull request #2026 from bcgov/feature/ALCS-1858-status-pills-QA2
fbarreta Dec 17, 2024
ca66660
fix sorting in multiple date table in conditions for applications and…
Abradat Dec 17, 2024
0f509af
Merge pull request #2027 from bcgov/feature/ALCS-2441
Abradat Dec 17, 2024
d174e0b
update condition pill instantly when updating or deleting dates
Abradat Dec 18, 2024
a009566
ALCS-2431 Validate Admin fee and security amount
fbarreta Dec 18, 2024
fa417dd
Merge pull request #2028 from bcgov/feature/ALCS-2443
Abradat Dec 18, 2024
ebad124
Merge pull request #2029 from bcgov/feature/ALCS-2431-add-validation-…
fbarreta Dec 18, 2024
be75326
show successful toast when condition type is updated in admin
Abradat Dec 18, 2024
e04783f
Merge pull request #2030 from bcgov/feature/ALCS-2432
Abradat Dec 18, 2024
e6cc786
allow user to clear date and comment values from conditions
Abradat Dec 18, 2024
852f1a7
fix condition UI
Abradat Dec 18, 2024
514953f
ALCS-2431 Prevents validation flash and remove admin fee if unchecked…
fbarreta Dec 18, 2024
d87af10
Merge pull request #2031 from bcgov/feature/ALCS-2091-2
Abradat Dec 18, 2024
ae6842a
Merge pull request #2032 from bcgov/feature/ALCS-2431-remove-message-…
fbarreta Dec 18, 2024
14a39e6
ALCS-2446 Set single date as default if date is not checked
fbarreta Dec 18, 2024
3cbebcb
ALCS-2446 Typo fix
fbarreta Dec 18, 2024
6e1e56b
ALCS-2446 Set default at the form
fbarreta Dec 18, 2024
ec14404
ALCS-2446 Check default on form control
fbarreta Dec 18, 2024
f54da40
Merge pull request #2033 from bcgov/bugfix/ALCS-2446-set-date-type-de…
fbarreta Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions alcs-frontend/src/app/features/admin/admin.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BoardManagementComponent } from './board-management/board-management.co
import { CardStatusComponent } from './card-status/card-status.component';
import { CeoCriterionComponent } from './ceo-criterion/ceo-criterion.component';
import { ConfigurationComponent } from './configuration/configuration.component';
import { DecisionConditionTypesComponent } from './decision-condition-types/decision-condition-types.component';
import { DecisionConditionContainerComponent } from './decision-condition-types/decision-condition-container.component';
import { DecisionMakerComponent } from './decision-maker/decision-maker.component';
import { HolidayComponent } from './holiday/holiday.component';
import { LocalGovernmentComponent } from './local-government/local-government.component';
Expand Down Expand Up @@ -41,7 +41,7 @@ export const childRoutes = [
path: 'dct',
menuTitle: 'Decision Condition Types',
icon: 'hvac',
component: DecisionConditionTypesComponent,
component: DecisionConditionContainerComponent,
},
{
path: 'noi',
Expand Down
4 changes: 3 additions & 1 deletion alcs-frontend/src/app/features/admin/admin.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { CeoCriterionComponent } from './ceo-criterion/ceo-criterion.component';
import { ConfigurationComponent } from './configuration/configuration.component';
import { MaintenanceBannerConfirmationDialogComponent } from './configuration/maintenance-banner-confirmation-dialog/maintenance-banner-confirmation-dialog.component';
import { DecisionConditionTypesDialogComponent } from './decision-condition-types/decision-condition-types-dialog/decision-condition-types-dialog.component';
import { DecisionConditionContainerComponent } from './decision-condition-types/decision-condition-container.component';
import { DecisionConditionTypesComponent } from './decision-condition-types/decision-condition-types.component';
import { DecisionMakerDialogComponent } from './decision-maker/decision-maker-dialog/decision-maker-dialog.component';
import { DecisionMakerComponent } from './decision-maker/decision-maker.component';
Expand Down Expand Up @@ -54,8 +55,8 @@ const routes: Routes = [
UnarchiveComponent,
DecisionMakerComponent,
DecisionMakerDialogComponent,
DecisionConditionTypesComponent,
DecisionConditionTypesDialogComponent,
DecisionConditionTypesComponent,
CardStatusComponent,
CardStatusDialogComponent,
BoardManagementComponent,
Expand All @@ -67,6 +68,7 @@ const routes: Routes = [
TagComponent,
TagDialogComponent,
TagContainerComponent,
DecisionConditionContainerComponent,
],
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ <h4>{{ isEdit ? 'Edit' : 'Create' }} Board</h4>
<mat-label>Code</mat-label>
<input [formControl]="code" required maxlength="4" minlength="4" matInput id="code" name="code" />
</mat-form-field>
<div *ngIf="form.get('code')?.hasError('codeExists')">
<app-error-message message="Code already in use, pick a different code."></app-error-message>
</div>
</div>

<div class="full-width">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { FormBuilder, FormControl, FormGroup, NgModel, Validators } from '@angular/forms';
import { MatCheckboxChange } from '@angular/material/checkbox';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { AdminBoardManagementService } from '../../../../services/admin-board-management/admin-board-management.service';
Expand All @@ -10,6 +10,7 @@ import { BoardService } from '../../../../services/board/board.service';
import { CardStatusService } from '../../../../services/card/card-status/card-status.service';
import { CardType } from '../../../../shared/card/card.component';
import { BaseCodeDto } from '../../../../shared/dto/base.dto';
import { codeExistsValidator } from '../../../../shared/validators/code-exists-validator';

const DISABLED_CREATE_CARD_TYPES = [
CardType.APP,
Expand Down Expand Up @@ -60,6 +61,7 @@ export class BoardManagementDialogComponent implements OnInit {
public data: {
board: MinimalBoardDto | undefined;
cardTypes: BaseCodeDto[];
existingCodes: string[];
},
private dialogRef: MatDialogRef<BoardManagementDialogComponent>,
private cardStatusService: CardStatusService,
Expand All @@ -76,6 +78,8 @@ export class BoardManagementDialogComponent implements OnInit {
for (const type of this.cardTypes) {
this.cardTypeMap[type.code] = type.label;
}

this.code.addValidators(codeExistsValidator(this.data?.existingCodes ? this.data.existingCodes : []));
}

async loadBoard(code: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class BoardManagementComponent implements OnInit, OnDestroy {
height: '80%',
data: {
cardTypes: this.cardTypes,
existingCodes: this.boards.map((b) => b.code.toLowerCase()),
},
});
dialog.beforeClosed().subscribe(async (result) => {
Expand All @@ -62,6 +63,7 @@ export class BoardManagementComponent implements OnInit, OnDestroy {
data: {
board: boardDto,
cardTypes: this.cardTypes,
existingCodes: this.boards.map((b) => b.code.toLowerCase()),
},
});
dialog.beforeClosed().subscribe(async (result) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ <h4>{{ isEdit ? 'Edit' : 'Create' }} Column</h4>
matInput
id="code"
[(ngModel)]="code"
#codeModel="ngModel"
name="code"
/>
</mat-form-field>
</div>

<div *ngIf="isCodeExisiting(codeModel) && !isEdit" class="full-width code-error-message">
<app-error-message message="Code already in use, pick a different code."></app-error-message>
</div>
<div>
<mat-form-field class="label" appearance="outline">
<mat-label>Label</mat-label>
Expand All @@ -37,7 +40,7 @@ <h4>{{ isEdit ? 'Edit' : 'Create' }} Column</h4>

<div class="split">
<div [matTooltip]="canDeleteReason" [matTooltipDisabled]="canDelete">
<button [disabled]="!canDelete" (click)='onDelete()' mat-stroked-button color="warn">Delete</button>
<button [disabled]="!canDelete" (click)="onDelete()" mat-stroked-button color="warn">Delete</button>
</div>
<div class="button-container">
<button mat-stroked-button color="primary" mat-dialog-close="false">Close</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
.mat-mdc-form-field {
width: 100%;
}

.code-error-message {
margin: -20px 0 -20px 0;
}

.code {
padding-top: 8px;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('CardStatusDialogComponent', () => {
imports: [ReactiveFormsModule, FormsModule],
declarations: [CardStatusDialogComponent],
providers: [
{ provide: MAT_DIALOG_DATA, useValue: undefined },
{ provide: MAT_DIALOG_DATA, useValue: { existingCodes: [] } },
{ provide: MatDialogRef, useValue: {} },
{
provide: CardStatusService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { CardStatusDto } from '../../../../services/application/application-code.dto';
import { CardStatusService } from '../../../../services/card/card-status/card-status.service';
import { NgModel } from '@angular/forms';
import { codeExistsDirectiveValidator } from '../../../../shared/validators/code-exists-validator';

@Component({
selector: 'app-decision-condition-types-dialog',
Expand All @@ -19,16 +21,20 @@ export class CardStatusDialogComponent implements OnInit {
canDeleteReason = '';

constructor(
@Inject(MAT_DIALOG_DATA) public data: CardStatusDto | undefined,
@Inject(MAT_DIALOG_DATA)
public data: {
cardStatus: CardStatusDto | undefined;
existingCodes: string[];
},
private dialogRef: MatDialogRef<CardStatusDialogComponent>,
private cardStatusService: CardStatusService
private cardStatusService: CardStatusService,
) {
if (data) {
this.description = data.description;
this.label = data.label;
this.code = data.code;
if (data.cardStatus) {
this.description = data.cardStatus.description;
this.label = data.cardStatus.label;
this.code = data.cardStatus.code;
}
this.isEdit = !!data;
this.isEdit = !!data.cardStatus;
}

async onSubmit() {
Expand Down Expand Up @@ -65,4 +71,8 @@ export class CardStatusDialogComponent implements OnInit {
await this.cardStatusService.delete(this.code);
this.dialogRef.close(true);
}

isCodeExisiting(model: NgModel) {
return codeExistsDirectiveValidator(model, this.data.existingCodes, this.code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class CardStatusComponent implements OnInit {
constructor(
private cardStatusService: CardStatusService,
public dialog: MatDialog,
private confirmationDialogService: ConfirmationDialogService
private confirmationDialogService: ConfirmationDialogService,
) {}

ngOnInit(): void {
Expand All @@ -34,6 +34,7 @@ export class CardStatusComponent implements OnInit {
minWidth: '600px',
maxWidth: '800px',
width: '70%',
data: { existingCodes: this.cardStatusDtos.map((cs) => cs.code.toLowerCase()) },
});
dialog.beforeClosed().subscribe(async (result) => {
if (result) {
Expand All @@ -47,7 +48,7 @@ export class CardStatusComponent implements OnInit {
minWidth: '600px',
maxWidth: '800px',
width: '70%',
data: cardStatusDto,
data: { cardStatus: cardStatusDto, existingCodes: this.cardStatusDtos.map((cs) => cs.code.toLowerCase()) },
});
dialog.beforeClosed().subscribe(async (result) => {
if (result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ <h4>{{ isEdit ? 'Edit' : 'Create' }} CEO Criterion</h4>
matInput
id="code"
[(ngModel)]="code"
#codeModel="ngModel"
name="code"
/>
</mat-form-field>
<div *ngIf="isCodeExisting(codeModel) && !isEdit">
<app-error-message message="Code already in use or deteled, pick a different code."></app-error-message>
</div>
</div>

<div class="full-width">
Expand All @@ -50,7 +54,7 @@ <h4>{{ isEdit ? 'Edit' : 'Create' }} CEO Criterion</h4>
mat-flat-button
color="primary"
type="submit"
[disabled]="!form.form.valid"
[disabled]="!form.form.valid || (isCodeExisting(codeModel) && !isEdit)"
>
Save
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,13 @@
.mat-mdc-form-field {
width: 100%;
}

.code {
padding-top: 8px;
}

.number-input {
padding-top: 8px;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('CeoCriterionDialogComponent', () => {
imports: [ReactiveFormsModule, FormsModule],
declarations: [CeoCriterionDialogComponent],
providers: [
{ provide: MAT_DIALOG_DATA, useValue: undefined },
{ provide: MAT_DIALOG_DATA, useValue: { existingCodes: [] } },
{ provide: MatDialogRef, useValue: {} },
{
provide: CeoCriterionService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { CeoCriterionDto } from '../../../../services/application/decision/application-decision-v2/application-decision.dto';
import { CeoCriterionService } from '../../../../services/ceo-criterion/ceo-criterion.service';
import { NgModel } from '@angular/forms';
import { CeoCriterionDto } from '../../../../services/application/decision/application-decision-v2/application-decision.dto';
import { codeExistsDirectiveValidator } from '../../../../shared/validators/code-exists-validator';

@Component({
selector: 'app-ceo-criterion-dialog',
Expand All @@ -18,17 +20,21 @@ export class CeoCriterionDialogComponent {
isEdit = false;

constructor(
@Inject(MAT_DIALOG_DATA) public data: CeoCriterionDto | undefined,
@Inject(MAT_DIALOG_DATA)
public data: {
ceoCriterion: CeoCriterionDto | undefined;
existingCodes: string[];
},
private dialogRef: MatDialogRef<CeoCriterionDialogComponent>,
private ceoCriterionService: CeoCriterionService,
) {
if (data) {
this.description = data.description;
this.label = data.label;
this.code = data.code;
this.number = data.number.toString();
if (data?.ceoCriterion) {
this.description = data.ceoCriterion.description;
this.label = data.ceoCriterion.label;
this.code = data.ceoCriterion.code;
this.number = data.ceoCriterion.number.toString();
}
this.isEdit = !!data;
this.isEdit = !!data?.ceoCriterion;
}

async onSubmit() {
Expand All @@ -53,4 +59,8 @@ export class CeoCriterionDialogComponent {
this.isLoading = false;
this.dialogRef.close(true);
}

isCodeExisting(model: NgModel) {
return codeExistsDirectiveValidator(model, this.data.existingCodes, this.code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export class CeoCriterionComponent implements OnInit {
minWidth: '600px',
maxWidth: '800px',
width: '70%',
data: {
existingCodes: this.ceoCriterion.map((cc) => cc.code.toLocaleLowerCase()),
},
});
dialog.beforeClosed().subscribe(async (result) => {
if (result) {
Expand All @@ -49,7 +52,7 @@ export class CeoCriterionComponent implements OnInit {
minWidth: '600px',
maxWidth: '800px',
width: '70%',
data: ceoCriterion,
data: { ceoCriterion: ceoCriterion, existingCodes: this.ceoCriterion.map((cc) => cc.code) },
});
dialog.beforeClosed().subscribe(async (result) => {
if (result) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<mat-tab-group id="conditions" mat-align-tabs="start">
<mat-tab>
<ng-template mat-tab-label>
<span class="tab-label">Application</span>
</ng-template>
<br />
<app-decision-condition-types [service]="applicationService" [conditionService]="applicationConditionService" />
</mat-tab>

<mat-tab>
<ng-template mat-tab-label>
<span class="tab-label">Notice of Intent</span>
</ng-template>
<br />
<app-decision-condition-types [service]="noiService" [conditionService]="noiConditionService" />
</mat-tab>
</mat-tab-group>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.tab-label {
font-weight: 700;
font-size: 16px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Component } from '@angular/core';
import { ApplicationDecisionConditionTypesService } from '../../../services/application/application-decision-condition-types/application-decision-condition-types.service';
import { NoticeofIntentDecisionConditionTypesService } from '../../../services/notice-of-intent/notice-of-intent-decision-condition-types/notice-of-intent-decision-condition-types.service';
import { NoticeOfIntentDecisionConditionService } from '../../../services/notice-of-intent/decision-v2/notice-of-intent-decision-condition/notice-of-intent-decision-condition.service';
import { ApplicationDecisionConditionService } from '../../../services/application/decision/application-decision-v2/application-decision-condition/application-decision-condition.service';

@Component({
selector: 'app-decision-condition-container',
templateUrl: './decision-condition-container.component.html',
styleUrls: ['./decision-condition-container.component.scss'],
})
export class DecisionConditionContainerComponent {
applicationService: ApplicationDecisionConditionTypesService;
applicationConditionService: ApplicationDecisionConditionService;
noiService: NoticeofIntentDecisionConditionTypesService;
noiConditionService: NoticeOfIntentDecisionConditionService;

constructor(
private aplicationDecisionConditionTypesService: ApplicationDecisionConditionTypesService,
private aplicationDecisionConditionService: ApplicationDecisionConditionService,
private noiDecisionConditionTypesService: NoticeofIntentDecisionConditionTypesService,
private noiDecisionConditionService: NoticeOfIntentDecisionConditionService,
) {
this.applicationService = this.aplicationDecisionConditionTypesService;
this.applicationConditionService = this.aplicationDecisionConditionService;
this.noiService = this.noiDecisionConditionTypesService;
this.noiConditionService = this.noiDecisionConditionService;
}
}
Loading
Loading