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

[PF-48] - Builder integration changes #5

Merged
merged 31 commits into from
Nov 5, 2023
Merged

[PF-48] - Builder integration changes #5

merged 31 commits into from
Nov 5, 2023

Conversation

mazarijuraj
Copy link
Contributor

@mazarijuraj mazarijuraj commented Oct 5, 2023

Description

Code refactor and changes made by integration into builder. Example project should be updated in near future to reflect builder implementation changes (marked with // TODO: PF-48 comments).

Implements PF-48

mazarijuraj and others added 25 commits October 26, 2022 16:04
- add support for svg grid bakcground
- replace panzoom with @panzoom/panzoom
- fix import in grid configuration
- add option for cursor type
- remove unused css class
- add isActive function for activable classes
- rename functions for better readability
- rename functions for better readability
- fix lasso tool
- fix moving of canvas on each mouse down + move event
- add select tool
- add event propagation
- decouple library stage 1
- decouple library stage 2 with modeler necessary functions
- changes to behavior of marking nodes of place
- add comments for future rework
- merge canvas configuration service with canvas service
- fix problem with marker ends of arcs not highlighted on hover
- add function to get all child elements of canvas element
- make Container not abstract to use in Canvas
- add containers for arcs, places and transition to fix ordering in svg element
- add static methods for creating petriflow.svg elements without instantiating petri.svg elements
- fix background position i svg DOM tree
- fix background position of labels
- fix background position of labels
- fix empty label showing background
- add updateLine method to repaint arc line points
- remove events on mouse over/out
- add comments for future refactor
- remove radius from canvas config, use size instead
- add missing abstract deactivate method to petriflow canvas element
@@ -1,12 +1,15 @@
<mat-toolbar fxLayout="row" class="app-container mat-toolbar mat-toolbar-single-row">
<mat-toolbar-row fxFlex>
<mat-icon id="netgrif-icon" svgIcon="netgrif_logo"></mat-icon>
<mat-button-toggle-group [value]="_mode" fxLayoutAlign="start end">
<mat-button-toggle-group [(ngModel)]="_mode" fxLayoutAlign="start end">
Copy link

Choose a reason for hiding this comment

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

why ngModel? Can be done with FormGroup https://angular.io/api/forms/FormGroup

})
export class ControlPetriflowCanvasService extends PetriflowCanvasService {

private arcTypes = ['regular', 'reset', 'inhibitor', 'read'];
Copy link

Choose a reason for hiding this comment

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

could reference the enum values? Why separate?


selectAll() {
this.petriflowElementsCollection.all.forEach(element => {
element.select();
Copy link

Choose a reason for hiding this comment

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

setSelectedByRectangleEnclosure method does setSelected(true) and activate(). Why are there differences?

this.moveBreakpoint(e);
if (this.mouseDown && this.mode === CanvasMode.LASSO) {
if (!this.canvas) {
throw new Error('SVG canvas for petriflow objects doesn\'t exists!');
Copy link

Choose a reason for hiding this comment

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

the \ could be dropped if " or ` was used do delimit the string

};

addTransitionEvents(petriflowTransition: PetriflowTransition): void {
// @ts-ignore
Copy link

Choose a reason for hiding this comment

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

why is the @ts-ignore needed?

});
}

// @ts-ignore
Copy link

Choose a reason for hiding this comment

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

why @ts-ignore?

}
if (this._source.canvasElement instanceof Place) {
switch (type) {
case 'regular': {
Copy link

Choose a reason for hiding this comment

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

why not enum values?

return undefined;
}

// @ts-ignore
Copy link

Choose a reason for hiding this comment

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

why @ts-ignore?

}
}
if (this._mode === CanvasMode.SELECT) {
}
Copy link

Choose a reason for hiding this comment

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

empty if

- fix missing svg element ids
- fix missing svg element ids
- fix missing svg container ids
- fix missing svg container ids
- fix label background incorrect size
@pull-request-quantifier-deprecated

This PR has 1981 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Large
Size       : +1148 -833
Percentile : 100%

Total files changed: 60

Change summary by file extension:
.sh : +26 -0
.json : +8 -5
.html : +22 -4
.scss : +2 -5
.ts : +1090 -819

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detected.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@tuplle
Copy link
Member

tuplle commented Nov 5, 2023

All comments are about the example-app which is subject of planned refactor in the next release.

@tuplle tuplle merged commit bf24e90 into next Nov 5, 2023
4 of 5 checks passed
@tuplle tuplle deleted the PF-48 branch November 5, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants