How to use the cwlts/models/d2sb.SBDraft2ExpressionModel function in cwlts

To help you get started, we’ve selected a few cwlts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rabix / composer / src / app / tool-editor / sections / base-command / base-command-list / base-command-list.component.spec.ts View on Github external
it("should remove the correct expression form the list", () => {
        component.baseCommand = [
            new SBDraft2ExpressionModel("one"),
            new SBDraft2ExpressionModel("two"),
            new SBDraft2ExpressionModel("three")
        ];
        component.model       = mockModel;
        component.ngOnChanges();
        fixture.detectChanges();

        component.removeBaseCommand(1);
        fixture.detectChanges();

        fixture.whenStable().then(() => {

            expect((component.form.get("list") as FormArray).controls.length).toEqual(2, "Did not remove baseCommand");
            expect((component.form.get("list") as FormArray).controls[0].value.toString()).toEqual("one");
            expect((component.form.get("list") as FormArray).controls[1].value.toString()).toEqual("three");
        });
github rabix / composer / src / app / tool-editor / sections / base-command / base-command-list / base-command-list.component.spec.ts View on Github external
it("should remove the correct expression form the list", () => {
        component.baseCommand = [
            new SBDraft2ExpressionModel("one"),
            new SBDraft2ExpressionModel("two"),
            new SBDraft2ExpressionModel("three")
        ];
        component.model       = mockModel;
        component.ngOnChanges();
        fixture.detectChanges();

        component.removeBaseCommand(1);
        fixture.detectChanges();

        fixture.whenStable().then(() => {

            expect((component.form.get("list") as FormArray).controls.length).toEqual(2, "Did not remove baseCommand");
            expect((component.form.get("list") as FormArray).controls[0].value.toString()).toEqual("one");
            expect((component.form.get("list") as FormArray).controls[1].value.toString()).toEqual("three");
        });
github rabix / composer / src / app / tool-editor / sections / base-command / base-command-list / base-command-list.component.spec.ts View on Github external
it("should remove the correct expression form the list", () => {
        component.baseCommand = [
            new SBDraft2ExpressionModel("one"),
            new SBDraft2ExpressionModel("two"),
            new SBDraft2ExpressionModel("three")
        ];
        component.model       = mockModel;
        component.ngOnChanges();
        fixture.detectChanges();

        component.removeBaseCommand(1);
        fixture.detectChanges();

        fixture.whenStable().then(() => {

            expect((component.form.get("list") as FormArray).controls.length).toEqual(2, "Did not remove baseCommand");
            expect((component.form.get("list") as FormArray).controls[0].value.toString()).toEqual("one");
            expect((component.form.get("list") as FormArray).controls[1].value.toString()).toEqual("three");
        });

    });
github rabix / composer / src / app / tool-editor / sections / other / streams / tool-streams.component.spec.ts View on Github external
beforeEach(fakeAsync(() => {
        fixture   = TestBed.createComponent(ToolStreamsComponent);
        component = fixture.componentInstance;

        v1Expr = new V1ExpressionModel("expression");
        d2Expr = new SBDraft2ExpressionModel("expression");

        v1Model = new V1CommandLineToolModel();
        sbDraft2Model = new SBDraft2CommandLineToolModel();

        tick();
    }));
github rabix / composer / src / app / editor-common / components / expression-model-list / expression-model-list.component.ts View on Github external
addExpressionModel(): void {
        const newCmd = {
            id: Guid.generate(),
            model: new SBDraft2ExpressionModel("")
        };

        this.form.addControl(newCmd.id, new FormControl(newCmd.model, [Validators.required, CustomValidators.cwlModel]));
        this.formList.push(newCmd);

        this.form.markAsTouched();
    }
github rabix / composer / src / app / editor-common / components / expression-model-list / expression-model-list.component.ts View on Github external
private addExpressionModel(): void {
        const newCmd = {
            id: this.guidService.generate(),
            model: new SBDraft2ExpressionModel("")
        };

        this.form.addControl(newCmd.id, new FormControl(newCmd.model, [Validators.required, CustomValidators.cwlModel]));
        this.formList.push(newCmd);

        this.form.markAsTouched();
    }
github rabix / composer / src / app / editor-common / components / key-value-component / key-value-list.component.ts View on Github external
addEntry(): void {
        const newEntry = {
            id: Guid.generate(),
            model: {
                key: "",
                value: new SBDraft2ExpressionModel(null, ""),
                readonly: false
            }
        };

        this.keyValueFormList.push(newEntry);
        this.form.addControl(newEntry.id, new FormControl(newEntry.model));
    }
github rabix / composer / src / app / tool-editor / sections / base-command / base-command-list / base-command-list.component.spec.ts View on Github external
beforeEach(fakeAsync(() => {
        fixture   = TestBed.createComponent(BaseCommandListComponent);
        component = fixture.componentInstance;

        d2expr    = new SBDraft2ExpressionModel("expression");
        mockModel = {
            baseCommand: [d2expr, d2expr, d2expr],
            addBaseCommand: () => {
            },
            updateBaseCommand: () => {

            }
        };

        fixture.detectChanges();
        tick();
    }));