Skip to content

Commit

Permalink
cleanups query builder code value specification modifiers (finos#1520)
Browse files Browse the repository at this point in the history
* remove @types/lossless-json

* remove ReactMarkdownMocker.jsx

* minor styling fix for custom date picker

* minor cleanups

* cleanups post finos#1521

* cleanups

* rework ApplicationNavigator and support platform navigation blocking

* support application backdrop

* cleanup after finos#1504

* minor cleanups

* rework application navigator to support blocking

* minor cleanups post finos#1541

* minor cleanups post finos#1507

* move value-specification editor logic from @finos/legend-application to @finos/legend-query-builder

* minor fixes

* query builder: properly use modifier for modification of value specification tree

* query builder: fix minor bug when building query value specification

* value-spec: fix minor typings error in metamodels

* bump dependencies

* add changeset

* improve documentations on ESM workarounds
  • Loading branch information
akphi authored Oct 11, 2022
1 parent 31c5e3b commit 240875e
Show file tree
Hide file tree
Showing 396 changed files with 3,205 additions and 2,924 deletions.
16 changes: 16 additions & 0 deletions .changeset/clean-mayflies-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@finos/legend-application': patch
'@finos/legend-application-query': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-art': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-extension-format-morphir': patch
'@finos/legend-extension-store-service-store': patch
'@finos/legend-graph': patch
'@finos/legend-query-builder': patch
'@finos/legend-shared': patch
---
15 changes: 15 additions & 0 deletions .changeset/cold-beans-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@finos/legend-application': patch
'@finos/legend-application-query': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-art': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-extension-format-morphir': patch
'@finos/legend-extension-store-service-store': patch
'@finos/legend-query-builder': patch
'@finos/legend-shared': patch
---
15 changes: 15 additions & 0 deletions .changeset/cold-beers-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@finos/legend-application': patch
'@finos/legend-application-query': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-art': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-extension-format-morphir': patch
'@finos/legend-extension-store-service-store': patch
'@finos/legend-query-builder': patch
'@finos/legend-shared': patch
---
6 changes: 6 additions & 0 deletions .changeset/empty-carpets-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@finos/legend-application': major
'@finos/legend-query-builder': minor
---

**BREAKING CHANGE:** Move `value specification` logic like `LambdaEditor`, `BasicValueSpecificationEditor` from `@finos/legend-application` to `@finos/legend-query-builder`
16 changes: 16 additions & 0 deletions .changeset/fifty-papayas-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@finos/legend-application': patch
'@finos/legend-application-query': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-art': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-extension-format-morphir': patch
'@finos/legend-extension-store-service-store': patch
'@finos/legend-graph': patch
'@finos/legend-query-builder': patch
'@finos/legend-shared': patch
---
5 changes: 5 additions & 0 deletions .changeset/fresh-keys-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-graph': major
---

**BREAKING CHANGE:** `AbstractPropertyExpression.func` should now use `PropertyReference` and `FunctionType.returnType` should now use `PackageableElementReference<Type>`.
5 changes: 5 additions & 0 deletions .changeset/great-horses-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-application': major
---

**BREAKING CHANGE:** Rework `ApplicationNavigator` and renamed its methods; also added support for blocking platform navigation (e.g. web-browser's back/forward buttons).
6 changes: 6 additions & 0 deletions .changeset/green-masks-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@finos/legend-graph': major
'@finos/legend-query-builder': minor
---

**BREAKING CHANGE:** Move `value specification` helpers from `@finos/legend-graph` to `@finos/legend-query-builder`
11 changes: 11 additions & 0 deletions .changeset/khaki-lobsters-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@finos/legend-application': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-art': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-query-builder': patch
'@finos/legend-shared': patch
---
5 changes: 5 additions & 0 deletions .changeset/odd-lions-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-extension-dsl-data-space': major
---

**BREAKING CHANGE:** Renamed `getDSLDataSpaceGraphManagerExtension()` to `DSL_DataSpace_getGraphManagerExtension()`
5 changes: 5 additions & 0 deletions .changeset/odd-melons-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-art': major
---

**BREAKING CHANGE:** Removed `ReactMarkdownMocker.jsx` setup script, instead, add mocks `MockedReactMarkdown.js` and `MockedRemarkGFM.js` which can be use in `Jest` config `moduleNameMapper`.
15 changes: 15 additions & 0 deletions .changeset/rude-vans-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@finos/legend-application': patch
'@finos/legend-application-query': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-art': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-extension-format-morphir': patch
'@finos/legend-extension-store-service-store': patch
'@finos/legend-query-builder': patch
'@finos/legend-shared': patch
---
4 changes: 4 additions & 0 deletions .changeset/shaggy-spies-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
'@finos/legend-art': patch
'@finos/legend-shared': patch
---
36 changes: 36 additions & 0 deletions .changeset/sharp-dodos-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
'@finos/babel-preset-legend-studio': patch
'@finos/eslint-plugin-legend-studio': patch
'@finos/legend-application': patch
'@finos/legend-application-query': patch
'@finos/legend-application-query-bootstrap': patch
'@finos/legend-application-query-deployment': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-studio-bootstrap': patch
'@finos/legend-application-studio-deployment': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-application-taxonomy-bootstrap': patch
'@finos/legend-application-taxonomy-deployment': patch
'@finos/legend-art': patch
'@finos/legend-dev-utils': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-mastery': patch
'@finos/legend-extension-dsl-persistence': patch
'@finos/legend-extension-dsl-persistence-cloud': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-extension-format-json-schema': patch
'@finos/legend-extension-format-morphir': patch
'@finos/legend-extension-store-flat-data': patch
'@finos/legend-extension-store-relational': patch
'@finos/legend-extension-store-service-store': patch
'@finos/legend-extension-tracer-zipkin': patch
'@finos/legend-graph': patch
'@finos/legend-query-builder': patch
'@finos/legend-server-depot': patch
'@finos/legend-server-sdlc': patch
'@finos/legend-shared': patch
'@finos/legend-storage': patch
'@finos/stylelint-config-legend-studio': patch
---
16 changes: 16 additions & 0 deletions .changeset/shiny-doors-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@finos/legend-application': patch
'@finos/legend-application-query': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-art': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-extension-format-morphir': patch
'@finos/legend-extension-store-service-store': patch
'@finos/legend-graph': patch
'@finos/legend-query-builder': patch
'@finos/legend-shared': patch
---
13 changes: 13 additions & 0 deletions .changeset/wicked-paws-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@finos/legend-application': patch
'@finos/legend-application-studio': patch
'@finos/legend-application-taxonomy': patch
'@finos/legend-art': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-extension-store-service-store': patch
'@finos/legend-query-builder': patch
'@finos/legend-shared': patch
---
5 changes: 5 additions & 0 deletions .changeset/wild-avocados-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-application': minor
---

Add `Backdrop` to `LegendApplicationComponentFrameworkProvider` and allow controling this backdrop from `ApplicationStore`
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Read our [guide on testing](./docs/technical/test-strategy.md) to understand our
# and integration test suites.
yarn test

# Re-run tests on changes.
# Rerun tests on changes.
# NOTE: you can also install `watchman` if the startup time seems slow.
yarn test:watch

Expand Down
4 changes: 4 additions & 0 deletions docs/ux/miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ Understand the differences between `ALL CAPS CASE`, `Title Case`, and `Sentence
## Tooltip on flip-flop button/toggler

When we have a button that toggles a state, e.g. `Show/Hide username`, `Toggle flag`, but does not come with a label to describe its current state, it's helpful to add a tooltip, but what should we say in the tooltip? Should we try to describe the result action, e.g. `Mark as Favourite / Remove Favourite`, or should we describe the current state `Not saved as Favourite / Saved as Favourited`? We think it's clearest in these situation to do something like this `[on|off] Toggle mark as Favourite`.

## Button label

_TBD_ (what kind of label should we use for toggler?)
8 changes: 4 additions & 4 deletions docs/workflow/working-with-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ We disallow working directly with the default branch, therefore, your workflow s

The workflow above is applicable to you most of the time, however, if you are working on bug fixes for a particular release, the workflow is slightly different.

_Let's say the release we're rolling out bug fixes for is `0.4.0`, at this point the release coordinator [should have already created](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository#creating-a-branch) the release branch `release/0.4.0` in the main repository. Your workflow would be something like this_
_Let's say the release we're rolling out bug fixes for is `1.0.0`, at this point the release coordinator [should have already created](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository#creating-a-branch) the release branch `release/1.0.0` in the main repository. Your workflow would be something like this_

- **One-time setup**: fetch the release branch and sync it with your fork

```sh
git fetch upstream
git checkout release/0.4.0
git checkout release/1.0.0
git push -f
```

- Checkout your local feature branch from the release branch `git checkout -b feature-1`
- Work and commit your changes on the feature branch
- Push the feature branch `git push -u origin feature-1`
- Create a PR, **changing to merge to the release branch** `release/0.4.0` instead of the default branch, getting it approved and merged
- Sync the fork (similarly to the above, except on Github, you would need to switch to the release branch to fetch upstream or use the command `git pull --rebease upstream release/0.4.0`)
- Create a PR, **changing to merge to the release branch** `release/1.0.0` instead of the default branch, getting it approved and merged
- Sync the fork (similarly to the above, except on Github, you would need to switch to the release branch to fetch upstream or use the command `git pull --rebease upstream release/1.0.0`)
- _Restart the process for the next contributions..._
4 changes: 2 additions & 2 deletions fixtures/legend-mock-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
},
"dependencies": {
"@fastify/cors": "8.1.0",
"fastify": "4.7.0"
"fastify": "4.8.1"
},
"devDependencies": {
"@finos/legend-dev-utils": "workspace:*",
"cross-env": "7.0.3",
"eslint": "8.24.0",
"eslint": "8.25.0",
"nodemon": "2.0.20",
"npm-run-all": "4.1.5",
"rimraf": "3.0.2",
Expand Down
20 changes: 9 additions & 11 deletions fixtures/legend-mock-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import { fastify } from 'fastify';
/**
* Previously, these exports rely on ES module interop to expose `default` export
* properly. But since we use `ESM` for Typescript resolution now, we lose this
Expand All @@ -24,8 +25,8 @@
* @workaround ESM
* See https://github.com/microsoft/TypeScript/issues/49298
* See https://github.com/microsoft/TypeScript/issues/50690
* See https://github.com/fastify/fastify-cors/pull/231
*/
import { default as Fastify } from 'fastify';
import { default as FastifyCORS } from '@fastify/cors';
import TAXONOMY_TREE_DATA from './TEST_DATA__TaxonomyTreeData.json' assert { type: 'json' };
import DOCUMENTATION_DATA from './DummyDocumentationData.json' assert { type: 'json' };
Expand All @@ -34,29 +35,26 @@ const PORT = 9999;
const API_BASE_URL = '/api';
const STUDIO_BASE_URL = '/studio';

const fastify = Fastify.default({
const server = fastify({
logger: true,
});

// eslint-disable-next-line @typescript-eslint/no-floating-promises
fastify.register(FastifyCORS.default, {
server.register(FastifyCORS.default, {
methods: ['OPTIONS'],
origin: [/localhost/],
credentials: true,
});

fastify.get(
`${API_BASE_URL}/taxonomy/taxonomy-tree`,
async (request, reply) => {
await reply.send(TAXONOMY_TREE_DATA);
},
);
server.get(`${API_BASE_URL}/taxonomy/taxonomy-tree`, async (request, reply) => {
await reply.send(TAXONOMY_TREE_DATA);
});

fastify.get(`${STUDIO_BASE_URL}/documentation.json`, async (request, reply) => {
server.get(`${STUDIO_BASE_URL}/documentation.json`, async (request, reply) => {
await reply.send(DOCUMENTATION_DATA);
});

fastify.listen(PORT, (error, address) => {
server.listen(PORT, (error, address) => {
if (error) {
throw error;
}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,25 @@
"@finos/eslint-plugin-legend-studio": "workspace:*",
"@finos/legend-dev-utils": "workspace:*",
"@finos/stylelint-config-legend-studio": "workspace:*",
"@types/node": "18.8.0",
"chalk": "5.0.1",
"@types/node": "18.8.4",
"chalk": "5.1.0",
"cross-env": "7.0.3",
"envinfo": "7.8.1",
"eslint": "8.24.0",
"eslint": "8.25.0",
"fs-extra": "10.1.0",
"husky": "8.0.1",
"inquirer": "9.1.2",
"inquirer": "9.1.3",
"jest": "29.1.2",
"lint-staged": "13.0.3",
"micromatch": "4.0.5",
"npm-run-all": "4.1.5",
"prettier": "2.7.1",
"rimraf": "3.0.2",
"sass": "1.55.0",
"semver": "7.3.7",
"semver": "7.3.8",
"sort-package-json": "2.0.0",
"stylelint": "14.13.0",
"typedoc": "0.23.15",
"typedoc": "0.23.16",
"typescript": "4.8.4",
"yargs": "17.6.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
},
"dependencies": {
"@babel/helper-plugin-utils": "7.19.0",
"@babel/preset-env": "7.19.3",
"@babel/preset-env": "7.19.4",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.18.6",
"@babel/runtime": "7.19.0",
"@babel/runtime": "7.19.4",
"react-refresh": "0.14.0"
},
"devDependencies": {
"cross-env": "7.0.3",
"eslint": "8.24.0",
"eslint": "8.25.0",
"rimraf": "3.0.2",
"typescript": "4.8.4"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"dependencies": {
"@babel/core": "7.19.3",
"@babel/eslint-parser": "7.19.1",
"@typescript-eslint/eslint-plugin": "5.38.1",
"@typescript-eslint/parser": "5.38.1",
"@typescript-eslint/eslint-plugin": "5.40.0",
"@typescript-eslint/parser": "5.40.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.31.8",
"eslint-plugin-react": "7.31.10",
"eslint-plugin-react-hooks": "4.6.0",
"micromatch": "4.0.5",
"prettier": "2.7.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/legend-application-query-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"devDependencies": {
"@finos/legend-dev-utils": "workspace:*",
"cross-env": "7.0.3",
"eslint": "8.24.0",
"eslint": "8.25.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.2",
"sass": "1.55.0",
Expand Down
Loading

0 comments on commit 240875e

Please sign in to comment.