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

Modeling exercises: Improve modeling editor readonly view #8275

Merged
merged 5 commits into from
Apr 5, 2024

Conversation

milljoniaer
Copy link
Contributor

@milljoniaer milljoniaer commented Mar 30, 2024

Checklist

General

Client

  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • I added multiple screenshots/screencasts of my UI changes.

Motivation and Context

Apollon UML Diagrams have been shown overcomplicated in their readonly views such as in modeling managament detail pages or as example solution in the students view.

Description

The UML Diagram is in readonly now exported as SVG element and will be displayed on plain background to reduce complexity.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Create a modeling exercise with due date and example solution set
  3. View the exercise in the management detail view
  4. View the example solution (once the example solution publication date is over) in the students view
  5. Verify that it looks correct

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Screenshots

image
image

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Enhanced the modeling editor with readonly mode support, including the ability to view diagrams as SVGs.
  • Style
    • Improved styling for text elements within .readonly-diagram to enhance visual contrast.
  • Refactor
    • Updated conditional rendering logic in the modeling editor for a more intuitive user experience.

@milljoniaer milljoniaer requested a review from a team as a code owner March 30, 2024 12:14
Copy link

coderabbitai bot commented Mar 30, 2024

Walkthrough

The recent updates introduce enhancements and conditional rendering across several components within a web application. Key changes include the addition of styling and conditional visibility in the modeling editor component, adjustments for readonly mode including SVG export functionality, and the removal of a specific CSS class from an element in the course exercise details. These modifications aim to improve the user interface and functionality, particularly for modeling exercises.

Changes

File Path Change Summary
.../detail-overview-list.component.html
.../exercise-details/course-exercise-details.component.html
Added p-3 border CSS class to <dd> element for DetailType.ModelingEditor. Removed editor-outline-background class from a dd element.
.../modeling/shared/modeling-editor.component.html
.../modeling/shared/modeling-editor.component.scss
Conditionally hid a <div> in the HTML file based on readOnly property. Added styling in the SCSS file to change text color within .readonly-diagram.
.../modeling/shared/modeling-editor.component.ts Imported SVG and DomSanitizer; added properties and modified ngAfterViewInit for readonly mode and SVG export.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Mar 30, 2024
@loreanvictor
Copy link
Contributor

@milljoniaer quick question: how about diagrams with some feedback/assessment attached? are they considered as readonly as well? if so, will the feedback/assessment be displayed and/or will it highlight the corresponding elements?

@milljoniaer
Copy link
Contributor Author

@loreanvictor thanks for the review, I removed the log.
Regarding your question:
We have a separate component modeling-assessment-editor.component.ts for this use case.
In the in this PR edited component modeling-editor.component.ts, the assessment is even deleted from the model as is shall not be displayed:

private initializeApollonEditor(): void {
if (this.apollonEditor) {
this.apollonEditor.unsubscribeFromModelChange(this.modelSubscription);
this.apollonEditor.destroy();
}
// Apollon doesn't need assessments in Modeling mode
ModelingEditorComponent.removeAssessments(this.umlModel);

rstief
rstief previously approved these changes Apr 2, 2024
Copy link
Contributor

@rstief rstief left a comment

Choose a reason for hiding this comment

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

code 👍

coolchock
coolchock previously approved these changes Apr 2, 2024
Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Tested on TS2. Light mode looks fine, but I don't suppose you could do anything about the font color when the user is in dark mode? It's a bit hard to read imo

Editing in dark mode (unchanged)

grafik

Viewing the example solution in the detail view

grafik

loreanvictor
loreanvictor previously approved these changes Apr 4, 2024
Copy link
Contributor

@loreanvictor loreanvictor left a comment

Choose a reason for hiding this comment

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

code looks good to me.

I think an improvement (that can be done later?) would be to do the exporting in ngAfterViewChecked() instead, so that if input of the component changes the rendered diagram updates as well.

rstief
rstief previously approved these changes Apr 4, 2024
coolchock
coolchock previously approved these changes Apr 4, 2024
Copy link
Contributor

@coolchock coolchock left a comment

Choose a reason for hiding this comment

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

re-approve

pzdr7
pzdr7 previously approved these changes Apr 4, 2024
Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Tested locally, looks good in dark and light mode 👍

@krusche krusche added this to the 7.0.0 milestone Apr 5, 2024
@krusche krusche merged commit dd752a5 into develop Apr 5, 2024
19 of 27 checks passed
@krusche krusche deleted the feat/improve-modeling-readonly-view branch April 5, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants