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

General: Add dynamic tab titles #8145

Merged
merged 5 commits into from
Apr 10, 2024
Merged

Conversation

mallgaier
Copy link
Member

@mallgaier mallgaier commented Mar 6, 2024

Checklist

General

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
  • I strictly followed the client coding and design guidelines.
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.

Motivation and Context

Currently, Artemis only provides static tab titles defined in the router modules.
The static tab titles make navigation difficult when several tabs are open. If several tabs with the same title (e.g. "Programming Exercise") are open at the same time, navigation between the tabs is very limited.

Description

This PR extends the breadcrumb implementation of the client. Despite the most specific title of the respective page (either dynamically (e.g. exercise title) or statically) , the exercise title, the exam, the lecture title and the course title are (optionally) included. The tab titles are build from the most specific to the most general title, separate by a |.
As a fallback, the statically defined titles in the router modules are used.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Navigate around and make sure, that the tab titles have a meaningful and hierarchical structure.

Testserver States

Note

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







Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Test Coverage

Screenshots

image
image
image
image

Summary by CodeRabbit

  • New Features
    • Enhanced the navigation bar to dynamically display titles for courses, exercises, lectures, and exams, improving user navigation and context awareness.

@mallgaier mallgaier added enhancement client Pull requests that update TypeScript code. (Added Automatically!) component:Shared small labels Mar 6, 2024
@mallgaier mallgaier added this to In progress in Artemis Development via automation Mar 6, 2024
@mallgaier mallgaier self-assigned this Mar 6, 2024
Copy link

github-actions bot commented Mar 6, 2024

⚠️ Unable to deploy to test servers ⚠️

The docker build needs to run through before deploying.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Mar 6, 2024
@github-actions github-actions bot removed the deployment-error Added by deployment workflows if an error occured label Mar 6, 2024
@mallgaier mallgaier temporarily deployed to artemis-test6.artemis.cit.tum.de March 6, 2024 11:02 — with GitHub Actions Inactive
@mallgaier mallgaier marked this pull request as ready for review March 6, 2024 11:09
@mallgaier mallgaier requested a review from a team as a code owner March 6, 2024 11:09
Copy link

coderabbitai bot commented Mar 6, 2024

Walkthrough

The update involves enhancing the navigation bar component within an Angular application to manage and display dynamic tab titles. By importing necessary modules and adding new properties and methods, the component now supports setting specific titles for courses, exercises, lectures, and exams based on the current page context. This enhancement aims to improve user experience by providing clearer navigation cues.

Changes

File Path Change Summary
.../app/shared/layouts/navbar/navbar.component.ts - Imported Title from @angular/platform-browser.
- Added properties for various entity titles.
- Added methods for building, initializing, and setting tab titles based on entity types.

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/schema.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.

@artemis-bot artemis-bot moved this from In progress to Ready for review in Artemis Development Mar 6, 2024
Artemis Development automation moved this from Ready for review to Review in progress Mar 6, 2024
@mallgaier mallgaier dismissed coderabbitai’s stale review March 6, 2024 11:15

Not needed, as the default titles are defined in the router modules.

@egekurt123
Copy link
Contributor

Tested on ts3; besides Anton´s comments, Create Exam Page also just has "Create" as a tab title. Apart from that, it looks great.

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 TS3. The exercise import functionality is not entirely consistent:

Navigate to the management view of a course > Exercises

  • Import Programming -> Title: Import | (name of the course)
  • Import Quiz -> Title: (name of the course)
  • Import Modeling, File Upload, Text exercise -> Title: (name of the imported exercise) | (name of the course)

Maybe it could be Import (type of the exercise) | (name of the course)?

(note: In exams > exercise groups, it's Import | (title of the exam) | (name of the course) regardless of the exercise type)

@krusche krusche modified the milestones: 6.9.4, 6.9.5, 7.0.0 Mar 24, 2024
Copy link

github-actions bot commented Apr 7, 2024

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

Copy link

⚠️ Unable to deploy to test servers ⚠️

The docker build needs to run through before deploying.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Apr 10, 2024
@github-actions github-actions bot removed the deployment-error Added by deployment workflows if an error occured label Apr 10, 2024
@mallgaier mallgaier temporarily deployed to artemis-test1.artemis.cit.tum.de April 10, 2024 16:24 — with GitHub Actions Inactive
@pzdr7 pzdr7 temporarily deployed to artemis-test3.artemis.cit.tum.de April 10, 2024 20:00 — with GitHub Actions Inactive
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 TS3. All in all, looks good. We can work out any remaining inconsistencies in follow-up PRs 👍

@krusche krusche merged commit eb14d74 into develop Apr 10, 2024
58 of 62 checks passed
@krusche krusche deleted the enhancement/dynamic-tab-titles-2 branch April 10, 2024 20:19
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!) enhancement
Projects
Archived in project
Artemis Development
  
Review in progress
Development

Successfully merging this pull request may close these issues.

None yet

5 participants