Skip to content

Commit

Permalink
Merge pull request #77 from fantonangeli/sync-main
Browse files Browse the repository at this point in the history
Sync main branch with Apache main branch
  • Loading branch information
rgdoliveira authored Feb 10, 2025
2 parents cf478fd + 791b395 commit 10e7c0e
Show file tree
Hide file tree
Showing 67 changed files with 1,239 additions and 231 deletions.
12 changes: 12 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,16 @@ workflow-subflow-custom.sw.yaml
workflow.sw.yaml
# packages/kn-plugin-workflow/pkg/specs/testdata/workflow2.sw.yaml
workflow2.sw.yaml
# packages/kn-plugin-workflow/pkg/command/quarkus/testdata/docker/Dockerfile.jvm
Dockerfile.jvm
# packages/kn-plugin-workflow/pkg/command/quarkus/testdata/docker/Dockerfile.native
Dockerfile.native
# packages/kn-plugin-workflow/pkg/command/quarkus/testdata/docker/Dockerfile.legacy-jar
Dockerfile.legacy-jar
# packages/kn-plugin-workflow/pkg/command/quarkus/testdata/docker/Dockerfile.native-micro
Dockerfile.native-micro
packages/kn-plugin-workflow/pkg/command/quarkus/testdata/dockerignore
dockerignore
# packages/maven-base/kie-tools-maven-base.iml
kie-tools-maven-base.iml
# packages/maven-base/settings.xml
Expand Down Expand Up @@ -1032,6 +1042,8 @@ go.sum
sonataflow-quarkus-devui-parent.iml
# packages/stunner-editors/stunner-editors-parent.iml
stunner-editors-parent.iml
# packages/kogito-db-migrator-tool/kogito-db-migrator-tool.iml
kogito-db-migrator-tool.iml
# packages/stunner-editors/drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-api/src/main/resources/META-INF/beans.xml
beans.xml
# packages/stunner-editors/drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-kogito-marshaller/src/main/java/.gitkeep
Expand Down
1 change: 1 addition & 0 deletions _intellij-project/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions _intellij-project/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ enum DecisionTableColumnType {
OutputClause = "output",
Annotation = "annotation",
}

export const DECISION_TABLE_INPUT_DEFAULT_VALUE = "-";
export const DECISION_TABLE_OUTPUT_DEFAULT_VALUE = "";
export const DECISION_TABLE_ANNOTATION_DEFAULT_VALUE = "";
Expand Down Expand Up @@ -777,7 +776,15 @@ export function DecisionTableExpression({
});
}

const nextOutputColumns = [...(prev.output ?? [])];
const nextOutputColumns = [
...(prev.output ?? []).map((outputColumn, index) => {
const outputCopy = { ...outputColumn };
if (outputCopy["@_name"] === undefined) {
outputCopy["@_name"] = `Output-${index + 1}`;
}
return outputCopy;
}),
];
for (/* Add new columns */ let i = 0; i < outputColumnsToAdd.length; i++) {
nextOutputColumns.splice(localIndexInsideGroup + i, 0, outputColumnsToAdd[i]);
}
Expand Down Expand Up @@ -851,7 +858,7 @@ export function DecisionTableExpression({
: DECISION_TABLE_ANNOTATION_DEFAULT_WIDTH;

const nextValues = [...prev];
const minValuesLength = args.beforeIndex + 1 + args.columnsCount;
const minValuesLength = args.beforeIndex + args.columnsCount;
nextValues.push(...Array(Math.max(0, minValuesLength - nextValues.length)));
for (let i = 0; i < args.columnsCount; i++) {
const widthIndex = args.beforeIndex + i + 1; // + 1 to account for the rowIndex column.
Expand Down Expand Up @@ -895,11 +902,21 @@ export function DecisionTableExpression({
case DecisionTableColumnType.OutputClause:
const newOutputs = [...(prev.output ?? [])];
newOutputs.splice(localIndexInsideGroup, 1);

//Output name shouldn't be displayed when there is single output column(kie-issues#1466)
const updatedOutputForSingleOutputColumns = [
...(newOutputs ?? []).map((outputColumn) => {
const outputCopy = { ...outputColumn };
if (newOutputs.length === 1) {
outputCopy["@_name"] = undefined;
outputCopy["@_typeRef"] = undefined;
}
return outputCopy;
}),
];
// Do not inline this variable for type safety. See https://github.com/microsoft/TypeScript/issues/241
const retOutput: Normalized<BoxedDecisionTable> = {
...prev,
output: newOutputs,
output: updatedOutputForSingleOutputColumns,
rule: [...(prev.rule ?? [])].map((rule) => {
const newOutputEntry = [...rule.outputEntry];
newOutputEntry.splice(localIndexInsideGroup, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export function getDefaultBoxedExpression({
return relationExpression;
} else if (logicType === "decisionTable") {
const singleOutputColumn = {
name: "Output-1",
name: undefined,
typeRef: dataType?.feelName,
};
const singleInputColumn = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export function DecisionTableOutputHeaderCell(props: {
const activeDrgElementId = useDmnEditorStore((s) => s.boxedExpressionEditor.activeDrgElementId);
const { dmnEditorRootElementRef } = useDmnEditor();
const { externalModelsByNamespace } = useExternalModels();

const node = useDmnEditorStore((s) =>
s
.computed(s)
Expand Down Expand Up @@ -172,29 +171,35 @@ export function DecisionTableOutputHeaderCell(props: {
/>
</>
)}
<NameField
alternativeFieldName={root?.output.length === 1 ? "Column Name" : undefined}
isReadOnly={props.isReadOnly}
id={cell["@_id"]!}
name={cell?.["@_name"] ?? ""}
getAllUniqueNames={getAllUniqueNames}
onChange={(newName) =>
updater((dmnObject) => {
dmnObject["@_name"] = newName;
})
}
/>
<TypeRefField
alternativeFieldName={root?.output.length === 1 ? "Column Type" : undefined}
isReadOnly={cellMustHaveSameTypeAsRoot ? true : props.isReadOnly}
dmnEditorRootElementRef={dmnEditorRootElementRef}
typeRef={cellMustHaveSameTypeAsRoot ? root?.["@_typeRef"] : cell?.["@_typeRef"]}
onChange={(newTypeRef) =>
updater((dmnObject) => {
dmnObject["@_typeRef"] = newTypeRef;
})
}
/>
{root?.output && root.output.length > 1 ? (
<NameField
isReadOnly={props.isReadOnly}
id={cell["@_id"]!}
name={cell?.["@_name"] ?? ""}
getAllUniqueNames={getAllUniqueNames}
onChange={(newName) =>
updater((dmnObject) => {
dmnObject["@_name"] = newName;
})
}
/>
) : (
""
)}
{root?.output && root.output.length > 1 ? (
<TypeRefField
isReadOnly={cellMustHaveSameTypeAsRoot ? true : props.isReadOnly}
dmnEditorRootElementRef={dmnEditorRootElementRef}
typeRef={cellMustHaveSameTypeAsRoot ? root?.["@_typeRef"] : cell?.["@_typeRef"]}
onChange={(newTypeRef) =>
updater((dmnObject) => {
dmnObject["@_typeRef"] = newTypeRef;
})
}
/>
) : (
""
)}
{itemDefinition && (
<FormGroup label="Constraint">
<ConstraintsFromTypeConstraintAttribute
Expand Down
Loading

0 comments on commit 10e7c0e

Please sign in to comment.