Skip to content

Commit

Permalink
chore: update dependencies (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherPHolder committed Apr 2, 2024
2 parents 24c2aa6 + 6840c6d commit 259a0c2
Show file tree
Hide file tree
Showing 38 changed files with 6,132 additions and 3,526 deletions.
2 changes: 1 addition & 1 deletion libs/aws-deploy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@app-speed/aws-deploy",
"version": "0.0.1",
"dependencies": {
"@nx/devkit": "18.0.4"
"@nx/devkit": "18.2.1"
},
"type": "commonjs",
"main": "./src/index.js",
Expand Down
22 changes: 0 additions & 22 deletions libs/feature/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,6 @@
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "lib",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "lib",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
Expand Down
40 changes: 40 additions & 0 deletions libs/feature/audit-builder/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"extends": ["../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "builder",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "builder",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type DialogAction = {
export type DialogActions = DialogAction[];

@Component({
selector: 'lib-step-action-dialog',
selector: 'builder-step-action-dialog',
standalone: true,
imports: [MatButtonModule, MatIconModule, MatMenuModule],
template: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { AuditDetails } from '../schema/types';

@Component({
standalone: true,
selector: 'lib-builder-container',
selector: 'builder-container',
template: `
<form
*rxIf='auditInit$'
Expand All @@ -32,9 +32,9 @@ import { AuditDetails } from '../schema/types';
>
<mat-card>
<mat-card-content>
<lib-audit-global />
<builder-audit-global />
<mat-accordion [multi]='true'>
<lib-audit-step *rxFor='let control of builder.steps.controls; let idx = index;' [stepIndex]='idx' />
<builder-audit-step *rxFor='let control of builder.steps.controls; let idx = index;' [stepIndex]='idx' />
</mat-accordion>
</mat-card-content>
</mat-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class AuditBuilderService {
auditInit$(initialAuditDetails$: Observable<AuditDetails>): Observable<boolean> {
return initialAuditDetails$.pipe(
tap((details) => {
this.formGroup.controls.title.setValue(details?.title);
this.formGroup.controls.title.setValue(details.title);
this.formGroup.controls.device.setValue(details.device);
this.formGroup.controls.timeout.setValue(details.timeout);
details.steps.forEach((step, index) => this.initStep(step, index));
Expand Down Expand Up @@ -79,7 +79,13 @@ export class AuditBuilderService {

private getPropertyValue(inputType: InputType, property?: InputValue, defaultValue?: InputValue): InputValue {
const isValid = INPUT_TYPE_VALIDATOR[inputType];
return isValid(property) ? property! : isValid(defaultValue) ? defaultValue! : PROPERTY_DEFAULT[inputType];
if (isValid(property)) {
return property;
}
if (isValid(defaultValue)) {
return defaultValue;
}
return PROPERTY_DEFAULT[inputType];
}

private typedKeys<T extends object>(obj: T): (keyof T)[] {
Expand Down Expand Up @@ -112,8 +118,7 @@ export class AuditBuilderService {

getStepPropertySchema(index: number, name: PropertyName): StepProperty {
const stepType = this.formGroup.controls.steps.at(index).controls.type!.value!
const stepPropertiesSchema = this.getStepSchema(stepType).properties
return stepPropertiesSchema.find((schema) => schema.name === name)!;
return this.getStepSchema(stepType).properties.find((schema) => schema.name === name)!;
}

removeStep(index: number): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AuditBuilderService } from './audit-builder.service';
import { DEVICE_TYPE } from '../schema/audit.constants';

@Component({
selector: 'lib-audit-global',
selector: 'builder-audit-global',
standalone: true,
imports: [
RxIf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { StepPropertyComponent } from '../property-input/property.component';
import { MatButtonModule } from '@angular/material/button';

@Component({
selector: 'lib-audit-step',
selector: 'builder-audit-step',
standalone: true,
imports: [
MatExpansionModule,
Expand All @@ -30,9 +30,9 @@ import { MatButtonModule } from '@angular/material/button';
}
</mat-panel-title>
</mat-expansion-panel-header>
<lib-step-action-dialog [stepIndex]='stepIndex' class='toggle_menu'/>
<builder-step-action-dialog [stepIndex]='stepIndex' class='toggle_menu'/>
@for (key of builder.getStepPropertyKeys(stepIndex); track key) {
<lib-step-property [controlKey]='key' [stepIndex]='stepIndex' />
<builder-step-property [controlKey]='key' [stepIndex]='stepIndex' />
}
@for (key of builder.getStepOptionalProperties(stepIndex); track key) {
<button mat-fab [extended]='true' color="primary" (click)='builder.addStepProperty(stepIndex, key)'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { MatSelectModule } from '@angular/material/select';
import { StepProperty } from '../schema/types';

@Component({
selector: 'lib-input-boolean',
selector: 'builder-input-boolean',
standalone: true,
imports: [
MatButtonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MatInputModule } from '@angular/material/input';
import { StepProperty } from '../schema/types';

@Component({
selector: 'lib-input-number',
selector: 'builder-input-number',
standalone: true,
imports: [
MatButtonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { StepProperty } from '../schema/types';

@Component({
selector: 'lib-input-options',
selector: 'builder-input-options',
standalone: true,
imports: [
RxFor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FormControl } from '@angular/forms';
import { StepProperty } from '../schema/types';

@Component({
selector: 'lib-input-records',
selector: 'builder-input-records',
standalone: true,
imports: [
JsonPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MatInputModule } from '@angular/material/input';
import { StepProperty } from '../schema/types';

@Component({
selector: 'lib-input-string-array',
selector: 'builder-input-string-array',
standalone: true,
imports: [MatButtonModule, MatIconModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule],
template: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MatInputModule } from '@angular/material/input';
import { StepProperty } from '../schema/types';

@Component({
selector: 'lib-input-string',
selector: 'builder-input-string',
standalone: true,
imports: [MatButtonModule, MatIconModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule],
template: `
Expand Down
28 changes: 14 additions & 14 deletions libs/feature/audit-builder/src/property-input/property.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, computed, inject, input, Input, signal } from '@angular/core';
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';

import { AuditBuilderService } from '../audit-builder/audit-builder.service';

Expand All @@ -14,7 +14,7 @@ import { INPUT_TYPE, PROPERTY_NAME } from '../schema/property.constants';
import { PropertyName, StepType } from '../schema/types';

@Component({
selector: 'lib-step-property',
selector: 'builder-step-property',
standalone: true,
imports: [
InputStringComponent,
Expand All @@ -27,43 +27,43 @@ import { PropertyName, StepType } from '../schema/types';
template: `
@switch (schema().inputType) {
@case (INPUT_TYPE.STRING) {
<lib-input-string
<builder-input-string
[schema]='schema()'
[control]='$any(control())'
(deleteProperty)='handleDeleteProperty()'
/>
}
@case (INPUT_TYPE.NUMBER) {
<lib-input-number
<builder-input-number
[schema]='schema()'
[control]='$any(control())'
(deleteProperty)='handleDeleteProperty()'
/>
}
@case (INPUT_TYPE.BOOLEAN) {
<lib-input-boolean
<builder-input-boolean
[schema]='schema()'
[control]='$any(control())'
(deleteProperty)='handleDeleteProperty()'
/>
}
@case (INPUT_TYPE.OPTIONS) {
<lib-input-options
<builder-input-options
[schema]='schema()'
[control]='$any(control())'
(deleteProperty)='handleDeleteProperty()'
(selectedChange)='handleSelectedChange($event)'
/>
}
@case (INPUT_TYPE.STRING_ARRAY) {
<lib-input-string-array
<builder-input-string-array
[schema]='schema()'
[control]='$any(control())'
(deleteProperty)='handleDeleteProperty()'
/>
}
@case (INPUT_TYPE.RECORDS) {
<lib-input-records
<builder-input-records
[schema]='schema()'
[control]='$any(control())'
(deleteProperty)='handleDeleteProperty()'
Expand All @@ -75,25 +75,25 @@ import { PropertyName, StepType } from '../schema/types';
})
export class StepPropertyComponent {
protected readonly INPUT_TYPE = INPUT_TYPE;
controlKey = input<PropertyName>();
stepIndex = input<number>();
controlKey = input.required<PropertyName>();
stepIndex = input.required<number>();
private builder = inject(AuditBuilderService);

control = computed(() => {
return this.builder.formGroup.controls.steps.at(this.stepIndex()!).get(this.controlKey()!)
return this.builder.formGroup.controls.steps.at(this.stepIndex()).get(this.controlKey())
})

schema = computed(() => {
return this.builder.getStepPropertySchema(this.stepIndex()!, this.controlKey()!);
return this.builder.getStepPropertySchema(this.stepIndex(), this.controlKey());
})

handleSelectedChange(value: string): void {
if (this.schema().name === PROPERTY_NAME.TYPE) {
this.builder.changeStepType(this.stepIndex()!, value as StepType);
this.builder.changeStepType(this.stepIndex(), value as StepType);
}
}

handleDeleteProperty(): void {
this.builder.removeStepProperty(this.stepIndex()!, this.schema()!.name);
this.builder.removeStepProperty(this.stepIndex(), this.schema().name);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FormArray, FormControl, Validators } from '@angular/forms';
import { variableType } from 'aws-sdk/clients/frauddetector';

export const INPUT_TYPE = {
STRING: 'string',
Expand Down
28 changes: 28 additions & 0 deletions libs/feature/audit-viewer/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": ["../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "viewer",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "viewer",
"style": "kebab-case"
}
]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { Component } from '@angular/core';
import { JsonPipe } from '@angular/common';
import type { FlowResult } from 'lighthouse';
import { example as RESULTS_MOCK } from './mocks/flow-result.mock';
import { AuditSummary, AuditSummaryComponent, StepSummary } from './audit-summary.component';
import { example as RESULTS_MOCK } from '../viewer-container/mocks/flow-result.mock';
import { AuditSummary, AuditSummaryComponent, StepSummary } from '../viewer-container/audit-summary.component';
import { MatCard, MatCardContent, MatCardHeader, MatCardTitle } from '@angular/material/card';
import { ViewerStepStepperComponent } from './viewer-step-stepper.component';
import { ViewerStepDetailComponent } from './viewer-step-details.component';
import { ViewerStepStepperComponent } from '../viewer-container/viewer-step-stepper.component';
import { ViewerStepDetailComponent } from '../viewer-container/viewer-step-details.component';

@Component({
selector: 'lib-viewer-container',
selector: 'viewer-viewer-container',
template: `
<!-- <lib-audit-summary [auditSummary]='auditSummary' />-->
<viewer-audit-summary [auditSummary]='auditSummary' />
@for (step of steps; track step.name) {
<lib-viewer-step-detail [stepDetails]='step'/>
<viewer-step-detail [stepDetails]='step'/>
}
`,
standalone: true,
Expand Down Expand Up @@ -42,7 +42,5 @@ export class AuditViewerContainer {
categories: step.lhr.categories,
};
});
readonly auditSummary: AuditSummary = {
stepSummaries: this.stepSummaries,
}
readonly auditSummary: AuditSummary = { stepSummaries: this.stepSummaries };
}
2 changes: 1 addition & 1 deletion libs/feature/audit-viewer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { AuditViewerContainer } from './viewer-container/audit-viewer.container'
export { AuditViewerContainer } from './container/audit-viewer.container'
Loading

0 comments on commit 259a0c2

Please sign in to comment.