Skip to content

[#603][3.1] Make Jointjs Paper responsive and disallow links from in port of operators - #609

Merged
avinash0161 merged 4 commits into
new-gui-operator-panelfrom
avinash-jointjs-paper
Apr 13, 2018
Merged

avinash0161 merged 4 commits into
new-gui-operator-panelfrom
avinash-jointjs-paper

Conversation

@avinash0161

@avinash0161 avinash0161 commented Apr 11, 2018 •

Copy link
Copy Markdown
Contributor

This PR implements two UI functionalities:-

  1. It makes the jointjs paper responsive i.e. when we resize the screen, the paper also gets resized.
  2. It restricts users to make any links starting from the in ports of the operators.

New Frontend PR status:
[1]: PR #604 creates the app using Angular CLI, which sets up the project with basic templates. The basic components are created.
[2]: PR #605 adds the left side operator panel, which shows the operators and the groups. It adds OperatorMetadataService, which fetches metadata from the backend.
[3]: PR #606 integrates JointJS to the app. JointJS is used to display the operators and the links. This PR integrates JointJS in the View level.
[3.1]: PR #609 makes some changes to make jointjs paper responsive and restricts creation of links from in ports of operators. It can be viewed as a small extension of PR #606 .

@avinash0161
avinash0161 requested a review from zuozhiw April 11, 2018 18:17
@avinash0161 avinash0161 changed the title [#603][4] Make Jointjs Paper responsive and disallow links from in port of operators [#603][3.1] Make Jointjs Paper responsive and disallow links from in port of operators Apr 12, 2018
import { Component, AfterViewInit} from '@angular/core';
import { Observable } from 'rxjs/Observable';
import '../../../common/rxjs-operators';
import 'rxjs/add/observable/fromEvent';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line:
import 'rxjs/add/observable/fromEvent';
should be put into app/common/rxjs-operators.ts file, where we manage all the rxjs imports

Observable.fromEvent(window, 'resize').subscribe(
resizeEvent => {this.paper.setDimensions(this.getWrapperElementSize().width, this.getWrapperElementSize().height); }
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this observable, it will fire the resizeEvent many times when user resize the browser. One suggestion I will give would be making this resizeEvent not as rapid as it is now. One observable function that you can look into is rxjs.throttleTime

@avinash0161 avinash0161 Apr 13, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on this article, I feel that auditTime is better. What's your take?

Also where should the import statement for throttletime or whatever we decide, go?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, from the article's argument, seems like auditime is the better choice.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, seems like auditime will work better in this case

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observable.fromEvent(window, 'resize').pipe(auditTime(1000)).subscribe(
resizeEvent => {this.paper.setDimensions(this.getWrapperElementSize().width, this.getWrapperElementSize().height); }
);
is what I am thinking of. Is this correct? I don't know exact usage of pipe() but feel that it is used to transform observable stream

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pipe() is new in newer rxjs versions
so usually we are writing for example:
observable.map().filter().auditTime()
it's equivalent to
observable.pipe(map(), filter(), auditTime())

Honestly I like the old syntax more. I don't think you need to use .pipe here, just try Observable.fromEvent(window, 'resize').auditTime().subscribe()

@avinash0161
avinash0161 merged commit 1227d37 into new-gui-operator-panel Apr 13, 2018
@avinash0161
avinash0161 deleted the avinash-jointjs-paper branch April 13, 2018 23:48
Yicong-Huang added a commit that referenced this pull request Jul 5, 2026
### What changes were proposed in this PR?

Patch-level alignment of all Angular packages in `frontend/`, across the
two Angular release lines:

| Line | Packages | Before | After |
| --- | --- | --- | --- |
| CLI toolchain | `@angular/cli`, `@angular-devkit/build-angular`,
`@angular-devkit/core`, `@angular-devkit/schematics`,
`@schematics/angular` | 21.2.8 | 21.2.18 |
| Framework | `@angular/{core,common,compiler,compiler-cli,localize}` |
21.2.17 | 21.2.17 (unchanged) |
| Framework |
`@angular/{animations,forms,router,platform-browser,platform-browser-dynamic}`
| 21.2.10 | 21.2.17 |
| CDK | `@angular/cdk` | 21.2.8 | 21.2.14 |

(The framework line has no 21.2.18 — 21.2.17 is its latest; CLI and
framework version independently.)

The toolchain bump is security-motivated: 21.2.8 exact-pins several
build-time dependencies with open advisories, which a plain lockfile
refresh cannot move. 21.2.18 re-pins them all to patched versions:

| Pinned dep | Before | After | Dependabot alerts resolved |
| --- | --- | --- | --- |
| undici | 7.24.4 | 7.28.0 |
[#617](https://github.com/apache/texera/security/dependabot/617) (high),
[#614](https://github.com/apache/texera/security/dependabot/614) (high),
[#621](https://github.com/apache/texera/security/dependabot/621),
[#613](https://github.com/apache/texera/security/dependabot/613),
[#623](https://github.com/apache/texera/security/dependabot/623),
[#616](https://github.com/apache/texera/security/dependabot/616) |
| vite | 7.3.2 | 7.3.6 |
[#591](https://github.com/apache/texera/security/dependabot/591) (high),
[#594](https://github.com/apache/texera/security/dependabot/594) |
| piscina | 5.1.4 | 5.2.0 |
[#610](https://github.com/apache/texera/security/dependabot/610) (high)
|
| webpack-dev-server | 5.2.3 | 5.2.5 |
[#609](https://github.com/apache/texera/security/dependabot/609),
[#518](https://github.com/apache/texera/security/dependabot/518) |
| esbuild | 0.27.3 | 0.28.1 |
[#555](https://github.com/apache/texera/security/dependabot/555) |
| postcss | 8.5.6 | 8.5.12 |
[#474](https://github.com/apache/texera/security/dependabot/474) |

13 alerts total (4 high). Not covered here (separate lockfile copies of
the same packages, planned as a follow-up refresh): undici `^6.25.0`
([#622](https://github.com/apache/texera/security/dependabot/622),
[#620](https://github.com/apache/texera/security/dependabot/620),
[#615](https://github.com/apache/texera/security/dependabot/615)) and
vite 8.x
([#593](https://github.com/apache/texera/security/dependabot/593),
[#590](https://github.com/apache/texera/security/dependabot/590)).

The framework/CDK alignment additionally clears the `YN0060`
incorrect-peer-dependency warnings printed on every `yarn install` (the
tree previously mixed 21.2.10 and 21.2.17).

Diff is `frontend/package.json` + the corresponding `yarn.lock`
re-resolution; no config or code changes.

### Any related issues, documentation, discussions?

Closes #6154

### How was this PR tested?

Existing test cases; no behavior change expected.

- `yarn build` (production `ng build`) — succeeds, only pre-existing
CommonJS warnings.
- `yarn test:ci` — all suites pass (`NX Successfully ran target test for
project gui`).

Both were run after each of the two commits (toolchain bump;
framework/CDK alignment).

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Fable 5)

---------

(backported from commit fd79073)

Co-authored-by: Claude Fable 5 <[email protected]>
aglinxinyuan pushed a commit to aglinxinyuan/texera that referenced this pull request Jul 5, 2026
…#6155)

### What changes were proposed in this PR?

Patch-level alignment of all Angular packages in `frontend/`, across the
two Angular release lines:

| Line | Packages | Before | After |
| --- | --- | --- | --- |
| CLI toolchain | `@angular/cli`, `@angular-devkit/build-angular`,
`@angular-devkit/core`, `@angular-devkit/schematics`,
`@schematics/angular` | 21.2.8 | 21.2.18 |
| Framework | `@angular/{core,common,compiler,compiler-cli,localize}` |
21.2.17 | 21.2.17 (unchanged) |
| Framework |
`@angular/{animations,forms,router,platform-browser,platform-browser-dynamic}`
| 21.2.10 | 21.2.17 |
| CDK | `@angular/cdk` | 21.2.8 | 21.2.14 |

(The framework line has no 21.2.18 — 21.2.17 is its latest; CLI and
framework version independently.)

The toolchain bump is security-motivated: 21.2.8 exact-pins several
build-time dependencies with open advisories, which a plain lockfile
refresh cannot move. 21.2.18 re-pins them all to patched versions:

| Pinned dep | Before | After | Dependabot alerts resolved |
| --- | --- | --- | --- |
| undici | 7.24.4 | 7.28.0 |
[apache#617](https://github.com/apache/texera/security/dependabot/617) (high),
[apache#614](https://github.com/apache/texera/security/dependabot/614) (high),
[apache#621](https://github.com/apache/texera/security/dependabot/621),
[apache#613](https://github.com/apache/texera/security/dependabot/613),
[apache#623](https://github.com/apache/texera/security/dependabot/623),
[apache#616](https://github.com/apache/texera/security/dependabot/616) |
| vite | 7.3.2 | 7.3.6 |
[apache#591](https://github.com/apache/texera/security/dependabot/591) (high),
[apache#594](https://github.com/apache/texera/security/dependabot/594) |
| piscina | 5.1.4 | 5.2.0 |
[apache#610](https://github.com/apache/texera/security/dependabot/610) (high)
|
| webpack-dev-server | 5.2.3 | 5.2.5 |
[apache#609](https://github.com/apache/texera/security/dependabot/609),
[apache#518](https://github.com/apache/texera/security/dependabot/518) |
| esbuild | 0.27.3 | 0.28.1 |
[apache#555](https://github.com/apache/texera/security/dependabot/555) |
| postcss | 8.5.6 | 8.5.12 |
[apache#474](https://github.com/apache/texera/security/dependabot/474) |

13 alerts total (4 high). Not covered here (separate lockfile copies of
the same packages, planned as a follow-up refresh): undici `^6.25.0`
([apache#622](https://github.com/apache/texera/security/dependabot/622),
[apache#620](https://github.com/apache/texera/security/dependabot/620),
[apache#615](https://github.com/apache/texera/security/dependabot/615)) and
vite 8.x
([apache#593](https://github.com/apache/texera/security/dependabot/593),
[apache#590](https://github.com/apache/texera/security/dependabot/590)).

The framework/CDK alignment additionally clears the `YN0060`
incorrect-peer-dependency warnings printed on every `yarn install` (the
tree previously mixed 21.2.10 and 21.2.17).

Diff is `frontend/package.json` + the corresponding `yarn.lock`
re-resolution; no config or code changes.

### Any related issues, documentation, discussions?

Closes apache#6154

### How was this PR tested?

Existing test cases; no behavior change expected.

- `yarn build` (production `ng build`) — succeeds, only pre-existing
CommonJS warnings.
- `yarn test:ci` — all suites pass (`NX Successfully ran target test for
project gui`).

Both were run after each of the two commits (toolchain bump;
framework/CDK alignment).

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Fable 5)

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants