Skip to content

Commit 89f0997

Browse files
Merge pull request #455 from dreamfactorysoftware/DP-775
[DP-775] User setup requires 16 characters, we want to update to 6
2 parents 449b33a + c5fedb4 commit 89f0997

File tree

5 files changed

+51
-17
lines changed

5 files changed

+51
-17
lines changed

.github/workflows/node.js.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ jobs:
2626
cache: 'npm'
2727
- run: npm ci
2828
- run: npm run build --if-present
29-

src/app/adf-roles/df-role-details/df-role-details.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ export class DfRoleDetailsComponent implements OnInit {
289289
});
290290

291291
serviceAccess.controls.forEach((control, index) => {
292-
console.log(`ServiceAccess[${index}] valid:`, control.valid, 'visibility:', this.visibilityArray[index]);
293292
if (control.invalid) {
294293
console.log(`ServiceAccess[${index}] errors:`, control.errors);
295294
console.log(`ServiceAccess[${index}] controls errors:`, {

src/app/adf-roles/df-roles-access/df-roles-access.component.html

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@
3838
>{{ option.name }}</mat-option
3939
>
4040
</mat-select>
41-
<mat-error *ngIf="formArray.controls[getFormArrayIndex(i)]?.get('service')?.hasError('required')">
41+
<mat-error
42+
*ngIf="
43+
formArray.controls[getFormArrayIndex(i)]
44+
?.get('service')
45+
?.hasError('required')
46+
">
4247
Service is required
4348
</mat-error>
4449
</mat-form-field>
@@ -57,14 +62,24 @@
5762
<mat-label>{{
5863
'roles.accessOverview.tableHeadings.component' | transloco
5964
}}</mat-label>
60-
<mat-select formControlName="component" panelWdith="null" required>
65+
<mat-select
66+
formControlName="component"
67+
panelWdith="null"
68+
required>
6169
<mat-option
62-
*ngFor="let option of getComponentArray(getFormArrayIndex(i))"
70+
*ngFor="
71+
let option of getComponentArray(getFormArrayIndex(i))
72+
"
6373
[value]="option"
6474
>{{ option }}</mat-option
6575
>
6676
</mat-select>
67-
<mat-error *ngIf="formArray.controls[getFormArrayIndex(i)]?.get('component')?.hasError('required')">
77+
<mat-error
78+
*ngIf="
79+
formArray.controls[getFormArrayIndex(i)]
80+
?.get('component')
81+
?.hasError('required')
82+
">
6883
Component is required
6984
</mat-error>
7085
</mat-form-field>
@@ -87,7 +102,9 @@
87102
formControlName="access"
88103
multiple
89104
panelWidth="null"
90-
(selectionChange)="accessChange(getFormArrayIndex(i), $event.value)"
105+
(selectionChange)="
106+
accessChange(getFormArrayIndex(i), $event.value)
107+
"
91108
required>
92109
<mat-option
93110
*ngFor="let option of accessOptions"
@@ -96,20 +113,28 @@
96113
<span
97114
class="example-additional-selection"
98115
*ngIf="
99-
(formArray.controls[getFormArrayIndex(i)]?.value.access.length || 0) > 1
116+
(formArray.controls[getFormArrayIndex(i)]?.value.access
117+
.length || 0) > 1
100118
">
101119
(+{{
102-
(formArray.controls[getFormArrayIndex(i)]?.value.access.length || 0) - 1
120+
(formArray.controls[getFormArrayIndex(i)]?.value.access
121+
.length || 0) - 1
103122
}}
104123
{{
105-
formArray.controls[getFormArrayIndex(i)]?.value.access.length === 2
124+
formArray.controls[getFormArrayIndex(i)]?.value.access
125+
.length === 2
106126
? 'other'
107127
: 'others'
108128
}})
109129
</span>
110130
</mat-option>
111131
</mat-select>
112-
<mat-error *ngIf="formArray.controls[getFormArrayIndex(i)]?.get('access')?.hasError('required')">
132+
<mat-error
133+
*ngIf="
134+
formArray.controls[getFormArrayIndex(i)]
135+
?.get('access')
136+
?.hasError('required')
137+
">
113138
Access is required
114139
</mat-error>
115140
</mat-form-field>
@@ -197,7 +222,9 @@
197222
">
198223
<ng-container
199224
*ngFor="
200-
let advancedFilter of getAdvancedFilters(getFormArrayIndex(i)).controls;
225+
let advancedFilter of getAdvancedFilters(
226+
getFormArrayIndex(i)
227+
).controls;
201228
let j = index
202229
">
203230
<div [formArrayName]="j" class="expandedItems">

src/app/adf-roles/df-roles-access/df-roles-access.component.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ export class DfRolesAccessComponent implements OnInit {
307307
})
308308
);
309309
this.visible.push(true);
310-
console.log('FormArray after add:', this.formArray.value, 'Visible:', this.visible);
311310
this.updateDataSource();
312311
}
313312

@@ -337,7 +336,9 @@ export class DfRolesAccessComponent implements OnInit {
337336
}
338337

339338
remove(index: number) {
340-
console.log('Remove called with index:', index, 'Visible array before:', [...this.visible]);
339+
console.log('Remove called with index:', index, 'Visible array before:', [
340+
...this.visible,
341+
]);
341342
if (index >= 0 && index < this.formArray.length) {
342343
// Find the actual form array index for the nth visible item BEFORE updating visible array
343344
let visibleCount = 0;
@@ -358,7 +359,10 @@ export class DfRolesAccessComponent implements OnInit {
358359
// Clear validators for the hidden item
359360
if (actualIndex !== -1 && actualIndex < this.formArray.length) {
360361
const formGroup = this.formArray.at(actualIndex);
361-
console.log('Clearing validators for form group at index:', actualIndex);
362+
console.log(
363+
'Clearing validators for form group at index:',
364+
actualIndex
365+
);
362366
formGroup.get('service')?.clearValidators();
363367
formGroup.get('component')?.clearValidators();
364368
formGroup.get('access')?.clearValidators();
@@ -370,7 +374,12 @@ export class DfRolesAccessComponent implements OnInit {
370374
console.log('Form group validity after clearing:', formGroup.valid);
371375
}
372376
}
373-
console.log('FormArray after remove:', this.formArray.value, 'Visible:', this.visible);
377+
console.log(
378+
'FormArray after remove:',
379+
this.formArray.value,
380+
'Visible:',
381+
this.visible
382+
);
374383
this.updateDataSource();
375384
}
376385

src/app/shared/components/df-user-details/df-user-details-base.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export abstract class DfUserDetailsBaseComponent<T> implements OnInit {
6666
) {
6767
this.userForm = this.fb.group({
6868
profileDetailsGroup: this.fb.group({
69-
username: ['', Validators.minLength(16)],
69+
username: ['', Validators.minLength(6)],
7070
email: ['', Validators.email],
7171
firstName: [''],
7272
lastName: [''],

0 commit comments

Comments
 (0)