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:(zmskvr-299): removal of calendar from workstation #937

Closed

Conversation

matthilo96
Copy link
Contributor

@matthilo96 matthilo96 commented Mar 14, 2025

Pull Request Checklist (Feature Branch to next):

  • Ich habe die neuesten Änderungen aus dem next Branch in meinen Feature-Branch gemergt.
  • Das Code-Review wurde abgeschlossen.
  • Fachliche Tests wurden durchgeführt und sind abgeschlossen.

Beschreibung:

  • Entfernung des Kalendars in Sachbearbeiteransicht
  • Verbreiterung der Maske
  • Kalender wird zukünftig nur noch im "counter" geladen
  • Abstand queueTable zur Maske verkürzt

Summary by CodeRabbit

  • New Features

    • Introduced an interactive “Next Customer” button that now displays real-time metrics, including visual indicators and waiting time averages.
    • Enhanced the display of key workstation information, ensuring data reflects the current date accurately.
  • Bug Fixes

    • Improved conditional checks for loading processes on the workstation page, ensuring proper functionality based on the current context.
  • Style

    • Streamlined the workstation layout with adjusted grid spacing and a simplified view of waiting customer details.
    • Removed the calendar view to focus on core functionalities and improve overall user clarity.

Copy link
Contributor

coderabbitai bot commented Mar 14, 2025

Walkthrough

This pull request introduces conditional checks and new methods in the workstation JavaScript view, ensuring that page-specific actions such as loading client data and calendar views occur only when appropriate. Additionally, the backend captures the current date and obtains extra workstation information for response rendering. Several Twig templates have been updated to remove redundant waiting time details, refactor traffic light indicators, and adjust layout dimensions by removing the calendar component and modifying grid sizes.

Changes

File(s) Change Summary
zmsadmin/js/.../workstation/index.js Added a new method loadClientNext(showLoader, loadProcess) and updated several processes to conditionally call it when the page is "workstation". Modified loadCalendar(showLoader) to instantiate CalendarView only when the page is "counter".
zmsadmin/src/.../WorkstationProcess.php Introduced $selectedDate (current date in Y-m-d format) and $workstationInfo (fetched via getInfoBoxData), then included both in the response data.
zmsadmin/templates/block/process/footer.twig, .../next.twig, .../queue/info.twig Removed Twig blocks that previously displayed waiting time estimates and workstation information; replaced an anchor tag with a button for next customer invocation; added a new footer section with traffic light indicators and waiting metrics; refactored HTML/CSS for waiting customer indicators.
zmsadmin/templates/page/workstation.twig Adjusted layout by reducing the grid's min-height from 850px to 775px, widened a grid item by changing its class from six-twelfths to nine-twelfths, and removed the calendar component entirely.

Sequence Diagram(s)

sequenceDiagram
    participant Process as Queue/Appointment Process
    participant View as Workstation View
    Process->>View: Execute onQueueProcess / onReserveProcess / onChangeProcess / onSaveProcess
    View->>View: Load appointment form
    alt Page is "workstation"
        View->>View: Call loadClientNext(showLoader, loadProcess)
    end
Loading
sequenceDiagram
    participant Caller as UI Component
    participant View as Workstation View
    Caller->>View: Call loadCalendar(showLoader)
    alt Page is "counter"
        View->>View: Instantiate and return CalendarView
    else
        View-->>Caller: Return without CalendarView
    end
Loading

Suggested reviewers

  • ThomasAFink
  • manjencic

Poem

I'm a rabbit with a coding beat,
Hopping over bugs with nimble feet.
New checks and flows in every line,
Layouts trimmed to look just fine.
With metrics bright like stars that gleam,
I celebrate this code-up dream! 🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 799de3c and 6b531b6.

