Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add datasetRef in detailed block view for SetTransform event. #111

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,208 changes: 631 additions & 577 deletions resources/schema.graphql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fragment DatasetTransform on SetTransform {
dataset {
...DatasetBasics
}
datasetRef
}
transform {
...DatasetTransformContent
Expand Down
5 changes: 5 additions & 0 deletions src/app/api/kamu.graphql.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type Scalars = {
AccountName: any;
DatasetID: any;
DatasetName: any;
DatasetRefAny: any;
/**
* Implement the DateTime<Utc> scalar
*
Expand Down Expand Up @@ -170,6 +171,7 @@ export type CreateDatasetResultMissingInputs =
export type CreateDatasetResultNameCollision = CreateDatasetFromSnapshotResult &
CreateDatasetResult & {
__typename?: "CreateDatasetResultNameCollision";
accountName?: Maybe<Scalars["AccountName"]>;
datasetName: Scalars["DatasetName"];
message: Scalars["String"];
};
Expand Down Expand Up @@ -980,6 +982,7 @@ export type Transform = TransformSql;
export type TransformInput = {
__typename?: "TransformInput";
dataset: Dataset;
datasetRef?: Maybe<Scalars["DatasetRefAny"]>;
id?: Maybe<Scalars["DatasetID"]>;
name: Scalars["DatasetName"];
};
Expand Down Expand Up @@ -1742,6 +1745,7 @@ export type DatasetTransformFragment = {
inputs: Array<{
__typename?: "TransformInput";
name: any;
datasetRef?: any | null;
dataset: { __typename?: "Dataset" } & DatasetBasicsFragment;
}>;
transform: {
Expand Down Expand Up @@ -2158,6 +2162,7 @@ export const DatasetTransformFragmentDoc = gql`
dataset {
...DatasetBasics
}
datasetRef
}
transform {
...DatasetTransformContent
Expand Down
2 changes: 2 additions & 0 deletions src/app/common/tooltips/set-transform.text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ export class SetTransformToolipsTexts {
public static readonly DATASET_NAME = "Name of the dataset.";
public static readonly DATASET_OWNER = "Owner of the dataset.";
public static readonly DATASET_ALIAS = "Query alias of the dataset.";
public static readonly DATASET_REF =
"A local or remote dataset reference to use in dataset resolutions.";
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,12 @@ export const SET_TRANSFORM_SOURCE_DESCRIPTORS: EventRowDescriptorsByField = {
separateRowForValue: false,
dataTestId: "set-transform-dataset-alias",
},

"SetTransform.Dataset.datasetRef": {
label: "Dataset reference:",
tooltip: SetTransformToolipsTexts.DATASET_REF,
presentationComponent: SimplePropertyComponent,
separateRowForValue: false,
dataTestId: "set-transform-dataset-dataset-ref",
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ export class SetTransformSectionBuilder extends EventSectionBuilder<SetTransform
const numInputsParts = event.inputs.length;
(data as TransformInput[]).forEach((item, index) => {
const rows: EventRow[] = [];
Object.entries({
...item.dataset,
alias: item.name as string,
}).forEach(([key, value]) => {
const object = item.datasetRef
? {
...item.dataset,
alias: item.name as string,
datasetRef: item.datasetRef as string,
}
: {
...item.dataset,
alias: item.name as string,
};
Object.entries(object).forEach(([key, value]) => {
if (
event.__typename &&
item.dataset.__typename &&
Expand Down Expand Up @@ -93,6 +100,7 @@ export class SetTransformSectionBuilder extends EventSectionBuilder<SetTransform
return this.kindDatasetCapitalize(value as string);
case "name":
return inputItem.dataset.id;

default:
return value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@
<app-stepper-navigation
[prevStep]="steps.PREPROCESS"
[nextStep]="null"
[validStep]="mergeForm.valid"
[validAllSteps]="pollingSourceForm.valid"
[validStep]="pollingSourceForm.valid"
(changeStepEmitter)="changeStep($event)"
(saveEventEmitter)="onSubmit()"
(editYamlEmitter)="onEditYaml()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ export class EditSetTransformService extends BaseYamlEventService {
inputDatasets: Set<string>,
engine: string,
queries: Omit<SqlQueryStep, "__typename">[],
// owners: string[],
): Omit<SetTransform, "__typename"> {
return {
// inputs: this.transformInputsDatasets(
// this.parseInputDatasets(inputDatasets),
// owners,
// ),
inputs: this.parseInputDatasets(inputDatasets),
transform: {
kind: "sql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ export class SetTransformComponent extends BaseComponent implements OnInit {
this.inputDatasets,
this.selectedEngine,
this.queries,
// this.owners(),
),
);
instance.datasetInfo = this.getDatasetInfoFromUrl();
Expand All @@ -180,7 +179,6 @@ export class SetTransformComponent extends BaseComponent implements OnInit {
this.inputDatasets,
this.selectedEngine,
this.queries,
// this.owners(),
),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
(click)="saveEvent()"
class="button-save"
data-test-id="save-button"
[disabled]="!validStep || !validAllSteps"
[disabled]="!validStep"
>
Save
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ describe("StepperNavigationComponent", () => {
component.prevStep = SetPollingSourceSection.READ;
component.validStep = true;
component.nextStep = null;
component.validAllSteps = true;
fixture.detectChanges();
emitClickOnElementByDataTestId(fixture, "save-button");
expect(changeStepEmitterSpy).toHaveBeenCalledWith();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class StepperNavigationComponent {
@Input() public nextStep: MaybeNull<SetPollingSourceSection> = null;
@Input() public prevStep: MaybeNull<SetPollingSourceSection> = null;
@Input() public validStep?: boolean;
@Input() public validAllSteps? = false;
@Output() public changeStepEmitter =
new EventEmitter<SetPollingSourceSection>();
@Output() public saveEventEmitter = new EventEmitter<null>();
Expand Down
Loading