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

feat: introduce standalone mode #162

Merged
merged 4 commits into from
Jul 2, 2024
Merged

feat: introduce standalone mode #162

merged 4 commits into from
Jul 2, 2024

Conversation

emersion
Copy link
Collaborator

@emersion emersion commented Jun 27, 2024

Description

This is the first part of #158, cleaned-up and rebased.

This is missing inputs/outputs for AppComponent: that work will come as a second follow-up PR once this one is merged.

The normal behavior of the application remains the same (ngsscbuild has not been modified, only scripts to trigger new standalone environment have been added)

Checklist

  • This PR contains a description of the changes I'm making
  • I've read the Contribution Guidelines
  • I've added tests for changes or features I've introduced
  • I documented any high-level concepts I'm introducing in documentation/
  • CI is currently green and this is ready for review

@emersion emersion requested a review from aiAdrian as a code owner June 27, 2024 10:45
Comment on lines +66 to +71
getSidebarContainerStyle(): string {
if (this.disableBackend) {
return "top: 53px;";
}
return "top: 85px;";
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm, I wonder if we should instead add a disable-backend CSS class, and use that to guard the CSS rules, instead of this?

@@ -48,13 +52,24 @@ export class NetzgrafikApplicationComponent {
.subscribe((params) => {
uiInteractionService.setEditorMode(EditorMode.NetzgrafikEditing);
uiInteractionService.showNetzgrafik();
versionControlService.load(params.getVariantId(), true);
try {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there a reason why this is a try/catch instead of a if (disableBackend)?

Comment on lines +74 to +79
getLayoutContentStyle(): string {
if (environment.disableBackend) {
return "height: 100%;";
}
return "";
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ditto: could use a CSS class here instead.

authConfig: AuthConfig;
backendUrl?: string;
authConfig?: AuthConfig;
disableBackend: boolean;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We've been wondering whether it would make more sense to drop the disableBackend field, and instead make it so a null backendUrl means that the backend is disabled. Personally I think that'd make sense since backendUrl is nullable.

louisgreiner and others added 2 commits June 27, 2024 12:58
Co-authored-by: adrian_egli <adrian.egli@gmail.com>
Co-authored-by: Simon Ser <contact@emersion.fr>
Co-authored-by: Louis Greiner <greiner.louis@gmail.com>
@emersion emersion reopened this Jun 27, 2024
@emersion emersion changed the title Introduce standalone mode feat: introduce standalone mode Jun 27, 2024
…doesn't work correctly. This fix resolves the issue.
Copy link
Collaborator

@aiAdrian aiAdrian left a comment

Choose a reason for hiding this comment

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

This part can be merged

@aiAdrian aiAdrian merged commit cc4c56b into main Jul 2, 2024
8 checks passed
@aiAdrian aiAdrian deleted the standalone-ep-1 branch July 2, 2024 19:54
@emersion
Copy link
Collaborator Author

emersion commented Jul 2, 2024

Thank you!

louisgreiner added a commit that referenced this pull request Jul 9, 2024
* feat: introduce standalone mode

Co-authored-by: adrian_egli <adrian.egli@gmail.com>
Co-authored-by: Simon Ser <contact@emersion.fr>

* feat: register as a custom element

Co-authored-by: Louis Greiner <greiner.louis@gmail.com>

* fix: easy return

* small fix - the use of ng-container embeded in the sbb-icon-sidebare doesn't work correctly. This fix resolves the issue.

---------

Co-authored-by: Louis Greiner <greiner.louis@gmail.com>
Co-authored-by: adrian_egli <adrian.egli@gmail.com>
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