Skip to content
Draft
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
2 changes: 1 addition & 1 deletion libs/gui-elements
Submodule gui-elements updated 39 files
+0 −24 CHANGELOG.md
+1 −1 README.md
+3 −0 package.json
+366 −507 src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx
+32 −157 src/cmem/react-flow/ReactFlow/ReactFlow.tsx
+0 −54 src/cmem/react-flow/ReactFlow/ReactFlowV10.tsx
+0 −54 src/cmem/react-flow/ReactFlow/ReactFlowV12.tsx
+0 −29 src/cmem/react-flow/ReactFlow/ReactFlowV9.tsx
+1 −3 src/cmem/react-flow/configuration/graph.ts
+1 −3 src/cmem/react-flow/configuration/linking.ts
+1 −3 src/cmem/react-flow/configuration/workflow.ts
+21 −19 src/cmem/react-flow/extensions/scrollOnDragHook.ts
+0 −267 src/cmem/react-flow/extensions/scrollOnDragHookV10.ts
+1 −2 src/cmem/react-flow/index.ts
+0 −7 src/components/AutoSuggestion/AutoSuggestionList.tsx
+1 −2 src/components/Dialog/Modal.tsx
+1 −2 src/components/Dialog/SimpleDialog.tsx
+1 −1 src/components/Tooltip/Tooltip.tsx
+1 −1 src/extensions/codemirror/CodeMirror.tsx
+2 −0 src/extensions/index.ts
+2 −24 src/extensions/react-flow/_react-flow_v12.scss
+4 −10 src/extensions/react-flow/edges/_edges.scss
+1 −3 src/extensions/react-flow/edges/edgeTypes.ts
+32 −48 src/extensions/react-flow/handles/HandleDefault.tsx
+0 −4 src/extensions/react-flow/index.ts
+18 −12 src/extensions/react-flow/minimap/MiniMap.stories.tsx
+0 −154 src/extensions/react-flow/minimap/MiniMapV10.tsx
+0 −50 src/extensions/react-flow/minimap/MiniMapV12.tsx
+0 −12 src/extensions/react-flow/minimap/_minimap.scss
+112 −139 src/extensions/react-flow/nodes/NodeContent.tsx
+5 −11 src/extensions/react-flow/nodes/NodeDefault.tsx
+17 −23 src/extensions/react-flow/nodes/_nodes.scss
+1 −3 src/extensions/react-flow/nodes/nodeTypes.ts
+6 −19 src/extensions/react-flow/nodes/nodeUtils.tsx
+5 −3 src/extensions/react-flow/nodes/stories/NodeDefault.stories.tsx
+0 −128 src/extensions/react-flow/nodes/stories/NodeDefaultV10.stories.tsx
+13 −22 src/extensions/react-flow/versionsupport.ts
+34 −0 src/extensions/uppy/FileUpload.stories.tsx
+171 −0 src/extensions/uppy/FileUpload.tsx
5 changes: 3 additions & 2 deletions workspace/src/app/hooks/useModalError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export const useModalError = ({ setError }: useModalParams) => {
setError(errorWithContextName((e as FetchError).errorResponse));
} else if (e.title === "Network Error") {
setError(errorWithContextName(e));
} else if(typeof e.asString === "function" && !!e.status) { // If not a FetchError, seems to be an error response then
setError(errorWithContextName(e))
} else if (typeof e.asString === "function" && !!e.status) {
// If not a FetchError, seems to be an error response then
setError(errorWithContextName(e));
} else {
console.warn(e);
}
Expand Down
2 changes: 1 addition & 1 deletion workspace/src/app/store/ducks/common/initialState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function initialCommonState(): ICommonState {
hotKeys: {},
templatingEnabled: false,
assistantSupported: false,
mappingCreatorEnabled: false
mappingCreatorEnabled: false,
},
exportTypes: [],
artefactModal: initialArtefactModalState(),
Expand Down
2 changes: 1 addition & 1 deletion workspace/src/app/store/ducks/error/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export interface IErrorState {
errors: Array<ApplicationError>;
}

