-
Notifications
You must be signed in to change notification settings - Fork 1
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 78 aufrufe in bearbeitung #887
base: next
Are you sure you want to change the base?
Conversation
…ern und nutzen um die Tabelle zu aktualisieren bzw. Controller mit erweiterter Aufruf
WalkthroughThe changes update the queue management functionality across the system. The JavaScript module now conditionally handles and persists the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant C as Client (JS)
participant LS as LocalStorage
participant S as Server (QueueTable)
participant T as UI Template
U->>C: Click #called-appointments
C->>LS: Retrieve 'calledPanelOpen'
C->>S: AJAX request (load queue list)
S-->>C: Return filtered & sorted queue list
C->>T: Render queue table with status column
C->>LS: Update 'calledPanelOpen' state
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
zmsadmin/src/Zmsadmin/QueueTable.php (1)
72-82
: LGTM! Well-structured sorting mechanism.The sorting logic effectively prioritizes status order before call time, using a clear and maintainable approach. Consider extracting the status order array as a class constant for better maintainability.
class QueueTable extends BaseController { + private const STATUS_ORDER = ['called' => 0, 'processing' => 1]; protected $processStatusList = ['preconfirmed','confirmed', 'queued', 'reserved', 'deleted']; // ... other code ... $queueListCalled->uasort(function ($queueA, $queueB) { - $statusOrder = ['called' => 0, 'processing' => 1]; - $cmp = $statusOrder[$queueA->status] <=> $statusOrder[$queueB->status]; + $cmp = self::STATUS_ORDER[$queueA->status] <=> self::STATUS_ORDER[$queueB->status]; if ($cmp !== 0) { return $cmp; } return $queueB->callTime <=> $queueA->callTime; });zmsadmin/js/block/queue/index.js (2)
42-62
: LGTM! State persistence implemented correctly.The load method effectively handles state persistence using localStorage and updates the UI accordingly. Consider extracting the localStorage key as a constant to avoid magic strings.
class View extends BaseView { + static STORAGE_KEY = 'calledPanelOpen'; // ... other code ... load(withCalled = false) { if (withCalled === false) { - const storedState = localStorage.getItem('calledPanelOpen'); + const storedState = localStorage.getItem(View.STORAGE_KEY); withCalled = (storedState === 'true'); } const url = `${this.includeUrl}/queueTable/?selecteddate=${this.selectedDate}&withCalled=${withCalled ? 1 : 0}`; return this.loadContent(url, 'GET', null, null, this.showLoader) .then(() => { - const storedState = localStorage.getItem('calledPanelOpen'); + const storedState = localStorage.getItem(View.STORAGE_KEY); if (storedState === 'true') { $('#called-appointments').addClass('active'); $('#called-appointments').next('.accordion-panel').css('display', 'block');
88-88
: LGTM! Event handler updated for state persistence.The state persistence in the click handler is consistent with the load method. Update to use the same constant for the localStorage key.
- localStorage.setItem('calledPanelOpen', this.withCalled ? 'true' : 'false'); + localStorage.setItem(View.STORAGE_KEY, this.withCalled ? 'true' : 'false');zmsadmin/templates/block/queue/table.twig (1)
235-245
: Add accessibility attributes to status icons.The status cell implementation is well-structured with clear visual indicators. Consider adding ARIA labels for better accessibility.
<td> <div style="display: flex; justify-content: center; align-items: center; height: 100%;"> {% if item.status == 'called' %} - <i class="fas fa-tv" style="color: #0053b4;"></i> + <i class="fas fa-tv" style="color: #0053b4;" aria-label="Status: Called" role="img"></i> {% elseif item.status == 'processing' %} - <i class="fas fa-hourglass-half" style="color: #0053b4;"></i> + <i class="fas fa-hourglass-half" style="color: #0053b4;" aria-label="Status: Processing" role="img"></i> {% else %} - {{ item.status }} + <span role="status">{{ item.status }}</span> {% endif %} </div> </td>
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
zmsadmin/js/block/queue/index.js
(2 hunks)zmsadmin/src/Zmsadmin/QueueTable.php
(1 hunks)zmsadmin/templates/block/queue/table.twig
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
zmsadmin/src/Zmsadmin/QueueTable.php (1)
67-67
: LGTM! Status filter extended to include processing state.The status filter now correctly includes both 'called' and 'processing' states, which aligns with the queue management enhancements.
zmsadmin/templates/block/queue/table.twig (1)
211-211
: LGTM! Status column header added.The Status column header is correctly added to the table.
Pull Request Checklist (Feature Branch to
next
):next
Branch in meinen Feature-Branch gemergt.Summary by CodeRabbit