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

NAS-132300 / 25.04 / Create a configurable full-page form with glossary section and help #11091

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0a011be
NAS-132300: Add id to ix-forms components
RehanY147 Nov 22, 2024
01f9e38
NAS-132300: Created full-page-form
RehanY147 Nov 22, 2024
f19660d
NAS-132300: Replaced instance-wizard
RehanY147 Nov 22, 2024
b9c6fba
NAS-132300: Update instance-wizard.component.html
RehanY147 Nov 22, 2024
b67d462
NAS-132300: Better separation of properties
RehanY147 Nov 30, 2024
3ae6564
NAS-132300: Update ix-full-page-form.component.ts
RehanY147 Nov 30, 2024
d4df88c
Merge branch 'master' into NAS-132300
RehanY147 Dec 2, 2024
50240cf
NAS-132300: Added new components
RehanY147 Dec 2, 2024
b8c7526
NAS-132300: Clean up instance-form
RehanY147 Dec 2, 2024
a08540d
NAS-132300: Using directive approach
RehanY147 Dec 3, 2024
9788e13
NAS-132300: Remove form-section and use controlDirective for names
RehanY147 Dec 5, 2024
bdb11ba
NAS-132300: Revert required labels
RehanY147 Dec 5, 2024
cbca47a
NAS-132300: Clean up non-control registration
RehanY147 Dec 5, 2024
540f2cb
NAS-132300: Remove `attr.id`
RehanY147 Dec 5, 2024
282538a
NAS-132300: Add section labels and validity info
RehanY147 Dec 7, 2024
7392d5c
NAS-132300: Create ix-form-glossary.component.ts
RehanY147 Dec 7, 2024
9c64de1
NAS-132300: Update ix-form-glossary.component.ts
RehanY147 Dec 7, 2024
6c2278a
NAS-132300: Update ix-form-glossary.component.ts
RehanY147 Dec 7, 2024
c578de1
NAS-132300: Update ix-form-glossary.component.ts
RehanY147 Dec 7, 2024
50592df
NAS-132300: Add section click
RehanY147 Dec 7, 2024
3b8a2f8
NAS-132300: Renamed method
RehanY147 Dec 10, 2024
a4b2c11
NAS-132300: Renamed controlNamesWithLabels
RehanY147 Dec 10, 2024
70913bd
NAS-132300: Automatic directive application
RehanY147 Dec 12, 2024
da40c94
Merge branch 'master' into NAS-132300
RehanY147 Dec 12, 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export class NavigateAndInteractService {
setTimeout(() => {
const htmlElement = this.window.document.getElementById(hash);
if (htmlElement) {
this.handleHashScrollIntoView(htmlElement);
this.scrollIntoView(htmlElement);
}
}, 150);
});
}