export type ApplicationError = DIErrorFormat & { errorNotificationInstanceId?: string, notAutoOpen?: boolean };
export type ApplicationError = DIErrorFormat & { errorNotificationInstanceId?: string; notAutoOpen?: boolean };
22 changes: 11 additions & 11 deletions workspace/src/app/store/ducks/workspace/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const requestRemoveProject = async (itemId: string): Promise<FetchRespons
export const requestRemoveTask = async (
itemId: string,
projectId?: string,
removeDependentTasks: boolean = false
removeDependentTasks: boolean = false,
): Promise<FetchResponse<void>> => {
return await fetch({
url:
Expand Down Expand Up @@ -110,7 +110,7 @@ export const requestCloneTask = async (
taskId: string,
projectId: string,
payload: any,
newTaskId?: string
newTaskId?: string,
): Promise<FetchResponse<IClonedItem>> => {
let body = { ...payload };
if (newTaskId) {
Expand Down Expand Up @@ -191,9 +191,9 @@ export const requestProjectPrefixes = async (projectId: string): Promise<FetchRe
export const requestChangePrefixes = async (
prefixName: string,
prefixUri: string,
projectId: string
projectId: string,
): Promise<any | never> => {
const {data} = await fetch({
const { data } = await fetch({
url: workspaceApi(`/projects/${projectId}/prefixes/${prefixName}`),
method: "PUT",
body: prefixUri,
Expand All @@ -203,7 +203,7 @@ export const requestChangePrefixes = async (

//missing-type
export const requestRemoveProjectPrefix = async (prefixName: string, projectId: string): Promise<any | never> => {
const {data} = await fetch({
const { data } = await fetch({
url: workspaceApi(`/projects/${projectId}/prefixes/${prefixName}`),
method: "DELETE",
});
Expand Down Expand Up @@ -246,7 +246,7 @@ export const requestRemoveProjectResource = async (projectId: string, resourceNa
/** Returns all tasks that depend on a specific resource. */
export const projectFileResourceDependents = async (
projectId: string,
resourceName: string
resourceName: string,
): Promise<FetchResponse<ITaskLink[]>> => {
return fetch({
url: legacyApiEndpoint(`/projects/${projectId}/files/usage`),
Expand Down Expand Up @@ -288,7 +288,7 @@ const projectImportEndpoint = (projectImportId: string) => workspaceApi(`/projec

/** Fetch the project import details for the previously uploaded project file. */
export const requestProjectImportDetails = async (
projectImportId: string
projectImportId: string,
): Promise<FetchResponse<IProjectImportDetails>> => {
return fetch({
url: projectImportEndpoint(projectImportId),
Expand All @@ -311,7 +311,7 @@ export const requestDeleteProjectImport = async (projectImportId: string): Promi
export const requestStartProjectImport = async (
projectImportId: string,
generateNewId: boolean,
overwriteExistingProject: boolean
overwriteExistingProject: boolean,
): Promise<FetchResponse<void>> => {
return fetch({
url:
Expand All @@ -323,7 +323,7 @@ export const requestStartProjectImport = async (

/** When the actual project import has been started, this endpoint will inform about the progress. */
export const requestProjectImportExecutionStatus = async (
projectImportId: string
projectImportId: string,
): Promise<FetchResponse<IProjectExecutionStatus>> => {
return fetch({
url: projectImportEndpoint(projectImportId) + "/status",
Expand Down Expand Up @@ -362,7 +362,7 @@ export const requestProjectUri = async (projectId: string): Promise<FetchRespons
export const requestSearchForGlobalVocabularyProperties = async (
textQuery: string,
limit: number,
projectId?: string
projectId?: string,
): Promise<FetchResponse<IAutocompleteDefaultResponse[]>> => {
return fetch({
url: workspaceApi("vocabularies/property/search"),
Expand All @@ -378,7 +378,7 @@ export const requestSearchForGlobalVocabularyProperties = async (
export const requestTaskContextInfo = async (
projectId: string,
taskId: string,
taskContext: TaskContext
taskContext: TaskContext,
): Promise<FetchResponse<TaskContextResponse>> => {
return fetch({
url: projectApi(`/${projectId}/taskContext`),
Expand Down
10 changes: 5 additions & 5 deletions workspace/src/app/views/layout/Header/KeyboardShortcutsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { useSelector } from "react-redux";
import { commonSel } from "@ducks/common";

const sectionKeys = ["general", "workflow-editor", "rule-editors", "projects", "tasks"] as const;
const shortcuts: Record<typeof sectionKeys[number], Array<{ key: string; commands: string[] }>> = {
const shortcuts: Record<(typeof sectionKeys)[number], Array<{ key: string; commands: string[] }>> = {
general: [
{ key: "quick-search", commands: ["/"] },
{ key: "help", commands: ["?"] },
Expand Down Expand Up @@ -116,12 +116,12 @@ export const KeyboardShortcutsModal = () => {
labelProps={{
tooltip: t(
`header.keyboardShortcutsModal.categories.${sectionKey}.shortcuts.${shortcut.key}Desc`,
""
"",
),
}}
>
{t(
`header.keyboardShortcutsModal.categories.${sectionKey}.shortcuts.${shortcut.key}`
`header.keyboardShortcutsModal.categories.${sectionKey}.shortcuts.${shortcut.key}`,
)}
</PropertyName>
<PropertyValue
Expand All @@ -137,7 +137,7 @@ export const KeyboardShortcutsModal = () => {
{" "}
<p>
{t(
`header.keyboardShortcutsModal.key-directives.${keyDirective}`
`header.keyboardShortcutsModal.key-directives.${keyDirective}`,
)}
</p>
</React.Fragment>
Expand All @@ -148,7 +148,7 @@ export const KeyboardShortcutsModal = () => {
.map((key) => {
return t(
`header.keyboardShortcutsModal.keys.${key}`,
key
key,
);
})
.join(" + ")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class HierarchicalMapping extends React.Component {
uri,
type,
parent,
label: displayLabel
label: displayLabel,
},
askForRemove: true,
removeFunction: this.handleConfirmRemove,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ObjectUriPatternProps {
uriRule: any;
onRemoveUriRule: () => void;
openMappingEditor: () => void;
showLabel?: boolean
showLabel?: boolean;
}

const ObjectUriPattern = ({ uriRule, onRemoveUriRule, openMappingEditor, showLabel = true }: ObjectUriPatternProps) => {
Expand Down Expand Up @@ -51,10 +51,9 @@ const ObjectUriPattern = ({ uriRule, onRemoveUriRule, openMappingEditor, showLab
<div className="ecc-silk-mapping__rulesviewer__idpattern">
<div className="ecc-silk-mapping__rulesviewer__comment">
<dl className="ecc-silk-mapping__rulesviewer__attribute">
{showLabel ?
<dt className="ecc-silk-mapping__rulesviewer__attribute-label">{uriPatternLabel}</dt> :
null
}
{showLabel ? (
<dt className="ecc-silk-mapping__rulesviewer__attribute-label">{uriPatternLabel}</dt>
) : null}
<dd className="ecc-silk-mapping__rulesviewer__attribute-info">
{uriPattern}
<IconButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class DraggableItem extends React.Component {
{
expanded,
},
this.updateQueryOnExpansion
this.updateQueryOnExpansion,
);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const ExampleView = ({ id, rawRule, ruleType, objectSourcePathContext, up
(error) => {
setError(error);
setLoading(false);
}
},
);
};

Expand Down Expand Up @@ -181,19 +181,20 @@ export const ExampleView = ({ id, rawRule, ruleType, objectSourcePathContext, up
</TableHeader>
</TableRow>
</TableHead>
{resultsCount > 0 && examples.status.id === "with exceptions" && examples.status.msg ?
{resultsCount > 0 && examples.status.id === "with exceptions" && examples.status.msg ? (
<TableBody>
<TableRow key={"errorRow"}>
<TableCell colSpan={3}>
<ProblemNotification
message={t("HierarchicalMapping.ExampleView.errors.withExceptions", {error: examples.status.msg})}
message={t("HierarchicalMapping.ExampleView.errors.withExceptions", {
error: examples.status.msg,
})}
details={examples.status.msg}
/>
</TableCell>
</TableRow>
</TableBody> :
null
}
</TableBody>
) : null}
{_.map(examples.results, (result, index) => (
<TableBody key={`tbody_${index}`}>
{sourcePaths.map((sourcePath, i) => (
Expand Down Expand Up @@ -232,7 +233,7 @@ export const ExampleView = ({ id, rawRule, ruleType, objectSourcePathContext, up
>
{transformedValue}
</Tag>
)
),
)}
</TableCell>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import MappingRuleRow from "./MappingRuleRow";
import NavigateButton from "../../elements/buttons/NavigateButton";
import ExpandButton from "../../elements/buttons/ExpandButton";
import { ContextMenu, MenuItem, Spinner } from "@eccenca/gui-elements";
import {getRuleLabel} from "../../utils/getRuleLabel";
import { getRuleLabel } from "../../utils/getRuleLabel";

export class MappingRule extends React.Component {
// define property types
Expand Down Expand Up @@ -136,9 +136,9 @@ export class MappingRule extends React.Component {
this.props;
const srcPath = sourcePath || sourcePaths;

const label = _.get(metadata, 'label', '');
const ruleLabelData = getRuleLabel({label, uri: mappingTarget.uri});
const ruleDisplayLabel = ruleLabelData.displayLabel
const label = _.get(metadata, "label", "");
const ruleLabelData = getRuleLabel({ label, uri: mappingTarget.uri });
const ruleDisplayLabel = ruleLabelData.displayLabel;

const expandedView = this.props.expanded ? (
isRootOrObjectRule(type) ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import MetadataDesc from "../../../components/Metadata/MetadataDesc";
import { SourcePath } from "../../../components/SourcePath";
import TargetCardinality from "../../../components/TargetCardinality";
import { defaultUriPattern } from "./ObjectRule.utils";
import {getRuleLabel} from "../../../utils/getRuleLabel";
import { getRuleLabel } from "../../../utils/getRuleLabel";

class ObjectRule extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -99,7 +99,7 @@ class ObjectRule extends React.Component {
},
(err) => {
console.error(err);
}
},
);
} else {
this.props.openMappingEditor(uriRuleId);
Expand All @@ -118,7 +118,7 @@ class ObjectRule extends React.Component {
},
(err) => {
console.error(err);
}
},
);
};
this.props.onClickedRemove(null, callbackFn);
Expand Down Expand Up @@ -156,9 +156,9 @@ class ObjectRule extends React.Component {
const { type, ruleData } = this.props;
const { edit } = this.state;
const { type: ruleType, metadata, mappingTarget } = ruleData;
const label = _.get(metadata, 'label', '');
const ruleLabelData = getRuleLabel({label, uri: mappingTarget.uri});
const ruleDisplayLabel = ruleLabelData.displayLabel
const label = _.get(metadata, "label", "");
const ruleLabelData = getRuleLabel({ label, uri: mappingTarget.uri });
const ruleDisplayLabel = ruleLabelData.displayLabel;

if (edit) {
return (
Expand Down Expand Up @@ -245,7 +245,7 @@ class ObjectRule extends React.Component {
uri: this.props.ruleData.mappingTarget.uri,
type: ruleType,
parent: this.props.parentId,
displayLabel: ruleDisplayLabel
displayLabel: ruleDisplayLabel,
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class ValueRule extends React.Component {
uri: mappingTarget.uri,
type: this.props.type,
parent: parentId,
displayLabel: this.props.displayLabel
displayLabel: this.props.displayLabel,
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface MappingsListProps {
handleClone?: (id, type, parent) => any;
onClickedRemove?: () => any;
onShowSuggestions?: () => any;
onRuleIdChange?: (param: any) => any;
onRuleIdChange?: (param: any) => any;
onAskDiscardChanges?: (param: any) => any;
openMappingEditor: () => void;
startFullScreen: boolean;
Expand Down Expand Up @@ -64,7 +64,7 @@ const MappingsList = ({
const childrenRules = reorderArray(
items.map((a) => a.key),
fromPos,
toPos
toPos,
);

const { project, transformTask } = getApiDetails();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class RootMappingRule extends React.Component {
{
expanded: !this.state.expanded,
},
this.updateQueryOnExpansion
this.updateQueryOnExpansion,
);
}
}
Expand Down
Loading