Skip to content

Commit

Permalink
feat: upgraded dbx loading components and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Burgman committed Jan 28, 2022
1 parent e72c381 commit 797d576
Show file tree
Hide file tree
Showing 81 changed files with 417 additions and 269 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# initialize nx
- nx/set-shas
# build content
- run: npx nx affected --base=$NX_BASE --target=build --parallel --max-parallel=3
- run: npx nx affected --base=$NX_BASE --target=build --parallel --max-parallel=2
# persist builds to workspace
- persist_to_workspace:
root: ~/code
Expand Down
5 changes: 3 additions & 2 deletions packages/dbx-core/src/lib/util/view.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ChangeDetectorRef, ViewRef, ElementRef } from "@angular/core";
import { Maybe } from "@dereekb/util";

/**
* Triggers a detection change on the input view as long as the view has not been destroyed.
Expand All @@ -24,11 +25,11 @@ export function safeDetectChanges(cdRef: ChangeDetectorRef): void {
* <ng-content select="[content]"></ng-content>
* </div>
*/
export function checkNgContentWrapperHasContent(ref: ElementRef<Element> | undefined): boolean {
export function checkNgContentWrapperHasContent(ref: Maybe<ElementRef<Element>>): boolean {
// https://github.com/angular/angular/issues/26083
let hasContent = false;

if (ref) {
if (ref != null) {
const childNodes = ref.nativeElement.childNodes;
const hasChildNodes = childNodes && childNodes.length > 0;
hasContent = Boolean(hasChildNodes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface ChecklistItemFormlyFieldConfig<T = any> extends DbNgxChecklistI

@Component({
templateUrl: 'checklist.item.field.component.html',
styleUrls: ['./checklist.item.scss']
// TODO: styleUrls: ['./checklist.item.scss']
})
export class DbNgxChecklistItemFieldComponent<T = any> extends FieldType<ChecklistItemFormlyFieldConfig<T>> implements OnInit, OnDestroy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ChecklistItemDisplayContent, ChecklistItemFieldDisplayComponent } from
<div *ngIf="description" class="dbx-hint item-description">{{ description }}</div>
</div>
`,
styleUrls: ['./checklist.item.scss']
// TODO: styleUrls: ['./checklist.item.scss']
})
export class DbNgxDefaultChecklistItemFieldDisplayComponent implements ChecklistItemFieldDisplayComponent<any> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface FormComponentFieldFieldConfig<T extends FormComponentFieldWrapp
template: `
<div class="form-wrapped-component" dbx-injected-content [config]="config"></div>
`,
styleUrls: ['./fields.scss']
// TODO: styleUrls: ['./fields.scss']
})
export class FormComponentFieldComponent<T extends FormComponentFieldWrappedComponent = any> extends FieldType<FormComponentFieldFieldConfig<T>> implements OnInit {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export interface DateTimeFormlyFieldConfig extends DbNgxDateTimeFieldConfig, For

@Component({
templateUrl: 'datetime.field.component.html',
styleUrls: ['./date.scss']
// TODO: styleUrls: ['./date.scss']
})
export class DbNgxDateTimeFieldComponent extends FieldType<DateTimeFormlyFieldConfig> implements OnInit, OnDestroy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface EnumValueFieldsFormlyFieldConfig<T> extends EnumValueFieldsFiel

@Component({
templateUrl: 'dynamic.enum.field.component.html',
styleUrls: ['./generic.scss']
// TODO: styleUrls: ['./generic.scss']
})
export class DbNgxDynamicEnumFieldComponent<T> extends FieldType<EnumValueFieldsFormlyFieldConfig<T>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AbstractDbNgxPickableItemFieldDirective, PickableItemFieldItem } from "
*/
@Component({
templateUrl: 'pickable.chip.field.component.html',
styleUrls: ['./generic.scss']
// TODO: styleUrls: ['./generic.scss']
})
export class DbNgxPickableChipFieldComponent<T> extends AbstractDbNgxPickableItemFieldDirective<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AbstractDbNgxPickableItemFieldDirective, PickableItemFieldItem } from "
*/
@Component({
templateUrl: 'pickable.list.field.component.html',
styleUrls: ['./generic.scss']
// TODO: styleUrls: ['./generic.scss']
})
export class DbNgxPickableListFieldComponent<T> extends AbstractDbNgxPickableItemFieldDirective<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface FormRepeatTypeTemplateOptions extends FormlyTemplateOptions, Fo
</div>
</div>
`,
styleUrls: ['./generic.scss']
// TODO: styleUrls: ['./generic.scss']
})
export class DbNgxFormRepeatTypeComponent extends FieldArrayType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface SearchableChipValueFieldsFormlyFieldConfig<T> extends Searchabl

@Component({
templateUrl: 'searchable.chip.field.component.html',
styleUrls: ['./generic.scss']
// TODO: styleUrls: ['./generic.scss']
})
export class DbNgxSearchableChipFieldComponent<T> extends AbstractDbNgxSearchableValueFieldDirective<T, SearchableChipValueFieldsFormlyFieldConfig<T>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface SearchableTextValueFieldsFormlyFieldConfig<T> extends Searchabl
*/
@Component({
templateUrl: 'searchable.text.field.component.html',
styleUrls: ['./generic.scss']
// TODO: styleUrls: ['./generic.scss']
})
export class DbNgxSearchableTextFieldComponent<T> extends AbstractDbNgxSearchableValueFieldDirective<T, SearchableTextValueFieldsFormlyFieldConfig<T>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const DEFAULT_PREFERRED_COUNTRIES = ['us'];

@Component({
templateUrl: 'phone.field.component.html',
styleUrls: ['./phone.scss']
// TODO: styleUrls: ['./phone.scss']
})
export class DbNgxInternationalPhoneFieldComponent extends FieldType<InternationalPhoneFormlyFieldConfig> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface TextEditorComponentFieldConfig extends FormlyFieldConfig {
</div>
</div>
`,
styleUrls: ['./texteditor.scss']
// TODO: styleUrls: ['./texteditor.scss']
})
export class TextEditorFieldComponent<T extends TextEditorComponentFieldConfig = TextEditorComponentFieldConfig> extends FieldType<T> implements OnInit, OnDestroy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { delay } from 'rxjs/operators';
*/
@Component({
template: `<ng-container #fieldComponent></ng-container>`,
styleUrls: ['./wrapper.scss']
// TODO: styleUrls: ['./wrapper.scss']
})
export class AutoTouchFieldWrapperComponent extends FieldWrapper implements OnInit {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export interface FormExpandableSectionWrapperTemplateOptions<T = any> extends Fo
</ng-container>
</ng-container>
`,
styleUrls: ['./wrapper.scss']
// TODO: styleUrls: ['./wrapper.scss']
})
export class FormExpandableSectionWrapperComponent<T = any> extends AbstractFormExpandableSectionWrapperDirective<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import { FieldWrapper } from '@ngx-formly/core';
<ng-container #fieldComponent></ng-container>
</div>
`,
styleUrls: ['./wrapper.scss']
// TODO: styleUrls: ['./wrapper.scss']
})
export class FormFlexWrapperComponent extends FieldWrapper { }
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface FormInfoSectionWrapperTemplateOptions<T = any> extends FormlyTe
</div>
</div>
`,
styleUrls: ['./wrapper.scss']
// TODO: styleUrls: ['./wrapper.scss']
})
export class FormInfoSectionWrapperComponent<T> extends FieldWrapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FieldWrapper } from '@ngx-formly/core';
<dbx-hint *ngIf="description">{{ description }}</dbx-hint>
</div>
`,
styleUrls: ['./wrapper.scss']
// TODO: styleUrls: ['./wrapper.scss']
})
export class FormSectionWrapperComponent extends FieldWrapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FieldWrapper } from '@ngx-formly/core';
<dbx-hint *ngIf="description"><small>{{ description }}</small></dbx-hint>
</div>
`,
styleUrls: ['./wrapper.scss']
// TODO: styleUrls: ['./wrapper.scss']
})
export class FormSubsectionWrapperComponent extends FieldWrapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface FormToggleSectionWrapperTemplateOptions<T = any> extends Formly
</ng-container>
</div>
`,
styleUrls: ['./wrapper.scss']
// TODO: styleUrls: ['./wrapper.scss']
})
export class FormToggleSectionWrapperComponent<T = any> extends AbstractFormExpandableSectionWrapperDirective<T> {

Expand Down
2 changes: 1 addition & 1 deletion packages/dbx-form/src/lib/formly/formly.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { cloneDeep } from 'lodash';
<formly-form [form]="form" [fields]="fields" [model]="model"></formly-form>
</form>
`,
styleUrls: ['./form.scss'],
// TODO: styleUrls: ['./form.scss'],
})
export class DbNgxFormlyComponent<T extends object> extends AbstractSubscriptionDirective implements DbNgxFormlyContextDelegate<T>, OnInit, OnDestroy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ActionContextStoreSourceInstance, ActionState, DbNgxActionSnackbarCompo
</ng-container>
</div>
`,
styleUrls: ['./action.scss']
// TODO: styleUrls: ['./action.scss']
})
export class DbNgxActionSnackbarComponent {

Expand Down
2 changes: 1 addition & 1 deletion packages/dbx-web/src/lib/button/button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export enum DbNgxButtonDisplayType {
template: `
<mat-spinner-button class="page-button" (btnClick)="clickButton()" [options]="btnOptions"></mat-spinner-button>
`,
styleUrls: ['./button.scss'],
// TODO: styleUrls: ['./button.scss'],
providers: ProvideDbNgxButton(DbNgxButtonComponent)
})
export class DbNgxButtonComponent extends AbstractDbNgxButtonDirective {
Expand Down
2 changes: 1 addition & 1 deletion packages/dbx-web/src/lib/button/button.spacer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'dbx-button-spacer',
template: `<span class="button-spacer"></span>`,
styleUrls: ['./button.scss']
// TODO: styleUrls: ['./button.scss']
})
export class DbNgxButtonSpacerComponent { }
2 changes: 1 addition & 1 deletion packages/dbx-web/src/lib/error/error.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ErrorInput, convertToReadableError, ReadableError } from '@dereekb/util
@Component({
selector: 'dbx-error',
templateUrl: './error.component.html',
styleUrls: ['./error.scss']
// TODO: styleUrls: ['./error.scss']
})
export class DbNgxReadableErrorComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export interface FullDbNgxPopoverComponentConfig<I, O, T> extends DbNgxPopoverCo
</div>
</dbx-popover-coordinator>
`,
styleUrls: ['./popover.scss'],
// TODO: styleUrls: ['./popover.scss'],
providers: [{
provide: DbNgxPopoverController,
useExisting: DbNgxPopoverComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { throttleTime } from 'rxjs/operators';
</div>
</div>
`,
styleUrls: ['./popover.scss']
// TODO: styleUrls: ['./popover.scss']
})
export class DbNgxPopoverContentComponent implements OnDestroy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DbNgxPopoverContentComponent } from './popover.content.component';
<ng-content></ng-content>
</div>
`,
styleUrls: ['./popover.scss']
// TODO: styleUrls: ['./popover.scss']
})
export class DbNgxPopoverControlsComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { delay, map, shareReplay } from 'rxjs/operators';
<ng-content></ng-content>
</ng-container>
`,
styleUrls: ['./popover.scss']
// TODO: styleUrls: ['./popover.scss']
})
export class DbNgxPopoverCoordinatorComponent implements OnInit, OnDestroy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { DbNgxPopoverContentComponent } from './popover.content.component';
</div>
<mat-divider></mat-divider>
`,
styleUrls: ['./popover.scss']
// TODO: styleUrls: ['./popover.scss']
})
export class DbNgxPopoverHeaderComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DbNgxPopoverContentComponent } from './popover.content.component';
<ng-content></ng-content>
</div>
`,
styleUrls: ['./popover.scss']
// TODO: styleUrls: ['./popover.scss']
})
export class DbNgxPopoverScrollContentComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface DbNgxPopupComponentConfig<I, O, T> {
</div>
</dbx-popup-coordinator>
`,
styleUrls: ['./popup.scss'],
// TODO: styleUrls: ['./popup.scss'],
providers: [{
provide: DbNgxPopupController,
useExisting: DbNgxPopupComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DbNgxPopupController, DbNgxPopupWindowState } from './popup.component';
</div>
</div>
`,
styleUrls: ['./popup.scss']
// TODO: styleUrls: ['./popup.scss']
})
export class DbNgxPopupContentComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DbNgxPopupController, DbNgxPopupWindowState } from './popup.component';
<dbx-button [flat]="true" icon="close" color="warn" (buttonClick)="closeClicked()"></dbx-button>
</span>
`,
styleUrls: ['./popup.scss']
// TODO: styleUrls: ['./popup.scss']
})
export class DbNgxPopupControlButtonsComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Component, Input } from '@angular/core';
<dbx-popup-control-buttons></dbx-popup-control-buttons>
</div>
`,
styleUrls: ['./popup.scss']
// TODO: styleUrls: ['./popup.scss']
})
export class DbNgxPopupControlsComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { delay, map, shareReplay } from 'rxjs/operators';
<ng-content></ng-content>
</ng-container>
`,
styleUrls: ['./popup.scss']
// TODO: styleUrls: ['./popup.scss']
})
export class DbNgxPopupCoordinatorComponent implements OnInit, OnDestroy {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Component, Input } from '@angular/core';
<ng-content></ng-content>
</div>
`,
styleUrls: ['./prompt.scss']
// TODO: styleUrls: ['./prompt.scss']
})
export class DbNgxPromptBoxComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DbNgxPromptBoxComponent } from './prompt.box.component';
@Component({
selector: 'dbx-prompt',
templateUrl: './prompt.component.html',
styleUrls: ['./prompt.scss']
// TODO: styleUrls: ['./prompt.scss']
})
export class DbNgxPromptComponent extends DbNgxPromptBoxComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface DbNgxPromptConfirmConfig {
@Component({
selector: 'dbx-prompt-confirm',
templateUrl: './prompt.confirm.component.html',
styleUrls: ['./prompt.scss']
// TODO: styleUrls: ['./prompt.scss']
})
export class DbNgxPromptConfirmComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import { Component } from '@angular/core';
</dbx-full-width-content-container>
</div>
`,
styleUrls: ['./prompt.scss']
// TODO: styleUrls: ['./prompt.scss']
})
export class DbNgxPromptPageComponent { }
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { MatIconModule } from '@angular/material/icon';
import { DbNgxCardBoxContainerComponent } from './card.box.container.component';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { DbNgxCardBoxComponent } from './card.box.component';

@NgModule({
imports: [
CommonModule
CommonModule,
MatIconModule
],
declarations: [
DbNgxCardBoxComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import { Component, Input } from '@angular/core';
<ng-content></ng-content>
</div>
`,
styleUrls: ['./container.scss']
// TODO: styleUrls: ['./container.scss']
})
export class DbNgxBorderedContentComponent { }
Loading

0 comments on commit 797d576

Please sign in to comment.