📒 Files selected for processing (1)
  • zmsadmin/templates/block/process/footer.twig (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@matthilo96 matthilo96 changed the title Feature zmskvr 299 removal of calendar from workstation feat:(zmskvr-299): removal of calendar from workstation Mar 14, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
zmsadmin/templates/block/process/next.twig (1)

87-140: Consider consolidating CSS styles

While the styling implementation works well, consider moving these styles to an external CSS file instead of embedding them in the template. This would improve maintainability and ensure consistency with other traffic light indicators in the application (like the one in queue/info.twig).

This would also align with best practices for separating content from presentation.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8030b7c and d3466f0.

📒 Files selected for processing (6)
  • zmsadmin/js/page/workstation/index.js (7 hunks)
  • zmsadmin/src/Zmsadmin/WorkstationProcess.php (3 hunks)
  • zmsadmin/templates/block/process/footer.twig (1 hunks)
  • zmsadmin/templates/block/process/next.twig (1 hunks)
  • zmsadmin/templates/block/queue/info.twig (1 hunks)
  • zmsadmin/templates/page/workstation.twig (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.{js,jsx,ts,tsx}`: Flag any usage of console.log() as i...

**/*.{js,jsx,ts,tsx}: Flag any usage of console.log() as it should be replaced with proper logging:

  1. For development: Use proper debug tools or logging libraries
  2. For production: Remove console.log() statements or use structured logging
  3. For errors: Use error tracking services (e.g., Sentry)
  4. For debugging: Consider using debug libraries that can be enabled/disabled

Example replacement:

// Instead of:
console.log('User data:', userData);

// Use:
logger.debug('Processing user data', { userData });
// or for development only:
if (process.env.NODE_ENV === 'development') {
  debug('User data:', userData);
}
  • zmsadmin/js/page/workstation/index.js
`**/*.php`: Flag any usage of error_log() as it should be re...

**/*.php: Flag any usage of error_log() as it should be replaced with proper logging mechanisms:

  1. For error handling: Use a proper logging framework with error levels (PSR-3 LoggerInterface)
  2. For debugging: Use a dedicated debug logger or remove debug statements
  3. For CLI output: Use a CLI output handler or symfony/console
  4. For application events: Use structured logging with proper log levels

Example replacement:

// Instead of:
error_log("Import failed - " . $e->getMessage());

// Use:
$logger->error("Import failed", ['error' => $e->getMessage()]);
  • zmsadmin/src/Zmsadmin/WorkstationProcess.php
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: call-php-build-images / build (zmsadmin, 8.0)
  • GitHub Check: call-php-build-images / build (zmsstatistic, 8.0)
  • GitHub Check: call-php-build-images / build (zmscalldisplay, 8.0)
  • GitHub Check: call-php-build-images / build (zmsticketprinter, 8.0)
🔇 Additional comments (17)
zmsadmin/templates/block/process/footer.twig (1)

1-3: Layout simplified to support calendar removal

The template has been streamlined to only display the current time, which aligns with the PR objective of removing the calendar from the workstation view.

zmsadmin/src/Zmsadmin/WorkstationProcess.php (4)

10-10: LGTM: Necessary import added

The DateTime class is appropriately imported to support date formatting functionality.


29-29: LGTM: Current date capture implemented

Current date is properly captured and formatted for consistent display.


38-38: LGTM: Helper method utilized properly

The workstation info is appropriately gathered using the helper method with the right parameters.


43-45: LGTM: Template variables correctly updated

The template now receives the necessary data to support the modified workstation view.

zmsadmin/templates/page/workstation.twig (2)

19-19: LGTM: Height adjustment supports layout changes

Reduced minimum height from 850px to 775px - this adjustment supports the PR objective of reducing distance between queue table and mask.


23-25: LGTM: Width adjustment implements UI changes

Changed grid item width from six-twelfths to nine-twelfths, properly implementing the PR objective to widen the mask after calendar removal.

zmsadmin/js/page/workstation/index.js (7)

206-207: LGTM: Page-specific client data loading added

Appropriately added conditional check to load client data only when on the workstation page.


239-240: LGTM: Consistent pattern for workstation page

Follows the same pattern of conditionally loading client data for the workstation page.


265-266: LGTM: Consistent implementation continues

Maintains consistency in the approach to workstation-specific functionality.


293-294: LGTM: Client data loading after save

Client data is appropriately refreshed after process save operation.


353-354: LGTM: Consistent pattern application

Continues the pattern of workstation-specific client data loading.


539-540: LGTM: Partial reload optimization

Optimizes reloads by only updating the client data when on the workstation page.


551-565: LGTM: Calendar removal implemented

This change implements the core PR objective by only loading the calendar component on the counter page, effectively removing it from the workstation view.

zmsadmin/templates/block/process/next.twig (2)

25-26: Clean button element closure

The button element is now properly closed, improving HTML structure. This is a good change for code correctness.


32-85: Great addition of waiting time and traffic light indicators

The footer section with waiting customer metrics provides valuable information for operators. The traffic light system offers an intuitive visual indicator of queue status, and the detailed waiting time statistics help manage customer expectations.

Some considerations:

  • The conditional logic for displaying waiting times is well-implemented
  • The structure using list elements with cell divisions creates a clear layout
zmsadmin/templates/block/queue/info.twig (1)

138-151: Improved traffic light implementation

The refactored traffic light implementation uses a cleaner approach with a single list item and conditional classes. This is more maintainable than separate elements for each condition.

The waiting customers variable assignment at the beginning improves readability by separating data processing from presentation.

Comment on lines +153 to +193
<style>

.traffic-light {
display: flex;
width: 100%;
height: 100%;
}

.wartende {
display: flex;
margin-left: 10px;
}

.cell.right {
display: flex;
align-items: center; /* Vertically align the items in the center */
}

.waiting-count {
font-size: 16px; /* Style for the number */
font-weight: bold;
margin-right: 10px;
}

.green {
background-color: rgba(0, 255, 0, 0.5); /* Green */
}

.yellow {
background-color: rgba(255, 255, 0, 0.5); /* Yellow */
}

.orange {
background-color: rgba(255, 127, 0, 0.5); /* Orange */
}

.red {
background-color: rgba(255, 0, 0, 0.5); /* Red */
}

</style>
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

CSS styling duplication across templates

The CSS styles for traffic lights are duplicated between this file and process/next.twig. This creates a maintenance challenge if styles need to be updated.

Consider extracting these styles to a common CSS file to maintain consistency and improve maintainability. This would ensure that traffic light indicators look the same throughout the application and make style updates easier.

-    <style>
-        
-        .traffic-light {                        
-            display: flex;
-            width: 100%;
-            height: 100%;
-        }
-
-        .wartende {
-            display: flex;
-            margin-left: 10px;
-        }
-
-        .cell.right {
-            display: flex;
-            align-items: center;  /* Vertically align the items in the center */
-        }
-
-        .waiting-count {
-            font-size: 16px;  /* Style for the number */
-            font-weight: bold;
-            margin-right: 10px;
-        }
-        
-        .green {
-            background-color: rgba(0, 255, 0, 0.5);  /* Green */
-        }
-
-        .yellow {
-            background-color: rgba(255, 255, 0, 0.5);  /* Yellow */
-        }
-
-        .orange {
-            background-color: rgba(255, 127, 0, 0.5);  /* Orange */
-        }
-
-        .red {
-            background-color: rgba(255, 0, 0, 0.5);  /* Red */
-        }
-
-    </style>

Add these styles to a common CSS file (e.g., traffic-light.css) and include it in your application's main stylesheet.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<style>
.traffic-light {
display: flex;
width: 100%;
height: 100%;
}
.wartende {
display: flex;
margin-left: 10px;
}
.cell.right {
display: flex;
align-items: center; /* Vertically align the items in the center */
}
.waiting-count {
font-size: 16px; /* Style for the number */
font-weight: bold;
margin-right: 10px;
}
.green {
background-color: rgba(0, 255, 0, 0.5); /* Green */
}
.yellow {
background-color: rgba(255, 255, 0, 0.5); /* Yellow */
}
.orange {
background-color: rgba(255, 127, 0, 0.5); /* Orange */
}
.red {
background-color: rgba(255, 0, 0, 0.5); /* Red */
}
</style>

@matthilo96 matthilo96 closed this Mar 17, 2025
@matthilo96 matthilo96 deleted the feature-zmskvr-299-removal-of-calendar-from-workstation branch March 17, 2025 11:22
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.

1 participant