Skip to content

Comments

Bump version to v1.7.5#349

Merged
vrundakansara merged 3 commits intostagingfrom
bump-version
Aug 25, 2025
Merged

Bump version to v1.7.5#349
vrundakansara merged 3 commits intostagingfrom
bump-version

Conversation

@jaieds
Copy link
Contributor

@jaieds jaieds commented Aug 25, 2025

Description

Version 1.7.5 - 25th August, 2025
- New: Template - UAE Dashboard
- New: Template - UAE Widgets
- New: Template - SureForms Dashboard

Screenshots

Types of changes

How has this been tested?

Checklist:

  • My code is tested
  • My code passes the PHPCS tests
  • I've created the npm build.
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request

@@ -1,12 +1,12 @@
{
"name": "@bsf/force-ui",

Choose a reason for hiding this comment

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

What: The version number should not be updated directly in package-lock.json. Instead, run npm install with the new version in package.json.

Why: Directly editing package-lock.json can lead to inconsistencies since this file is auto-generated based on the dependencies listed in package.json. This could lead to potential issues during dependency resolution.

How: To properly update the version, edit the version key in package.json and then run npm install. This will update package-lock.json automatically as intended.

"version": "1.7.5",
"lockfileVersion": 3,
"requires": true,
"packages": {

Choose a reason for hiding this comment

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

What: Version number changes should be consistent across all dependencies.

Why: To ensure that all parts of your application are aligned with the correct versions and to avoid runtime issues caused by mismatches.

How: Check for other dependencies that should be updated in correlation to this version change. If this change is legitimate, ensure the entire dependency graph in package.json is also reflected.

@@ -1,6 +1,6 @@
{
"name": "@bsf/force-ui",

Choose a reason for hiding this comment

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

What: Version number increment detected: from 1.7.4 to 1.7.5.

Why: It is essential to maintain a clear versioning strategy to track changes, especially in libraries that might get integrated into larger projects. This will help users understand what has changed between versions and ensure compatibility.

How: Ensure you follow semantic versioning practices. If there were breaking changes, it should be at least a major version increment. If this update is a minor or patch update, document any important changes or features added in a changelog for clarity.

@@ -0,0 +1,732 @@
import React, { useState, useRef, useEffect } from 'react';

Choose a reason for hiding this comment

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

What: The form options are currently hard-coded in the component.

Why: Hard-coded options can make it difficult to manage or update the form selections dynamically. In case the forms need to be fetched from an API or modified frequently, it might reduce flexibility.

How: Consider fetching the form options from an API or storing them in a constants file to make future changes easier and more maintainable.

@@ -0,0 +1,732 @@
import React, { useState, useRef, useEffect } from 'react';

Choose a reason for hiding this comment

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

What: Ensure proper handling of the selectedForm state; there is no validation to handle what happens if the user selects an empty form.

Why: Allowing undefined or empty selections can lead to runtime errors or unexpected behaviors.

How: Implement validation to check if a form is selected before executing operations dependent on selectedForm, and provide a fallback or error message if necessary.

@@ -0,0 +1,732 @@
import React, { useState, useRef, useEffect } from 'react';

Choose a reason for hiding this comment

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

What: The chart and data rendering might lead to performance degradation if the data grows significantly as the current implementation does not handle large datasets efficiently.

Why: Rendering large datasets all at once can lead to a sluggish user interface especially if multiple elements on the screen need to be updated at once.

How: Consider using pagination or lazy loading techniques to render a subset of the data at a time or implement react virtualization for the chart to enhance performance.

@@ -0,0 +1,732 @@
import React, { useState, useRef, useEffect } from 'react';

Choose a reason for hiding this comment

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

What: Consider utilizing TypeScript for prop validation and better maintainability of the component.

Why: Using TypeScript can help catch errors at compile-time rather than runtime and can improve the overall developer experience with autocomplete and type checks.

How: If feasible, refactor the component to leverage TypeScript, defining appropriate interfaces for props and state to ensure type safety.

</div>
</div>
);
};

Choose a reason for hiding this comment

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

What: Performance: Lazy Loading of Components

Why: Rendering all components at once can lead to slower initial load times, especially for users on poor connections or devices.

How: Implement lazy loading for the components or images that are not immediately necessary for the first paint. This can be done using React's React.lazy() for components or dynamically loading assets.

@@ -0,0 +1,532 @@
import {

Choose a reason for hiding this comment

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

What: Code Optimization: Handle state updates efficiently

Why: The code uses a map function to create a new array for every switch change. This can be inefficient as state updates scale.

How: Consider using the functional form of setSwitchState to directly access the most recent value without creating a new mapped array, thereby optimizing re-render performance.

@@ -0,0 +1,538 @@
import {

Choose a reason for hiding this comment

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

What: Dependencies should be verified for security vulnerabilities.

Why: Imported components from @/components and lucide-react may potentially introduce vulnerabilities if not properly maintained. Always check for known vulnerabilities in dependencies.

How: Review the package versions and check the official repositories or security databases like npm audit for known vulnerabilities in the libraries you're using.

RadioButton,
} from '@/components';
import {
CircleHelp,

Choose a reason for hiding this comment

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

What: Consider more descriptive titles for your widgets instead of generic ones like 'Blockquote'.

Why: Having unique identifiers can help with debugging and understanding the structure of the widget system better.

How: Change titles to reflect the functionality or intended use of the widget (e.g., 'Quote Widget', 'Testimonial Block', etc.).

Container,
Button,
Switch,
Text,

Choose a reason for hiding this comment

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

What: Use constants for hardcoded strings or values to enhance maintainability.

Why: Changing a string or numeric value in multiple places can lead to bugs; using constants improves maintainability.

How: Define constants at the top of your file for titles, colors, etc. (e.g., const BLOCKQUOTE_TITLE = 'Blockquote';).

@@ -1,3 +1,3 @@
{
"force-ui": "1.7.4"

Choose a reason for hiding this comment

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

What: Consider adding timestamps or version changelogs within this file to provide context for version changes.

Why: Having a changelog or timestamp helps with tracking changes over time and aids in managing version histories more effectively.

How: You could add an additional key in this JSON object, such as "release_date": "2025-08-26" or an array for past changes, e.g., "changelog": [{"version": "1.7.4", "date": "2025-07-20", "changes": "..."}, ...].

@@ -1,12 +1,12 @@
{
"name": "@bsf/force-ui",

Choose a reason for hiding this comment

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

What: The version increment from 1.7.4 to 1.7.5 in package-lock.json needs validation to ensure that there are no breaking changes in dependencies.

Why: Upgrading package versions can introduce breaking changes or vulnerabilities. It's essential to verify that all dependencies are compatible and secure before deployment.

How: Check the release notes for all updated packages and ensure they are compatible with your codebase. Consider running tests to verify that the new versions do not cause issues.

"version": "1.7.5",
"license": "ISC",
"dependencies": {
"@emotion/is-prop-valid": "^1.3.0",

Choose a reason for hiding this comment

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

What: Verify the integrity and security of dependencies listed in the package-lock.json, particularly for third-party libraries.

Why: Using outdated or compromised packages can pose security threats to your application. Each dependency should be reviewed for known vulnerabilities.

How: Utilize tools like npm audit or snyk to analyze dependencies for vulnerabilities. Consider upgrading dependencies to their latest versions to mitigate these risks.

@@ -1,6 +1,6 @@
{
"name": "@bsf/force-ui",

Choose a reason for hiding this comment

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

What: Version update without accompanying details on changes or impact.

Why: It's important to document any significant version changes in the package.json to inform developers about what has changed or improved between versions. This can prevent misunderstandings or confusion about the new version's features or fixes.

How: Consider updating the changelog section in your project documentation or creating one if it doesn't exist. Add context for why the version was bumped and what users can expect in version 1.7.5.

{
id: '2',
icon: <HelpCircle className="size-4" />,
label: 'Help Center',

Choose a reason for hiding this comment

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

What: The href attributes for buttons and links are set to '#' which causes the page to scroll to the top when clicked.

Why: This behavior can be confusing for users since it may give the impression that they have navigated somewhere when they haven't. Also, it can cause unexpected behavior in the application.

How: Consider either removing the href attributes altogether if they are not required or replace them with meaningful URLs or event handlers that provide appropriate navigation.

Check,
Ticket,
HelpCircle,
MessageSquare,

Choose a reason for hiding this comment

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

What: The use of DatePicker with state update on every date selection can lead to performance issues, especially if there are many selections made quickly.

Why: Frequent state updates can cause multiple re-renders and degrade performance in complex components.

How: Consider using a debounced approach to reduce the number of state updates or apply batch updates to minimize the number of renders.

</Text>
<Text
size={ 12 }
weight={ 400 }

Choose a reason for hiding this comment

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

What: The getDateRangeText function should handle case when selectedDate contains invalid dates more gracefully.

Why: If invalid dates are provided, this might result in JavaScript errors or unintended behavior in rendering, resulting in a poor user experience.

How: Add checks in your getDateRangeText function to validate the dates before attempting to format them.

{ /* Content */ }
<div className="p-8 space-y-8">
<Container
containerType="grid"

Choose a reason for hiding this comment

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

What: The LineChart component is rendering a chart without error handling for data fetching or state status.

Why: In case the data fetching fails or returns null, this could cause the chart to fail silently, leading to a poor user experience.

How: Include error handling logic for data fetching, and provide a loading state or a fallback UI to handle cases where data is not available.

<Text
size={ 14 }
weight={ 500 }
color="primary"

Choose a reason for hiding this comment

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

What: The component could be broken down into smaller components to enhance readability and maintainability.

Why: Larger components can become unwieldy and difficult to test or update individually, leading to maintenance challenges down the line.

How: Consider breaking down this component into smaller subcomponents where applicable; for instance, form sections could be a dedicated FormSection component.

BookOpen,
MessageSquare,
MessageSquareCode,
Play,

Choose a reason for hiding this comment

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

What: Incorporate Prop Types or TypeScript for component props validation.

Why: This will help catch type-related errors at compile time and improve code maintainability by clearly defining what types of data each component expects.

How: Add PropTypes or convert the file to TypeScript, defining expected props for UAEDashboard and children components.

@@ -1,12 +1,12 @@
{
"name": "@bsf/force-ui",

Choose a reason for hiding this comment

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

What: Consider ensuring that all updated dependencies are compatible with each other.

Why: Updating the version can sometimes introduce breaking changes in dependencies that may not be compatible with your application. This is critical for maintaining application stability and security.

How: After updating the version number, run npm install to check for any dependency warnings. Use a tool like npm audit to ensure that all dependencies are secure and compatible.

{
id: '7',
icon: MessageSquareCode,
title: 'Post Widget',

Choose a reason for hiding this comment

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

What: Consider sanitizing user inputs, especially for dynamic content in the Tooltip component.

Why: Ensuring data displayed in tooltips is sanitized helps prevent XSS attacks and enhances the overall security of the application.

How: Use a library like dompurify to sanitize any HTML content before rendering it inside Tooltips.

"version": "1.7.5",
"lockfileVersion": 3,
"requires": true,
"packages": {

Choose a reason for hiding this comment

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

What: Make sure to test your application thoroughly after updates to dependencies.

Why: Without proper testing, new bugs or incompatibilities can be introduced, potentially frustrating users and increasing maintenance costs.

How: Run your application's test suite and perform manual testing, especially around areas of code that interact with the updated dependencies, to ensure everything is functioning as expected.

@@ -1,6 +1,6 @@
{
"name": "@bsf/force-ui",

Choose a reason for hiding this comment

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

What: Version update is present, but there are no accompanying notes for important security updates or breaking changes.

Why: Version updates should inform users and maintainers about what to expect in this release, especially if there are any changes that might impact security or functionality.

How: Consider adding a changelog section to document any changes in dependencies or security patches, especially if you update libraries or frameworks that may introduce vulnerabilities.

title: 'Marketing Button',
enabled: false,
isPro: true,
},

Choose a reason for hiding this comment

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

What: Refactor the widget rendering logic to improve readability and maintainability.

Why: The current map function for rendering widgets is large and complex, making it difficult to read and maintain. Simplifying the structure will make it easier for future developers to work with this code.

How: Consider breaking out the widget rendering into a separate functional component that handles both the widget state and rendering.

className="bg-background-primary rounded p-3 shadow-sm"
>
<div className="flex items-center justify-between mb-4">
<widget.icon className="w-5 h-5 text-icon-primary" />

Choose a reason for hiding this comment

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

What: Using map for rendering each item can be performance intensive when dealing with larger datasets; consider using React.memo to optimize rendering performance.

Why: This ensures that only widget items that actually change will re-render, improving overall performance of the dashboard as it scales up with more widgets.

How: Wrap the widget component or its containing div with React.memo, which prevents unnecessary re-renders.

</div>
)
) }
</div>

Choose a reason for hiding this comment

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

What: This file appears to handle form data visually but lacks error handling for user inputs such as form options or date selections.

Why: Not handling input errors may lead to a poor user experience or potential application crashes during runtime if users provide unexpected input.

How: Implement form validation logic to check user inputs before processing data, potentially using libraries like formik or implement manual checks for essential fields.

Switch,
Text,
Tooltip,
Input,

Choose a reason for hiding this comment

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

What: The array 'widgetData' is populated with identical titles, all set to 'Blockquote'. This may lead to potential confusion or errors when rendering UI elements as each element doesn't provide unique identification beyond the ID.

Why: Having unique titles or descriptions for each widget is essential for clarity, especially when they are displayed in the UI. It ensures that users can distinguish between different widgets, and it improves the maintainability of the code.

How: Consider giving each widget a unique title that accurately reflects its function or role within the dashboard.

{ month: 'Apr', views: 173, entries: 85 },
{ month: 'May', views: 209, entries: 110 },
{ month: 'Jun', views: 214, entries: 95 },
{ month: 'Jul', views: 256, entries: 135 },

Choose a reason for hiding this comment

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

What: The use of an inline function for the handleClickOutside effect may lead to memory leaks if not managed correctly, as React will create a new instance of this function on every render.

Why: If this effect triggers too often, it can lead to performance issues and event listener cleanup not working as expected.

How: Refactor the inline function to declare it outside of the effect and use 'useCallback' to memoize it, thus preventing unnecessary re-creations of the function.

},
{
id: '8',
title: 'Blockquote',

Choose a reason for hiding this comment

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

What: The 'href' attributes of anchor tags are currently set to '#', which can lead to unexpected behavior if users attempt to follow those links, as they do not lead anywhere.

Why: Using '#' as a placeholder is not a good practice because it can mislead users into thinking they will navigate somewhere, which could lead to a poor user experience. Furthermore, it can accidentally trigger the default click action of anchor tags, potentially causing page jumps.

How: Replace '#' with actual URLs or use 'javascript:void(0)' if these are intended to be non-functional links. Alternatively, consider using a button with an onClick handler.


{ /* Right Column - Sidebar */ }
<Container.Item
colSpan={ { sm: 12, md: 12, lg: 4 } }

Choose a reason for hiding this comment

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

What: The static SVG logos (e.g., SureFormsLogo) can lead to increased bundle size, especially if there are many such icons in various components.

Why: Including multiple instances of SVGS can impact the performance of loading times, especially on resource-constrained devices or slow networks.

How: Use SVG sprites or optimize SVG files to ensure they are as lightweight as possible. Consider using a service to compress SVG files or implement a component to render SVGs dynamically based on conditions.

title: 'Blockquote',
enabled: true,
isPro: false,
},

Choose a reason for hiding this comment

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

What: State updates in 'handleActivateAll' and 'handleDeactivateAll' can be refactored to reduce redundancy in your mapping logic.

Why: Your current implementation performs a map operation which, although is not performance degrading, can lead to unnecessary complexity and potential errors in future changes. Simplifying logic enhances readability and maintainability.

How: Consider using 'setSwitchState(prevState => prevState.map(widget => ({...widget, enabled: !widget.isPro})))' for activating all widgets, also utilizing the argument of the previous state for a more accurate update.

</div>
</div>
);
};

Choose a reason for hiding this comment

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

What: Security checks for user-generated form submissions, such as for data entered in text areas, tables, or other interactive elements, should be implemented to prevent XSS attacks.

Why: If input fields do not sanitize user data before rendering back to the UI, it may allow an attacker to inject malicious scripts.

How: Use libraries such as DOMPurify or similar methods to sanitize any user-generated content before rendering it back in the application.

id: '18',
title: 'Blockquote',
enabled: false,
isPro: true,

Choose a reason for hiding this comment

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

What: The inline styles used in multiple places, such as 'className="w-6 h-6 rounded-full bg-field-primary-background border border-border-subtle flex items-center justify-center"', should be avoided as it reduces code reusability and increases the risk of styling inconsistencies.

Why: Repeated inline styles can lead to maintenance issues, as changing the style in one place may not automatically apply it consistently across all elements. Also, inline styles can bloat the HTML markup, affecting readability.

How: Extract these styles into CSS classes. Create a dedicated CSS module or a styled-component to apply the styles consistently across components.

@jaieds jaieds changed the base branch from master to staging August 25, 2025 12:23
@vrundakansara vrundakansara merged commit bfaae01 into staging Aug 25, 2025
6 checks passed
@vrundakansara vrundakansara deleted the bump-version branch August 25, 2025 13:27
@jaieds jaieds changed the title v1.7.5 Bump version to v1.7.5 Aug 25, 2025
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