Skip to content

Commit

Permalink
frontend: compile fix (#1697)
Browse files Browse the repository at this point in the history
Some shared-components class names had to be changed during
open-sourcing.

Fixing the naming to match.

Testing done: verified locally (using the build/install scripts from wip
PRs, to test cascade changes as well)

Signed-off-by: ivakoleva <[email protected]>
  • Loading branch information
ivakoleva authored Mar 2, 2023
1 parent 2febcc6 commit 1688c7b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { RouterTestingModule } from '@angular/router/testing';

import { BehaviorSubject, of, Subject } from 'rxjs';

import { FORM_STATE, VMWFormState } from '@versatiledatakit/shared';
import { FORM_STATE, VdkFormState } from '@versatiledatakit/shared';

import {
ComponentModel,
Expand Down Expand Up @@ -307,7 +307,7 @@ describe('DataJobsDetailsModalComponent', () => {

describe('sectionStateChange', () => {
it('makes expected calls for FORM_STATE.SUBMIT', () => {
const vMWFormStateStub = {} as VMWFormState;
const vMWFormStateStub = {} as VdkFormState;
vMWFormStateStub.state = FORM_STATE.SUBMIT;

spyOn(component, 'submitForm').and.callThrough();
Expand All @@ -318,7 +318,7 @@ describe('DataJobsDetailsModalComponent', () => {

describe('sectionStateChange', () => {
it('makes expected calls for FORM_STATE.CAN_EDIT', () => {
const vMWFormStateStub = {} as VMWFormState;
const vMWFormStateStub = {} as VdkFormState;
vMWFormStateStub.state = FORM_STATE.CAN_EDIT;
component.sectionStateChange(vMWFormStateStub);
expect(component.canEditSection).toBeTrue();
Expand All @@ -327,7 +327,7 @@ describe('DataJobsDetailsModalComponent', () => {

describe('sectionStateChange', () => {
it('makes expected calls for FORM_STATE.EDIT', () => {
const vMWFormStateStub = {} as VMWFormState;
const vMWFormStateStub = {} as VdkFormState;
vMWFormStateStub.state = FORM_STATE.EDIT;

component.sectionStateChange(vMWFormStateStub);
Expand All @@ -337,7 +337,7 @@ describe('DataJobsDetailsModalComponent', () => {

describe('doSubmit', () => {
it('makes expected calls for emittingSection description', () => {
const vMWFormStateStub = {} as VMWFormState;
const vMWFormStateStub = {} as VdkFormState;
vMWFormStateStub.emittingSection = 'description';

spyOn(component, 'isDescriptionSubmitEnabled').and.callThrough();
Expand All @@ -346,7 +346,7 @@ describe('DataJobsDetailsModalComponent', () => {
});

it('makes expected calls for emittingSection status', () => {
const vMWFormStateStub = {} as VMWFormState;
const vMWFormStateStub = {} as VdkFormState;
vMWFormStateStub.emittingSection = 'status';

spyOn(component, 'isStatusSubmitEnabled').and.callThrough();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { take } from 'rxjs/operators';

import {
FORM_STATE,
VMWFormState,
VdkFormState,
VmwToastType,
} from '@versatiledatakit/shared';

Expand Down Expand Up @@ -113,9 +113,9 @@ export class DataJobDetailsPageComponent
allowExecutionsByDeployment = false;

tmForm: FormGroup;
formState: VMWFormState;
readFormState: VMWFormState;
editableFormState: VMWFormState;
formState: VdkFormState;
readFormState: VdkFormState;
editableFormState: VdkFormState;

canEditSection = true;

Expand Down Expand Up @@ -161,9 +161,9 @@ export class DataJobDetailsPageComponent
) {
super(componentService, navigationService, activatedRoute);

this.formState = new VMWFormState(FORM_STATE.VIEW);
this.readFormState = new VMWFormState(FORM_STATE.VIEW);
this.editableFormState = new VMWFormState(FORM_STATE.CAN_EDIT);
this.formState = new VdkFormState(FORM_STATE.VIEW);
this.readFormState = new VdkFormState(FORM_STATE.VIEW);
this.editableFormState = new VdkFormState(FORM_STATE.CAN_EDIT);

this.confirmationOptions = new ConfirmationModalOptions();
this.deleteOptions = new DeleteModalOptions();
Expand Down Expand Up @@ -195,7 +195,7 @@ export class DataJobDetailsPageComponent
return !notifications || notifications.length < 1;
}

sectionStateChange(sectionState: VMWFormState) {
sectionStateChange(sectionState: VdkFormState) {
if (sectionState.state === FORM_STATE.CAN_EDIT) {
switch (sectionState.emittingSection) {
case 'status':
Expand All @@ -219,7 +219,7 @@ export class DataJobDetailsPageComponent
}
}

submitForm(event: VMWFormState) {
submitForm(event: VdkFormState) {
if (
event.emittingSection === 'description' &&
this.isDescriptionSubmitEnabled()
Expand All @@ -236,7 +236,7 @@ export class DataJobDetailsPageComponent
}

editOperationEnded() {
this.formState = new VMWFormState(FORM_STATE.CAN_EDIT);
this.formState = new VdkFormState(FORM_STATE.CAN_EDIT);
this.canEditSection = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
ClrSpinnerModule,
} from '@clr/angular';

import { VmwComponentsModule } from '@versatiledatakit/shared';
import { VdkComponentsModule } from '@versatiledatakit/shared';

import { TaurusSharedNgRxModule } from '@versatiledatakit/shared';

Expand Down Expand Up @@ -102,7 +102,7 @@ const routes: Routes = [];
imports: [
CommonModule,
RouterModule.forChild(routes),
VmwComponentsModule.forRoot(),
VdkComponentsModule.forRoot(),
ClrDatagridModule,
ClrSpinnerModule,
ClarityModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ApolloModule } from 'apollo-angular';

import { ClarityModule } from '@clr/angular';

import { VmwComponentsModule } from '@versatiledatakit/shared';
import { VdkComponentsModule } from '@versatiledatakit/shared';

import {
TaurusSharedCoreModule,
Expand Down Expand Up @@ -51,7 +51,7 @@ export function lottiePlayerLoader() {
TaurusSharedNgRxModule.forRootWithDevtools(),
TimeagoModule.forRoot(),
LottieModule.forRoot({ player: lottiePlayerLoader }),
VmwComponentsModule.forRoot(),
VdkComponentsModule.forRoot(),
DataPipelinesModule.forRoot({
defaultOwnerTeamName: 'taurus',
manageConfig: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { By } from '@angular/platform-browser';

import { ClarityModule } from '@clr/angular';

import { FORM_STATE, VDKFormState } from './form-section-container.component';
import { FORM_STATE, VdkFormState } from './form-section-container.component';
import { VdkFormSectionComponent } from '../form-section';
import {
VdkSimpleTranslateModule,
Expand Down Expand Up @@ -108,7 +108,7 @@ class PageObject {
class TestHostComponent {
@ViewChild(VdkFormSectionContainerComponent, { static: false })
child: VdkFormSectionContainerComponent;
formState: VDKFormState;
formState: VdkFormState;

editProfileForm = new FormGroup({
firstName: new FormControl()
Expand Down Expand Up @@ -228,7 +228,7 @@ describe('Form Section Container Component', () => {
fixture.detectChanges();

expect(saveButton.disabled).toEqual(true, 'Save to be disabled');
hostComp.formState = new VDKFormState(FORM_STATE.CAN_EDIT);
hostComp.formState = new VdkFormState(FORM_STATE.CAN_EDIT);
fixture.detectChanges();

expect(page.getReadOnlySectionElements().length).toBe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export enum FORM_STATE {
ERROR,
SUBMIT
}
export class VDKFormState {
export class VdkFormState {
state: FORM_STATE;

/**
Expand Down Expand Up @@ -73,7 +73,7 @@ export class VdkFormSectionContainerComponent {
@Input() cancelBtnAriaLabel = 'Cancel'; //Cancel button text
@Input() saveBtnAriaLabel = 'Save'; //Save button text

@Input('formState') set formState(_formState: VDKFormState) {
@Input('formState') set formState(_formState: VdkFormState) {
if (!_formState) {
return;
}
Expand Down Expand Up @@ -133,7 +133,7 @@ export class VdkFormSectionContainerComponent {

clickEdit() {
this.formStateChange.emit(
new VDKFormState(FORM_STATE.CAN_EDIT, [], this.sectionName)
new VdkFormState(FORM_STATE.CAN_EDIT, [], this.sectionName)
);
if (this.cspForm) {
this.cspForm.form.enable();
Expand All @@ -150,7 +150,7 @@ export class VdkFormSectionContainerComponent {
// @ts-ignore
clickSave(): boolean {
this.formStateChange.emit(
new VDKFormState(FORM_STATE.VIEW, [], this.sectionName)
new VdkFormState(FORM_STATE.VIEW, [], this.sectionName)
);
this.changeSectionState(FORM_STATE.SUBMIT);
if (this.cspForm) {
Expand All @@ -169,7 +169,7 @@ export class VdkFormSectionContainerComponent {
changeSectionState(_sectionState: FORM_STATE) {
if (_sectionState !== this._sectionState) {
this.sectionStateChange.emit(
new VDKFormState(_sectionState, [], this.sectionName)
new VdkFormState(_sectionState, [], this.sectionName)
);
this._sectionState = _sectionState;
}
Expand Down

0 comments on commit 1688c7b

Please sign in to comment.