Skip to content

consolidated mumukshu report#122

Open
vvshk wants to merge 1 commit intodevfrom
feat/consolidated-mumukshu-report
Open

consolidated mumukshu report#122
vvshk wants to merge 1 commit intodevfrom
feat/consolidated-mumukshu-report

Conversation

@vvshk
Copy link
Copy Markdown
Collaborator

@vvshk vvshk commented Mar 3, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the administrative capabilities by introducing a comprehensive 'Person History' feature. It allows administrators to view a consolidated report of a cardholder's activities, including booking timelines, open maintenance issues, and WiFi code usage, all accessible from a new dedicated page. This provides a more detailed and centralized view of individual card usage and related data, improving operational oversight.

Highlights

  • New 'View History' Feature: Introduced a new 'View History' button on each card entry in the admin interface, allowing users to navigate to a dedicated page for a cardholder's activity.
  • Person History Page: Added a new HTML page (personHistory.html) and its corresponding JavaScript logic (personHistory.js) to display a consolidated report of a person's booking history, open maintenance requests, and WiFi codes.
  • Consolidated Data Display: The new history page fetches and renders a summary of upcoming and past activities, open maintenance items, and WiFi codes, providing a comprehensive overview for administrators.
  • Code Refinements: Minor code cleanup and formatting adjustments were made in admin/card/index.js, including simplifying URL encoding and updating table colspan for 'No results found' messages.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • admin/card/index.js
    • Added a 'View History' button to each card entry, which stores the card number in session storage and redirects to the new personHistory.html page.
    • Adjusted the colspan attribute for the 'No results found' message from 3 to 4 to accommodate the new action column.
    • Simplified the encodeURIComponent call for search queries.
    • Removed a commented-out placeholder function resetAlert().
  • admin/card/personHistory.html
    • Added a new HTML file to serve as the interface for displaying a person's booking history and related activities.
    • Included necessary script references for role checking, configuration, session storage, and the new personHistory.js.
    • Structured the page with sections for a summary box, upcoming activities, past 30 days activities, open maintenance, and WiFi codes.
  • admin/card/personHistory.js
    • Added a new JavaScript file responsible for fetching and rendering detailed activity data for a specific card number.
    • Implemented functions to dynamically display a summary of activities, timeline tables for bookings, maintenance requests, and WiFi codes.
    • Included helper functions for formatting activity types, dates, and status indicators with appropriate styling.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new feature to view a person's activity history. However, the implementation introduces critical Cross-Site Scripting (XSS) vulnerabilities due to the unsafe handling of data when building the UI, specifically in admin/card/personHistory.js. Untrusted data from the API is directly rendered into the DOM using innerHTML across multiple functions (renderSummary, renderTimelineTable, renderMaintenance, and renderWifi). These should be refactored to use textContent or a robust sanitization library to prevent arbitrary code execution in the user's browser. Additionally, an outdated version of jQuery with known vulnerabilities is used. Refactor inline styles to CSS classes to improve code quality.

<meta charset="UTF-8" />
<title>Person History</title>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The version of jQuery used (1.11.2) is outdated and has known security vulnerabilities, such as Cross-Site Scripting (XSS) (e.g., CVE-2015-9251). Please update to the latest stable version of jQuery (3.x) to mitigate these risks.

Suggested change
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

Comment on lines +111 to +122
html += `
<tr>
<td>${item.department}</td>
<td>${item.work_detail}</td>
<td><span style="color:red;font-weight:bold;">OPEN</span></td>
</tr>
`;
});

html += `</tbody></table>`;

el.innerHTML = html;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-high high

The renderMaintenance function uses innerHTML to render untrusted data (item.department, item.work_detail) from the API. This allows for arbitrary JavaScript execution if the API response is compromised.

Comment on lines +148 to +159
html += `
<tr>
<td>${item.username}</td>
<td>${item.ssid || '-'}</td>
<td>${item.status}</td>
</tr>
`;
});

html += `</tbody></table>`;

el.innerHTML = html;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

security-high high

The renderWifi function uses innerHTML to render untrusted data (item.username, item.ssid, item.status) from the API, leading to a potential XSS vulnerability.

<h1>Person Booking History</h1>
</div>

<div id="summaryBox" style="margin-bottom:20px;"></div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability and separate concerns, it's best to avoid inline styles. Please move this style to a CSS class in your stylesheet (/style/css/styles.css) and apply the class to the element.

Suggested change
<div id="summaryBox" style="margin-bottom:20px;"></div>
<div id="summaryBox" class="summary-box"></div>

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.

2 participants