private handleHashScrollIntoView(htmlElement: HTMLElement): void {
scrollIntoView(htmlElement: HTMLElement): void {
const highlightedClass = 'highlighted-element';
htmlElement.scrollIntoView({ block: 'center' });
htmlElement.classList.add(highlightedClass);
Expand Down
8 changes: 8 additions & 0 deletions src/app/interfaces/form-sections.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { NgControl } from '@angular/forms';
import { IxFormSectionComponent } from 'app/modules/forms/ix-forms/components/ix-form-section/ix-form-section.component';

export interface ControlNameWithLabel { label: string; name: string }
export interface SectionWithControls {
section: IxFormSectionComponent;
controls: Map<string, NgControl | null> | undefined;
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
>
@for (element of getFormArray.controls; track element; let i = $index) {
<ix-list-item
[formGroupName]="i"
[label]="dynamicSchema.title | translate"
[canDelete]="!isAllListControlsDisabled"
(delete)="removeControl(i)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
}

<mat-button-toggle-group
ixRegisteredControl
[value]="value"
[disabled]="isDisabled"
[ixTest]="controlDirective.name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { AsyncPipe } from '@angular/common';
import {
ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding, input,
} from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';
import { MatButtonToggleChange, MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle';
import { MatHint } from '@angular/material/form-field';
import { TranslateModule } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { Option } from 'app/interfaces/option.interface';
import { IxErrorsComponent } from 'app/modules/forms/ix-forms/components/ix-errors/ix-errors.component';
import { IxLabelComponent } from 'app/modules/forms/ix-forms/components/ix-label/ix-label.component';
import { RegisteredControlDirective } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { RegisteredControlDirective, registeredDirectiveConfig } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { TestOverrideDirective } from 'app/modules/test-id/test-override/test-override.directive';
import { TestDirective } from 'app/modules/test-id/test.directive';

Expand All @@ -26,12 +26,17 @@ import { TestDirective } from 'app/modules/test-id/test.directive';
MatButtonToggle,
IxErrorsComponent,
MatHint,
ReactiveFormsModule,
AsyncPipe,
TranslateModule,
TestOverrideDirective,
RegisteredControlDirective,
TestDirective,
RegisteredControlDirective,
],
hostDirectives: [
{ ...registeredDirectiveConfig },
],
})
export class IxButtonGroupComponent implements ControlValueAccessor {
readonly label = input<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
}

<div
ixRegisteredControl
class="checkbox-list"
[class.inline]="inlineFields()"
[attr.aria-label]="label()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { AsyncPipe } from '@angular/common';
import {
ChangeDetectionStrategy, ChangeDetectorRef, Component, input,
} from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';
import { MatCheckbox } from '@angular/material/checkbox';
import { UntilDestroy } from '@ngneat/until-destroy';
import { TranslateModule } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { Option } from 'app/interfaces/option.interface';
import { IxErrorsComponent } from 'app/modules/forms/ix-forms/components/ix-errors/ix-errors.component';
import { IxLabelComponent } from 'app/modules/forms/ix-forms/components/ix-label/ix-label.component';
import { RegisteredControlDirective } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { RegisteredControlDirective, registeredDirectiveConfig } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { TestDirective } from 'app/modules/test-id/test.directive';

@UntilDestroy()
Expand All @@ -24,11 +24,16 @@ import { TestDirective } from 'app/modules/test-id/test.directive';
IxLabelComponent,
MatCheckbox,
IxErrorsComponent,
ReactiveFormsModule,
AsyncPipe,
RegisteredControlDirective,
TranslateModule,
TestDirective,
RegisteredControlDirective,
],
hostDirectives: [
{ ...registeredDirectiveConfig },
],
})
export class IxCheckboxListComponent implements ControlValueAccessor {
readonly label = input<string>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<mat-checkbox
ixRegisteredControl
color="primary"
[checked]="value"
[required]="required()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import {
} from '@angular/core';
import {
ControlValueAccessor, NgControl,
ReactiveFormsModule,
} from '@angular/forms';
import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox';
import { MatHint } from '@angular/material/form-field';
import { UntilDestroy } from '@ngneat/until-destroy';
import { IxErrorsComponent } from 'app/modules/forms/ix-forms/components/ix-errors/ix-errors.component';
import { WarningComponent } from 'app/modules/forms/ix-forms/components/warning/warning.component';
import { RegisteredControlDirective } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { RegisteredControlDirective, registeredDirectiveConfig } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { TooltipComponent } from 'app/modules/tooltip/tooltip.component';

