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: Disable readonly input elements #8114

Merged
merged 5 commits into from Mar 2, 2024

Conversation

milljoniaer
Copy link
Contributor

@milljoniaer milljoniaer commented Mar 2, 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 multiple screenshots/screencasts of my UI changes.

Motivation and Context

Bootstrap changed their styling for form-controls. Readonly input elements are no longer styled, but only disabled still are.
See twbs/bootstrap#36499

Also closes #8005

Description

This PR adds disabled to readonly input elements to work the same but show some disabled styling. ID input fields are always deactivated and we decided to remove them from the form, since they dont bring any value.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Try some of the edited forms (e.g. programming exercise, course...) and verify that they still work and are correct styled

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

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor
    • Simplified input and form field interactions by removing unnecessary ID displays and updating attribute bindings in various components.
    • Changed attribute bindings from [readOnly] to [disabled] for improved user interface consistency.
    • Updated input fields to be disabled or read-only based on the presence of course ID for a cleaner user interface in course management and lecture components.

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

coderabbitai bot commented Mar 2, 2024

Walkthrough

The recent updates aim to improve the user interface by removing unnecessary ID fields from various forms and transitioning from using the readonly attribute to disabled for input elements. These changes enhance data presentation and interaction consistency within the application.

Changes

File Path Change Summary
.../lti-configuration/edit-lti-configuration.component.html Removed ID field display.
.../organization-management/...-update.component.html Removed organization ID display.
.../system-notification-management/...-update.component.html Removed ID field display in system notification form.
.../user-management/user-management-update.component.html Removed user ID display.
.../unreferenced-feedback-detail/...detail.component.html Updated disabled attribute binding based on conditions.
.../course/manage/course-update.component.html Removed course ID display; disabled course short name input based on ID presence.
.../plagiarism-cases/instructor-view/detail-view/...detail-view.component.html Simplified input elements by removing readonly and form-inline attributes.
.../exam/manage/exams/exam-update.component.html Removed course information and exam ID display; updated working time input to be disabled.
.../exam/participate/exercises/text/text-exam-submission.component.html Modified disabled attribute binding based on conditions.
.../exercises/file-upload/manage/...update.component.html Removed exercise ID display.
.../exercises/modeling/manage/modeling-exercise-update.component.html Removed ID field display for modelingExercise.
.../exercises/modeling/shared/modeling-explanation-editor.component.html Changed [readOnly] to [disabled] for textarea.
.../exercises/programming/manage/update/.../programming-exercise-information.component.html Removed ID field display; changed readonly to disabled for shortName input. Also updated validation logic for shortNameField.
.../exercises/quiz/manage/quiz-exercise-update.component.html Removed ID field display if not importing or if ID is falsy.
.../exercises/shared/exercise-hint/manage/exercise-hint-update.component.html Removed exercise hint ID display.
.../exercises/shared/team/team-update-dialog/...dialog.component.html Changed [readonly] to [disabled] for shortName input.
.../exercises/text/assess/textblock-feedback-editor/...editor.component.html Changed [readOnly] to [disabled] for elements.
.../exercises/text/manage/text-exercise/...update.component.html Removed exercise ID display.
.../exercises/text/participate/text-editor.component.html Adjusted disabled attribute condition based on flags.
.../lecture-unit/.../attachment-unit-form/...form.component.html Updated version input field to be disabled.
.../lecture/lecture-update.component.html Removed lecture ID display.
.../course-conversations/.../conversation-info/conversation-info.component.html Switched from readonly to disabled for textareas.

Assessment against linked issues

Objective Addressed Explanation
Exam creation: Redundant field

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@artemis-bot artemis-bot added this to In progress in Artemis Development Mar 2, 2024
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Mar 2, 2024
@@ -123,7 +111,7 @@ <h5 class="pb-1" jhiTranslate="artemisApp.examManagement.sections.conduction">Ex
<label class="form-check-label" for="workingTimeInMinutes" jhiTranslate="artemisApp.examManagement.workingTime">Working Time</label>
<jhi-help-icon [text]="'artemisApp.examManagement' + (exam.testExam ? '.testExam' : '') + '.workingTimeTooltip'" />
@if (!exam.testExam) {
<input readonly type="text" class="form-control" [value]="workingTimeInMinutes" />
<input disabled type="text" class="form-control" [value]="workingTimeInMinutes" />
Copy link

Choose a reason for hiding this comment

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

The change to disable the input field for working time (<input disabled type="text" class="form-control" [value]="workingTimeInMinutes" />) instead of making it read-only is consistent with the PR's objective to align with Bootstrap's updated styling guidelines. This ensures that the input field is styled appropriately according to the new guidelines. However, it's important to ensure that this change does not impact the functionality where the value of workingTimeInMinutes needs to be submitted with the form, as disabled fields are not included in form submissions. Consider using a hidden input field to store the value if it needs to be submitted.

Artemis Development automation moved this from In progress to Review in progress Mar 2, 2024
@milljoniaer milljoniaer changed the title General: Replace readonly with disabled on input elements General: Add disabled on readonly input elements Mar 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: The forms I tested (user management, system notifications, update course, update exam, update exercise for all exercise types, explanation for modeling exercises) all worked as expected.

@krusche krusche changed the title General: Add disabled on readonly input elements General: Disable readonly input elements Mar 2, 2024
@krusche krusche added this to the 6.9.0 milestone Mar 2, 2024
Copy link
Member

@krusche krusche 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 👍

@krusche krusche merged commit 6e44346 into develop Mar 2, 2024
23 of 29 checks passed
@krusche krusche deleted the chore/replace-readonly-with-disabled branch March 2, 2024 20:24
@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Mar 5, 2024
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!) deployment-error Added by deployment workflows if an error occured ready for review
Projects
No open projects
Artemis Development
  
Review in progress
Development

Successfully merging this pull request may close these issues.

Exam creation: Redundant field
4 participants