[EC-558] chore: cleanup unused code (#3740)

This commit is contained in:
Andreas Coroiu 2022-10-11 10:50:46 +02:00 committed by GitHub
parent be040080db
commit ea12ee2b10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 12 deletions

View File

@ -18,7 +18,6 @@ export class BitSubmitDirective implements OnInit, OnDestroy {
private _disabled$ = new BehaviorSubject<boolean>(false); private _disabled$ = new BehaviorSubject<boolean>(false);
@Input("bitSubmit") protected handler: FunctionReturningAwaitable; @Input("bitSubmit") protected handler: FunctionReturningAwaitable;
@Input("disableFormOnLoading") protected disableFormOnLoading = false;
readonly loading$ = this._loading$.asObservable(); readonly loading$ = this._loading$.asObservable();
readonly disabled$ = this._disabled$.asObservable(); readonly disabled$ = this._disabled$.asObservable();

View File

@ -1,4 +1,4 @@
import { Component, Input } from "@angular/core"; import { Component } from "@angular/core";
import { FormsModule, ReactiveFormsModule, Validators, FormBuilder } from "@angular/forms"; import { FormsModule, ReactiveFormsModule, Validators, FormBuilder } from "@angular/forms";
import { action } from "@storybook/addon-actions"; import { action } from "@storybook/addon-actions";
import { Meta, moduleMetadata, Story } from "@storybook/angular"; import { Meta, moduleMetadata, Story } from "@storybook/angular";
@ -18,7 +18,7 @@ import { BitSubmitDirective } from "./bit-submit.directive";
import { BitFormButtonDirective } from "./form-button.directive"; import { BitFormButtonDirective } from "./form-button.directive";
const template = ` const template = `
<form [formGroup]="formObj" [bitSubmit]="submit" [disableFormOnLoading]="disableFormOnLoading"> <form [formGroup]="formObj" [bitSubmit]="submit">
<bit-form-field> <bit-form-field>
<bit-label>Name</bit-label> <bit-label>Name</bit-label>
<input bitInput formControlName="name" /> <input bitInput formControlName="name" />
@ -45,8 +45,6 @@ class PromiseExampleComponent {
email: ["", [Validators.required, Validators.email]], email: ["", [Validators.required, Validators.email]],
}); });
@Input() disableFormOnLoading: boolean;
constructor(private formBuilder: FormBuilder) {} constructor(private formBuilder: FormBuilder) {}
submit = async () => { submit = async () => {
@ -78,8 +76,6 @@ class ObservableExampleComponent {
email: ["", [Validators.required, Validators.email]], email: ["", [Validators.required, Validators.email]],
}); });
@Input() disableFormOnLoading: boolean;
constructor(private formBuilder: FormBuilder) {} constructor(private formBuilder: FormBuilder) {}
submit = () => { submit = () => {
@ -136,21 +132,18 @@ export default {
], ],
}), }),
], ],
args: {
disableFormOnLoading: false,
},
} as Meta; } as Meta;
const PromiseTemplate: Story<PromiseExampleComponent> = (args: PromiseExampleComponent) => ({ const PromiseTemplate: Story<PromiseExampleComponent> = (args: PromiseExampleComponent) => ({
props: args, props: args,
template: `<app-promise-example [disableFormOnLoading]="disableFormOnLoading"></app-promise-example>`, template: `<app-promise-example></app-promise-example>`,
}); });
export const UsingPromise = PromiseTemplate.bind({}); export const UsingPromise = PromiseTemplate.bind({});
const ObservableTemplate: Story<PromiseExampleComponent> = (args: PromiseExampleComponent) => ({ const ObservableTemplate: Story<PromiseExampleComponent> = (args: PromiseExampleComponent) => ({
props: args, props: args,
template: `<app-observable-example [disableFormOnLoading]="disableFormOnLoading"></app-observable-example>`, template: `<app-observable-example></app-observable-example>`,
}); });
export const UsingObservable = ObservableTemplate.bind({}); export const UsingObservable = ObservableTemplate.bind({});