Expand All @@ -25,10 +26,14 @@ import { TooltipComponent } from 'app/modules/tooltip/tooltip.component';
TooltipComponent,
WarningComponent,
IxErrorsComponent,
ReactiveFormsModule,
MatHint,
TestDirective,
RegisteredControlDirective,
],
hostDirectives: [
{ ...registeredDirectiveConfig },
],
})
export class IxCheckboxComponent implements ControlValueAccessor {
readonly label = input<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<mat-chip-grid
#chipList
class="form-chip"
ixRegisteredControl
[disabled]="isDisabled"
[required]="required()"
[attr.aria-label]="label()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
OnChanges,
ViewChild,
} from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';
import { MatAutocompleteTrigger, MatAutocomplete } from '@angular/material/autocomplete';
import {
MatChipGrid, MatChipRow, MatChipRemove, MatChipInput,
Expand All @@ -27,7 +27,7 @@ import { Option } from 'app/interfaces/option.interface';
import { ChipsProvider } from 'app/modules/forms/ix-forms/components/ix-chips/chips-provider';
import { IxErrorsComponent } from 'app/modules/forms/ix-forms/components/ix-errors/ix-errors.component';
import { IxLabelComponent } from 'app/modules/forms/ix-forms/components/ix-label/ix-label.component';
import { RegisteredControlDirective } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { RegisteredControlDirective, registeredDirectiveConfig } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestOverrideDirective } from 'app/modules/test-id/test-override/test-override.directive';
import { TestDirective } from 'app/modules/test-id/test.directive';
Expand All @@ -46,16 +46,21 @@ import { TestDirective } from 'app/modules/test-id/test.directive';
IxIconComponent,
MatChipRemove,
MatAutocompleteTrigger,
ReactiveFormsModule,
MatChipInput,
MatAutocomplete,
MatOption,
IxErrorsComponent,
MatHint,
AsyncPipe,
TestDirective,
RegisteredControlDirective,
TestOverrideDirective,
RegisteredControlDirective,
],
hostDirectives: [
{ ...registeredDirectiveConfig },
],
})
export class IxChipsComponent implements OnChanges, ControlValueAccessor {
readonly label = input<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
}

<div
ixRegisteredControl
class="input-container"
[class.disabled]="disabledState$ | async"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
OnInit,
ViewChild,
} from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';
import { MatHint } from '@angular/material/form-field';
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
import { Compartment } from '@codemirror/state';
Expand All @@ -29,7 +29,7 @@ import { IxSimpleChanges } from 'app/interfaces/simple-changes.interface';
import { IxErrorsComponent } from 'app/modules/forms/ix-forms/components/ix-errors/ix-errors.component';
import { IxLabelComponent } from 'app/modules/forms/ix-forms/components/ix-label/ix-label.component';
import { IxSelectValue } from 'app/modules/forms/ix-forms/components/ix-select/ix-select.component';
import { RegisteredControlDirective } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { RegisteredControlDirective, registeredDirectiveConfig } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { TestOverrideDirective } from 'app/modules/test-id/test-override/test-override.directive';

@UntilDestroy()
Expand All @@ -43,10 +43,14 @@ import { TestOverrideDirective } from 'app/modules/test-id/test-override/test-ov
IxLabelComponent,
IxErrorsComponent,
MatHint,
ReactiveFormsModule,
AsyncPipe,
TestOverrideDirective,
RegisteredControlDirective,
],
hostDirectives: [
{ ...registeredDirectiveConfig },
],
})
export class IxCodeEditorComponent implements OnChanges, OnInit, AfterViewInit, ControlValueAccessor {
readonly label = input<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<input
#ixInput
matInput
ixRegisteredControl
[value]="selectedOption?.label || textContent"
[placeholder]="allowCustomValue() ? ('Search or enter value' | translate) : ('Search' | translate)"
[disabled]="isDisabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '@angular/core';
import {
ControlValueAccessor, NgControl,
ReactiveFormsModule,
} from '@angular/forms';
import { MatAutocomplete, MatAutocompleteTrigger } from '@angular/material/autocomplete';
import { MatOption } from '@angular/material/core';
Expand All @@ -29,7 +30,7 @@ import { Option } from 'app/interfaces/option.interface';
import { IxComboboxProvider, IxComboboxProviderManager } from 'app/modules/forms/ix-forms/components/ix-combobox/ix-combobox-provider';
import { IxErrorsComponent } from 'app/modules/forms/ix-forms/components/ix-errors/ix-errors.component';
import { IxLabelComponent } from 'app/modules/forms/ix-forms/components/ix-label/ix-label.component';
import { RegisteredControlDirective } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { RegisteredControlDirective, registeredDirectiveConfig } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestOverrideDirective } from 'app/modules/test-id/test-override/test-override.directive';
import { TestDirective } from 'app/modules/test-id/test.directive';
Expand All @@ -51,11 +52,16 @@ import { TestDirective } from 'app/modules/test-id/test.directive';
MatOption,
IxErrorsComponent,
MatHint,
ReactiveFormsModule,
TranslateModule,
RegisteredControlDirective,
TestOverrideDirective,
TestDirective,
RegisteredControlDirective,
],
hostDirectives: [
{ ...registeredDirectiveConfig },
],
})
export class IxComboboxComponent implements ControlValueAccessor, OnInit {
readonly label = input<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
></ix-label>
}

