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

minor fixes #883

Merged
merged 9 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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 .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{ "repo": "finos/legend-studio" }
],
"commit": false,
"linked": [["@finos/legend-*-app", "@finos/legend-*-deployment"]],
"fixed": [["@finos/legend-*-app", "@finos/legend-*-deployment"]],
"access": "public",
"baseBranch": "master",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
Expand Down
10 changes: 10 additions & 0 deletions .changeset/sixty-wasps-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@finos/eslint-plugin-legend-studio': patch
'@finos/legend-application': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-graph': patch
'@finos/legend-query': patch
'@finos/legend-studio': patch
'@finos/legend-taxonomy': patch
---
5 changes: 5 additions & 0 deletions .changeset/twenty-sheep-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-graph': patch
---

Add a temporary workaround to not fail graph building when there are unresolved class mapping IDs (see [#880](https://github.com/finos/legend-studio/issues/880) for more details).
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ yarn changeset:cli

Make sure to install [Node.js](https://nodejs.org/en/) and [Yarn](https://yarnpkg.com/). For IDE, we highly recommend [Visual Studio Code](https://code.visualstudio.com/). Also, to assist development, don't forget to install [ESLint](https://eslint.org/) and [Stylelint](https://stylelint.io/) plugins to help you catch problems while writing code; and install [Prettier](https://prettier.io/) plugin to help you auto-format code. Last but not least, run the `setup` script.

Studio relies on SDLC and Engine servers as its backend. If you don't have these servers [setup to run locally](https://legend.finos.org/docs/installation/maven-install-guide#installation-steps), you can make use of [this Docker compose project](https://github.com/finos/legend/tree/master/installers/docker-compose/legend-studio-dev) to quickly set them up.
Studio relies _minimumly_ on SDLC and Engine servers as its backend. To quickly set these up, use our development [Docker compose](https://github.com/finos/legend/tree/master/installers/docker-compose/legend-studio-dev). If you need to debug and code on the backend at the same time, follow [this guide](./fixtures/legend-docker-setup/studio-dev-setup/README.md) to set them up using `maven`.

```sh
# Install dependencies, link and set up the workspaces, and build the workspaces to make sure your project is in good shape.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ The codebase and home of Legend applications: `Legend Studio`, `Legend Query`, e

## Getting started

Make sure you have SDLC and Engine servers running. If you don't have these servers [setup to run locally](https://legend.finos.org/docs/installation/maven-install-guide#installation-steps), you can make use of [this Docker compose project](https://github.com/finos/legend/tree/master/installers/docker-compose/legend-studio-dev) to quickly set them up.
Make sure you have _at least_ SDLC and Engine servers running. To quickly set these up, use our development [Docker compose](https://github.com/finos/legend/tree/master/installers/docker-compose/legend-studio-dev). If you need to debug and code on the backend at the same time, follow [this guide](./fixtures/legend-docker-setup/studio-dev-setup/README.md) to set them up using `maven`.

Make sure you have `Yarn` installed. Run the following commands in order.
Last but not least, make sure you have `Yarn` installed. Run the following commands in order.

```bash
yarn install
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"deployment": {
"mode": "TEST_IGNORE_FUNCTION_MATCH"
},
"logging": {
"level": "INFO",
"appenders": [
{
"type": "console",
"logFormat": "%msg\r\n"
}
]
},
"pac4j": {
"bypassPaths": ["/api/server/v1/info"],
"clients": [
{
"org.pac4j.core.client.direct.AnonymousClient": {}
}
],
"mongoSession": {
"enabled": false
}
},
"opentracing": {
"elastic": "",
"zipkin": "",
"uri": "",
"authenticator": {
"principal": "",
"keytab": ""
}
},
"swagger": {
"title": "Legend Engine",
"resourcePackage": "org.finos.legend",
"uriPrefix": "/api"
},
"server": {
"type": "simple",
"applicationContextPath": "/",
"adminContextPath": "/admin",
"connector": {
"maxRequestHeaderSize": "32KiB",
"type": "http",
"port": 6060
},
"requestLog": {
"appenders": []
}
},
"metadataserver": {
"pure": {
"host": "127.0.0.1",
"port": 8090
},
"alloy": {
"host": "127.0.0.1",
"port": 8090,
"prefix": "/depot/api"
}
},
"temporarytestdb": {
"port": 9092
},
"relationalexecution": {
"tempPath": "/tmp/"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3.8'

services:
engine:
container_name: engine
image: finos/legend-engine-server:snapshot
ports:
- 6060:6060
networks:
- legend
volumes:
- ./config:/config
# NOTE: the Java CLI wildcard must be wrapped by quotes
# See https://stackoverflow.com/questions/14722657/java-classpath-wildcard-behaviour/14722763
command: >
java
-cp /app/bin/"*"
org.finos.legend.engine.server.Server
server /config/engine-config.json

networks:
legend: {}
akphi marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions fixtures/legend-docker-setup/studio-dev-setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Studio Docker Compose Dev Setup

[placeholder]
2 changes: 1 addition & 1 deletion fixtures/legend-mock-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"fastify": "3.27.2",
"fastify-cors": "6.0.2"
"fastify-cors": "6.0.3"
},
"devDependencies": {
"@finos/legend-dev-utils": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
"@finos/eslint-plugin-legend-studio": "workspace:*",
"@finos/legend-dev-utils": "workspace:*",
"@finos/stylelint-config-legend-studio": "workspace:*",
"@types/jest": "27.4.0",
"@types/node": "17.0.19",
"@types/jest": "27.4.1",
"@types/node": "17.0.21",
"chalk": "5.0.0",
"cross-env": "7.0.3",
"envinfo": "7.8.1",
Expand All @@ -106,7 +106,7 @@
"sass": "1.49.8",
"semver": "7.3.5",
"sort-package-json": "1.54.0",
"stylelint": "14.5.2",
"stylelint": "14.5.3",
"typescript": "4.5.5",
"yargs": "17.3.1"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin/src/configs/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ES_RULES = {
'dot-notation': [ERROR, { allowKeywords: true }],
'eol-last': [WARN, 'always'],
eqeqeq: ERROR,
'func-call-spacing': ERROR,
'func-call-spacing': OFF,
'guard-for-in': ERROR,
'jsx-quotes': ERROR,
'key-spacing': WARN,
Expand Down Expand Up @@ -135,6 +135,7 @@ const TYPESCRIPT_RULES = {
WARN,
{ allowTypedFunctionExpressions: true },
],
'@typescript-eslint/func-call-spacing': ERROR,
'@typescript-eslint/no-inferrable-types': [WARN, { ignoreParameters: true }],
'@typescript-eslint/no-var-requires': OFF,
'@typescript-eslint/no-unused-vars': [
Expand Down
2 changes: 1 addition & 1 deletion packages/legend-application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@types/react": "17.0.39",
"@types/react-dom": "17.0.11",
"@types/react-router-dom": "5.3.2",
"history": "5.2.0",
"history": "5.3.0",
"mobx": "6.4.1",
"mobx-react-lite": "3.3.0",
"monaco-editor": "0.32.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { useRef, useEffect } from 'react';
import { useRef, useEffect, forwardRef } from 'react';
import { observer } from 'mobx-react-lite';
import { useResizeDetector } from 'react-resize-detector';
import {
Expand Down Expand Up @@ -58,13 +58,13 @@ interface DataSpaceViewerActivityConfig {
}

const DataSpaceDiagramCanvas = observer(
(
props: {
forwardRef<
HTMLDivElement,
{
dataSpaceViewerState: DataSpaceViewerState;
diagram: Diagram;
},
ref: React.Ref<HTMLDivElement>,
) => {
}
>(function DataSpaceDiagramCanvas(props, ref) {
const { dataSpaceViewerState, diagram } = props;
const diagramCanvasRef =
ref as React.MutableRefObject<HTMLDivElement | null>;
Expand Down Expand Up @@ -102,8 +102,7 @@ const DataSpaceDiagramCanvas = observer(
onContextMenu={(event): void => event.preventDefault()}
/>
);
},
{ forwardRef: true },
}),
);

type DiagramOption = { label: string; value: Diagram };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
* limitations under the License.
*/

import { useRef, useState, useEffect, useCallback, Fragment } from 'react';
import {
useRef,
useState,
useEffect,
useCallback,
Fragment,
forwardRef,
} from 'react';
import { useResizeDetector } from 'react-resize-detector';
import { type DropTargetMonitor, useDrop } from 'react-dnd';
import { observer } from 'mobx-react-lite';
Expand Down Expand Up @@ -99,12 +106,12 @@ import { Point } from '../../models/metamodels/pure/packageableElements/diagram/
import type { DSLDiagram_LegendStudioPlugin_Extension } from './DSLDiagram_LegendStudioPlugin_Extension';

const DiagramEditorContextMenu = observer(
(
props: {
forwardRef<
HTMLDivElement,
{
diagramEditorState: DiagramEditorState;
},
ref: React.Ref<HTMLDivElement>,
) => {
}
>(function DiagramEditorContextMenu(props, ref) {
const { diagramEditorState } = props;
const editorStore = useEditorStore();
const extraClassViewContextMenuItems =
Expand All @@ -129,8 +136,7 @@ const DiagramEditorContextMenu = observer(
))
: [];
return <MenuContent>{extraClassViewContextMenuItems}</MenuContent>;
},
{ forwardRef: true },
}),
);

const DiagramRendererHotkeyInfosModal = observer(
Expand Down Expand Up @@ -1142,12 +1148,12 @@ const DiagramEditorInlinePropertyEditor = observer(
);

const DiagramEditorDiagramCanvas = observer(
(
props: {
forwardRef<
HTMLDivElement,
{
diagramEditorState: DiagramEditorState;
},
ref: React.Ref<HTMLDivElement>,
) => {
}
>(function DiagramEditorDiagramCanvas(props, ref) {
const { diagramEditorState } = props;
const diagramCanvasRef =
ref as React.MutableRefObject<HTMLDivElement | null>;
Expand Down Expand Up @@ -1223,8 +1229,7 @@ const DiagramEditorDiagramCanvas = observer(
onContextMenu={(event): void => event.preventDefault()}
/>
);
},
{ forwardRef: true },
}),
);

const DiagramEditorHeader = observer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ test(unitTest('Missing class mapping'), async () => {
);
});

test(unitTest('Missing class mapping with ID'), async () => {
// TODO: This test is skipped because we want to temporarily relax graph building algorithm
// to ease Pure -> Legend migration push.
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */
test.skip(unitTest('Missing class mapping with ID'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
graphManagerState.graph,
Expand All @@ -138,7 +141,7 @@ test(unitTest('Missing class mapping with ID'), async () => {
);
});

// TODO This test is skipped because we don't support include mappings. We don't fail yet
// TODO: This test is skipped because we don't support include mappings. We don't fail yet
// Unskip when include mappings support is added
test.skip(unitTest('Missing set implementation'), async () => {
const buildGraph = flowResult(
Expand All @@ -152,7 +155,7 @@ test.skip(unitTest('Missing set implementation'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate enumeration values'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand All @@ -165,7 +168,7 @@ test.skip(unitTest('Duplicate enumeration values'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate profile tags'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand All @@ -178,7 +181,7 @@ test.skip(unitTest('Duplicate profile tags'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate profile stereotypes'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand All @@ -191,7 +194,7 @@ test.skip(unitTest('Duplicate profile stereotypes'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate class properties'), async () => {
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand All @@ -204,7 +207,7 @@ test.skip(unitTest('Duplicate class properties'), async () => {
);
});

/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */
/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */
test.skip(unitTest('Duplicate aoociation properties'), async () => {
akphi marked this conversation as resolved.
Show resolved Hide resolved
const buildGraph = flowResult(
graphManagerState.graphManager.buildGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ export abstract class PropertyMapping implements Hashable, Stubable {
owner: PropertyMappingsImplementation; // the immediate parent instance set implementation that holds the property mappings
// NOTE: in case the holder of this property mapping is an embedded property mapping, that embedded property mapping is considered the source
// otherwise, it is always the top/root `InstanceSetImplementation` that is considered the source implementation
// TODO: change this to use `SetImplemenetationReference`
sourceSetImplementation: SetImplementation;
// NOTE: in Pure, we actually only store `targetId` and `sourceId` instead of the reference
// but for convenience and graph completeness validation purpose we will resolve to the actual set implementations here
// TODO: change this to use `OptionalSetImplemenetationReference`
targetSetImplementation?: SetImplementation | undefined;
localMappingProperty?: LocalMappingPropertyInfo | undefined;
// store?: Store | undefined;
Expand Down
Loading