<div class="input-container" ixRegisteredControl>
<div class="input-container">
<mat-datepicker #datepicker></mat-datepicker>
<input
matInput
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
Component, ChangeDetectionStrategy, input, signal,
} from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';
import { DateAdapter } from '@angular/material/core';
import { MatDatepickerInputEvent, MatDatepickerModule } from '@angular/material/datepicker';
import { MatHint, MatSuffix } from '@angular/material/form-field';
Expand All @@ -12,7 +12,7 @@ import { FormatDateTimePipe } from 'app/modules/dates/pipes/format-date-time/for
import { IxDateAdapter } from 'app/modules/dates/services/ix-date-adapter';
import { IxErrorsComponent } from 'app/modules/forms/ix-forms/components/ix-errors/ix-errors.component';
import { IxLabelComponent } from 'app/modules/forms/ix-forms/components/ix-label/ix-label.component';
import { RegisteredControlDirective } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { RegisteredControlDirective, registeredDirectiveConfig } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { TestOverrideDirective } from 'app/modules/test-id/test-override/test-override.directive';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { LocaleService } from 'app/services/locale.service';
Expand All @@ -32,12 +32,16 @@ type OnTouchedFn = () => void;
MatDatepickerModule,
MatHint,
MatInput,
ReactiveFormsModule,
TestDirective,
TestOverrideDirective,
TranslateModule,
MatSuffix,
RegisteredControlDirective,
],
hostDirectives: [
{ ...registeredDirectiveConfig },
],
providers: [
FormatDateTimePipe,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
matInput
type="text"
autocomplete="off"
ixRegisteredControl
[value]="inputValue"
[ixTest]="controlDirective.name"
[required]="required()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
OnInit,
ViewChild,
} from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { ControlValueAccessor, NgControl, ReactiveFormsModule } from '@angular/forms';
import { MatButton } from '@angular/material/button';
import { MatDialog } from '@angular/material/dialog';
import { MatError, MatHint } from '@angular/material/form-field';
Expand All @@ -29,7 +29,7 @@ import { IxErrorsComponent } from 'app/modules/forms/ix-forms/components/ix-erro
import { CreateDatasetDialogComponent } from 'app/modules/forms/ix-forms/components/ix-explorer/create-dataset-dialog/create-dataset-dialog.component';
import { TreeNodeProvider } from 'app/modules/forms/ix-forms/components/ix-explorer/tree-node-provider.interface';
import { IxLabelComponent } from 'app/modules/forms/ix-forms/components/ix-label/ix-label.component';
import { RegisteredControlDirective } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { RegisteredControlDirective, registeredDirectiveConfig } from 'app/modules/forms/ix-forms/directives/registered-control.directive';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { TestOverrideDirective } from 'app/modules/test-id/test-override/test-override.directive';
import { TestDirective } from 'app/modules/test-id/test.directive';
Expand All @@ -54,9 +54,13 @@ import { ErrorHandlerService } from 'app/services/error-handler.service';
TranslateModule,
RequiresRolesDirective,
TestDirective,
ReactiveFormsModule,
TestOverrideDirective,
RegisteredControlDirective,
],
hostDirectives: [
{ ...registeredDirectiveConfig },
],
})
export class IxExplorerComponent implements OnInit, OnChanges, ControlValueAccessor {
readonly label = input<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<input
#fileInput
type="file"
ixRegisteredControl
[accept]="acceptedFiles()"
[ixTest]="controlDirective.name"
[required]="required()"
Expand Down
Loading
Loading