-
#193
3864b98
Thanks @keeganpotgieter! - ### Breaking Changes- Changed
queryKeyFilters
type from array to object structure across all table components - Updated
DataTableProviderProps
interface to useRecord<string, unknown>
instead ofQueryKey
- This affects all components using
GenericTable
andDataTableProvider
- Changed
accountPayrollId
topayrollSystemId
throughout the codebase - This affects:
PayrollIntegrationManagementTable
componentuseOrganisations
hooklistOrganisationsFromPayroll
actiongetOrganisationsFromPayrollURL
path helper
Before:
queryKeyFilters={[{ enabledColumns }]}
After:
queryKeyFilters={{ enabledColumns }}
Before:
const App = () => { const { data: accountPayroll } = useAccountPayrollSystem(payroll); const { data: organisations } = useOrganisations(accountPayroll.id); return ( <PayrollIntegrationManagementTable accountPayrollId={accountPayroll.id} /> ); };
After:
const App = () => { const { data: accountPayroll } = useAccountPayrollSystem(payroll); const { data: organisations } = useOrganisations(accountPayroll.payrollId); return ( <PayrollIntegrationManagementTable payrollSystemId={accountPayroll.payrollId} /> ); };
- Changed
-
#194
653a415
Thanks @keeganpotgieter! - ### Bug Fixes- Fixed dependency array in
SubiConnectProvider
by removing duplicateinitialised
dependency - Updated
DataTableProvider
to useuseSubiConnectQuery
instead of rawuseQuery
- Removed unnecessary
async
wrapper inuseAccountPayrollSystem
query function - Improved code formatting and readability in hooks with consistent spacing
- Refactored query implementation in table context to use
useSubiConnectQuery
- Added proper type handling for query options in
useSubiConnectQuery
- Enhanced query key organisation in company-related hooks
- Fixed dependency array in
-
#192
319fe2a
Thanks @keeganpotgieter! - AddedconnectionService
context to dependency arrays in React hooks to ensure proper cache invalidation when the connection context changes. Updated hooks include:useAccountPayrollSystem
useEmployees
useOrganisations
useAllOrganisations
useOrganisation
usePayrollSystems
-
#190
4bc6776
Thanks @keeganpotgieter! - Improved initialisation and configuration handling:- Changed
initialised
state to useuseRef
instead ofuseState
for better state management - Moved provider options handling into
ConnectionService
constructor - Simplified provider options handling by passing
httpClient
directly instead ofConnectionService
- Fixed dependency array in
SubiConnectProvider
'suseMemo
- Removed redundant initialisation code and improved initialisation flow
- Added
providerOptions
toConnectionService
constructor parameters
- Changed
- #188
49f0fee
Thanks @keeganpotgieter! - OptimiseSubiConnect
provider initialisation and cleanup:- Set
initialised
state immediately when loading starts - Remove redundant
initialised
check and set - Memoise cleanup function with
useCallback
to prevent unnecessary rerenders - Update dependency array in value memo to include cleanup function
- Set
- #186
216735d
Thanks @keeganpotgieter! - Remove unnecessary dependencies fromuseEffect
dependency array inSubiConnectProvider
.
- #184
8cbf42b
Thanks @keeganpotgieter! - - Changed query invalidation to query removal for better cache management- Added sandbox environment support with new
SUBI_CONNECT_SANDBOX_PUBLIC_BASE_URL
configuration - Enhanced environment handling with automatic base URL switching for sandbox mode
- Improved TypeScript documentation for debug options
- Added sandbox environment support with new
-
fd499a2
Thanks @keeganpotgieter! - Enhance OAuth2 authentication flow and improve connection handling:- Added
connectionService
to the OAuth2 authentication process:- Imported
useSubiConnectContext
in the Connect and Integrate component. - Passed
connectionService
tohandleOAuth2OnSuccess
function calls.
- Imported
- Improved
handleOnOpenChange
function:- Simplified setting the
open
state. - Only reset
isPending
state when closing the dialogue.
- Simplified setting the
- Enhanced
waitForWindowClose
function:- Added
connectionService
parameter. - Implemented
checkIntegrationSuccess
to check OAuth status before closing the window. - Improved cleanup process and error handling.
- Added
- Updated
handleOAuth2OnSuccess
function:- Added
connectionService
parameter and passed it towaitForWindowClose
.
- Added
- General code improvements:
- Added
void
keyword to asynchronous function calls in switch statement. - Improved error handling and logging in
checkIntegrationSuccess
.
- Added
These changes enhance the OAuth2 authentication process, improve connection handling, and provide better integration with the Subi Connect service.
- Added
-
#175
cd73808
Thanks @keeganpotgieter! - # Major refactor and enhancement of payroll integration functionality:- Refactored
ConnectAndIntegrate
component:- Improved error handling and user feedback
- Enhanced OAuth2 authentication flow
- Added support for manual payroll integrations
- Added new
ManualConnectAndIntegrate
component for manual payroll systems - Introduced
Portal
component for consistent integration UI across different payroll types - Updated
PayrollIntegrationListGrid
to support both automatic and manual payroll systems - Refactored and improved hooks:
- Added
useConnectPayrollMutation
- Added
useIntegrateCustomPayrollMutation
- Added
useIntegrateManualPayrollMutation
- Added
- Enhanced context providers:
- Added
ManualPayrollSystemProvider
- Updated
PayrollSystemProvider
- Improved
PayrollIntegrationProvider
- Added
- Updated types and interfaces:
- Added
ManualIntegrationAccountPayrollSystemExtended
- Enhanced
AccountPayrollSystemExtended
- Added new types for integration params and mutation props
- Added
- Improved utility functions:
- Enhanced
removeUndefinedValues
- Added
tw
function for tagged template literals with Tailwind classes
- Enhanced
- Updated API service layer:
- Added support for manual payroll integration
- Improved typing and error handling
- Enhanced UI components:
- Updated
BaseCard
for better flexibility - Improved
Button
component with new variants
- Updated
- Updated Tailwind configuration:
- Added new utility classes
- Improved type safety
These changes significantly improve the flexibility, maintainability, and user experience of the payroll integration system, allowing for both automatic and manual integrations with enhanced error handling and UI consistency.
- Added new
ManualConnectAndIntegrate
component for manual payroll systems - Added new
ManualPayrollSystemProvider
context provider for manual payroll systems - Added new
ManualIntegrationAccountPayrollSystemExtended
type for manual payroll systems
const manualIntegrations: [ { onConnect: ({ payrollSystem, onSuccessCallback, onCancelCallback }) => { setTimeout(() => { const result = window.confirm('Are you sure you want to connect?'); if (result) { console.log('Connected', { payrollSystem }); onSuccessCallback(); // Call this to complete the integration workflow } else { console.log('Cancelled', { payrollSystem }); onCancelCallback(); // Call this to cancel the integration workflow } }, 200); }, friendlyName: 'ADP', bannerImgUrl: 'https://au.adp.com/-/media/adp/redesign2018/ui/logo-adp-fy19.svg?rev=0769ecbf84a9412a93e2cd52b7319a13&hash=C2451A542096BF16BC40698417D5A6FD', description: 'Import from ADP to securely share your payroll data with Your Company.', actionButtonText: 'Upload', }, ]; const Component = () => { const onIntegrationSuccess = () => { console.log('Integration successful'); }; return ( <PayrollIntegrationList manualIntegrations={manualIntegrations} onIntegrationSuccess={onIntegrationSuccess} /> ); };
- Refactored
-
#173
e6fc1dd
Thanks @keeganpotgieter! - Expose connect and integrate mutations. -
#176
eca5919
Thanks @keeganpotgieter! - # Changeset: Minor Update for Payroll IntegrationThis changeset introduces improvements to the handling of manual payroll connections and enhances the display of payroll integration options. The main goal is to provide flexibility in how connection types are presented to users, ensuring consistency across the application.
- Enum Update: The payroll connection type for manual systems has been
changed from
MANUAL
toMANUALLY
. This change improves clarity by aligning the naming convention with the action (connecting manually). - New Prop for Visibility Control:
- Added a new optional prop,
showManualConnectionTypes
, to thePayrollIntegrationListGrid
component. This prop allows developers to control the visibility of manual payroll connection types based on the application's context.
- Added a new optional prop,
- Conditional Rendering of Manual Connections:
- In the
PayrollIntegrationListGrid
component, added logic to conditionally render payroll systems based on the newshowManualConnectionTypes
prop. If set tofalse
, manual payroll systems will not be displayed, enhancing user experience by reducing clutter in the UI.
- In the
- Refactoring of Manual Connect Card:
- Updated the
ManualConnectCard
component to use the newPayroll
enum for the name display, ensuring consistent references throughout the application.
- Updated the
File:
src/services/api/payroll/types.ts
export enum PayrollConnectionTypeEnum { - MANUAL = 'MANUAL', + MANUALLY = 'MANUALLY', CUSTOM = 'CUSTOM', OAUTH2 = 'OAUTH2', OAUTH2_AND_COMPANY_MANUALLY = 'OAUTH2_AND_COMPANY_MANUALLY',
- Enum Update: The payroll connection type for manual systems has been
changed from
-
#170
57b9156
Thanks @keeganpotgieter! - This change updates theSubiConnectProvider
anduseSubiConnectQuery
components to improve dependency management and query execution control. The changes address potential issues with stale closures and ensure that queries are only executed when the SubiConnect context is properly initialised.- Query Execution Control: The
useSubiConnectQuery
hook now checks theinitialised
state of the SubiConnect context before executing a query. This ensures that queries are not executed prematurely.
- Query Execution Control: The
-
#171
a322ebb
Thanks @keeganpotgieter! - Added aupdateAccessToken
method inconnection-service.ts
to update the access token in storage, and set the Authorization header with the new token—the error interceptor now uses this method to update the token.
-
#168
d9496b6
Thanks @keeganpotgieter! - This update refactors the logger implementation and improves dependency injection throughout the codebase. It introduces a newLogger
class that can be instantiated and passed to other services, enhancing testability and flexibility.The changes address potential issues with global state and improve the overall architecture by:
- Replacing the global logger instance with a class-based approach
- Implementing dependency injection for the logger in various services
- Enhancing error handling in the connection service
- Improving the structure of interceptors by passing necessary dependencies
-
#165
d77786f
Thanks @keeganpotgieter! - ## Changes- Modified the
EmployeesTable
component to returnundefined
when thecontexts
array is empty, instead of returning an empty array. This ensures that when no columns are added, an empty context array isn't provided, so rows show correctly.
- Modified the
-
#163
40d8daf
Thanks @keeganpotgieter! - # Major Changes- Employee Table Columns Update:
- Updated the employee table columns to support multiple calendars, salaries, and emails.
- Modified components to use new context providers for handling calendar and salary data.
- Components Updated:
next-payment-date.tsx
:- Added
useCalendar
hook to manage selected calendar ID. - Updated rendering logic to handle multiple calendars.
- Added
paycycle.tsx
:- Added
useCalendar
hook to manage selected calendar ID. - Updated rendering logic to handle multiple calendars.
- Added
start-employment-date.tsx
:- Added
useCalendar
hook to manage selected calendar ID. - Updated rendering logic to handle multiple calendars.
- Added
hourly-rate.tsx
:- Added
useSalary
hook to manage selected salary ID. - Updated rendering logic to handle multiple salaries.
- Added
salary.tsx
:- Added
useSalary
hook to manage selected salary ID. - Updated rendering logic to handle multiple salaries.
- Added
core.tsx
:- Updated email column to handle multiple email addresses.
consts.ts
:- Fixed typo in
startEmploymentDateColumn
export.
- Fixed typo in
index.tsx
:- Added
CalendarProvider
andSalaryProvider
to manage context for calendar and salary data. - Updated
EmployeesTable
component to use new context providers.
- Added
- New Context Providers:
calendar-context.tsx
:- Created
CalendarProvider
anduseCalendar
hook to manage calendar-related state.
- Created
salary-context.tsx
:- Created
SalaryProvider
anduseSalary
hook to manage salary-related state.
- Created
- Storybook Updates:
live.stories.tsx
:- Added new stories for
PayCycle
,NextPaymentDate
,StartEmploymentDate
,AllCalendars
, andAllSalaries
.
- Added new stories for
- Type Definitions Updated:
types.ts
:- Updated
Employee
type to support multiple emails, salaries, and calendars. - Fixed typo in
SelectableEmployeeColumns
.
- Updated
- API Types Updated:
types.ts
:- Updated
EmployeeFilterFields
to includeemail
as a required field.
- Updated
- Data Table Component Updated:
data-table.tsx
:- Added support for
rowContexts
to wrap table rows with context providers.
- Added support for
- Employee Info Structure:
salary
field changed tosalaries
(array ofEmployeeSalary
).calendar
field changed tocalendars
(array ofEmployeeCalendar
).email
field changed toemails
(array of strings).
These changes introduce significant improvements to the handling of employee data, allowing for more flexible and robust management of multiple calendars, salaries, and emails.
- Employee Table Columns Update:
-
#160
11ec1a5
Thanks @keeganpotgieter! - ## PurposeThis PR refactors the OAuth2 authentication flow and improves the handling of authentication windows. It introduces a new utility function for generating auth window options and updates the connect and integrate component to use this new approach.
The changes aim to enhance the reliability and consistency of the OAuth2 authentication process, particularly in handling authentication windows across different scenarios. It also improves code reusability by extracting common logic into a separate utility function.
- #155
427f161
Thanks @keeganpotgieter! - - Removed all global instances of axios and connection service for better performance on multi-tenant workflows.- Updated the authentication window process.
- Introduced a new
cleanupAll
function to clear all access tokens and optionally invalidate the SubiConnect query cache. - Removed Singleton Pattern: Removed the singleton instance and static
getInstance
method, allowing for instantiation via the constructor. - Constructor Changes:
- Introduced constructor to initialise
connectionFn
andcontext
. - Initialised
httpClient
using thehttpClient
function from the index module.
- Introduced constructor to initialise
- Updated Storage Key Method: Simplified
getStorageKey()
by removing base URL dependency. - HTTP Client Creation: Replaced direct Axios client creation with a new
httpClient
function that accepts aConnectionService
instance. - Interceptors Setup: Moved the request and response interceptor setup to
the new
httpClient
function. - Auth Window Handling: Improved handling of the auth window, including better error handling and cleanup.
- Connection Service: Simplified the
ConnectionService
class, removing unnecessary methods and properties.
- #151
4a12caf
Thanks @keeganpotgieter! - - Fix cleanup function onSubiConnectProvider
unmount.- Add context to the queries.
- #149
d9fc321
Thanks @keeganpotgieter! - FixsetContext
not encoding the context during access token context update.
-
#147
8587d57
Thanks @keeganpotgieter! - # Breaking Changes- The
SubiConnectProvider
now requires acompanyContext
prop, which is a string that uniquely identifies the organization (e.g., company ID or name). - Removed the
context
option fromSubiConnectOptions
.
- Added type safety for the
companyContext
prop inSubiConnectProvider
.
- Updated the
ACCESS_TOKEN_NAME
constant to use a shorter name: 'sc-cat'. - Enhanced the
ConnectionService
to handle context changes and update stored access tokens accordingly. - Improved type definitions for the connection function and related types.
- Updated demos, stories, and examples to use the new
companyContext
prop. - Refactored
ConnectionService
to use the newcompanyContext
approach. - Updated
getAccessToken
function to use the newSubiConnectConnectionFn
type.
- Added comments to
SubiConnectContext
andSubiConnectProviderProps
for better documentation.
This major version change requires users to update their
SubiConnectProvider
usage by adding thecompanyContext
prop and removing anycontext
option fromSubiConnectOptions
. - The
- #146
2cb8455
Thanks @keeganpotgieter! - Remove Buffer dependency.
-
#141
fc03eb0
Thanks @keeganpotgieter! - Wrap queries and mutations in a Subi Connect wrapper to throw an error when used outside of the Subi Connect context. -
#143
73c4b7c
Thanks @keeganpotgieter! - Add onIntegrationSuccess callback to listen when a payroll system was successfully integrated. -
#142
f0a4e4e
Thanks @keeganpotgieter! - Expose theuseSubiConnectContext
hook.
-
#136
c889971
Thanks @keeganpotgieter! - Migrate build system fromrollup
totsup
We've transitioned our build process from
rollup
totsup
for the following reasons:- Reduced bundle size:
tsup
produces smaller output files, optimizing our package for faster downloads and reduced storage requirements. - Improved build performance:
tsup
significantly speeds up our build times, enhancing developer productivity and CI/CD efficiency. - Simplified configuration:
tsup
offers a more streamlined setup with sensible defaults, reducing the complexity of our build configuration. - Better TypeScript support: As a TypeScript-first bundler,
tsup
provides improved handling of TypeScript projects without additional plugins. - Tree-shaking and code splitting:
tsup
includes built-in optimizations for tree-shaking and code splitting, further reducing bundle sizes and improving performance.
This change should be transparent to end-users but will greatly benefit our development process and package distribution.
- Updated
SubiConnectOptions
to expose acontext
variable to differentiate contexts. See Example 1. - Updated
SubiConnectContext
to expose acleanup
function that can be used cleanup the Subi Connect Context when changing contexts, for example, logging out. See Example 2. - Moves styles import to
@subifinancial/subi-connect/styles.css
. See Example 3.
... const Component = () => { const { data: myCompany } = useMyCompany(); ... const options = { context: myCompany.name } satisfies SubiConnectOptions; return ( <SubiConnectProvider connectionFn={connectionFn} options={options}> ... </SubiConnectProvider> ); } export default Component;
... const Component = () => { const { logout } = auth(); const { cleanup } = useSubiConnectContext(); ... const logoutOnClick = () => { logout(); cleanup(); } return ( <div> ... <button onClick={logoutOnClick}>Logout</button> ... </div> ); } export default Component;
... import "@subifinancial/subi-connect/styles.css" ...
- Reduced bundle size:
-
#133
ffc65f0
Thanks @keeganpotgieter! - Introduced a new getPayrollFriendlyName function to display user-friendly payroll system names throughout the application.- Added a
getPayrollFriendlyName
utility function insrc/lib/utils.ts
- Updated various components to use the new function for displaying payroll system names
- Added a
friendlyName
property to theAccountPayrollSystemExtended
type - Replaced direct references to
payrollSystem.name
withgetPayrollFriendlyName(payrollSystem)
- Added a
- #130
2c0064b
Thanks @keeganpotgieter! - Remove 'subi-connect' class from components inside provider div container.- The 'subi-connect' class is now only applied to the
- provider div container [@src/context/subi-connect.tsx]
- dialogue component [@src/ui/dialogue.tsx]
- The 'subi-connect' class is now only applied to the
- #128
bad7cd0
Thanks @keeganpotgieter! - Increased the maximum width of the dialogue content for larger screens.
-
#125
662a561
Thanks @keeganpotgieter! - ### TL;DR- Added a CustomLink component and updated the components map and CSS styles.
- Improved domain input component styling.
- Created a new
CustomLink
component incustom-link.tsx
- Added
CustomLink
to theotherComponentsMap
incomponents-map.tsx
- Added
- Modified the CSS in
index.css
to apply the font-family directly to the.subi-connect
class instead of all its children - Modified the styling of the domain input component:
- Changed the overflow property from clip to visible for the main container
- Updated the styling for the subdomain display, improving responsiveness and scroll behaviour
- #118
18055da
Thanks @keeganpotgieter! - Update the input components to not auto-complete.- Update ApiKeyInput
- Update DomainInput
- Update the stories to correctly test the inputs in a form context
7df4d4f
Thanks @gustavosubi! - set the input content as the value and apply the mask using the input type
-
#115
7d4dd66
Thanks @keeganpotgieter! - Updated MDX form components UI/UX. Updated internal typing.- Enhanced the API Key Input component with masking functionality
- Improved the Domain Input component with subdomain extraction and visual feedback
- Added accessibility improvements to the Connect and Integrate dialogue
- Updated type definitions for better type safety
- Added Storybook stories for API Key Input and Domain Input components
- Added 'subi-connect' class directly for better scoping
-
#114
cee661f
Thanks @keeganpotgieter! - Add a new company hook (useCompanyPayrollIntegrations) that is used to get all the integrations the company has connected with.
- #112
1882acb
Thanks @gustavosubi! - Remove sandbox baseURL
- #110
f52ce62
Thanks @gustavosubi! - Set payrollSystems as an empty array as default
- #108
ed1c772
Thanks @gustavosubi! - Add the authorization header for GET /company getting the token from local storage
- #106
2435506
Thanks @gustavosubi! - Run CI/CD using the production environment on Release
- #104
4998c8e
Thanks @gustavosubi! - Logs for HTTP requests
- #102
82107e9
Thanks @gustavosubi! - Sandbox option on the Provider component
- #98
6b115c9
Thanks @keeganpotgieter! - Expose all Subi Connect types
- #95
6f93d5f
Thanks @gustavosubi! - New selectable fields in the employees list: Pay Cycle, Next Pay Day and Start Date
- #93
3b991b1
Thanks @keeganpotgieter! - Add adisableBack
flag to thePayrollIntegrationManagementPage
header component. This is used to remove the ability to 'go back' when using the component outside of thePayrollIntegrationsPage
component.
- #91
2996497
Thanks @keeganpotgieter! - Fix image URLs after build v2
- #89
e70a7de
Thanks @keeganpotgieter! - Fix image URLs after build
- #86
a3e0aee
Thanks @keeganpotgieter! - Add correct URL envs to the release build
- #84
c371efc
Thanks @keeganpotgieter! - Fix image url during build time
- #81
e9f30b9
Thanks @keeganpotgieter! - AddedhasConnection
field to the useCompany to determine if the company has integrated with a payroll yet.
- #77
955fc83
Thanks @keeganpotgieter! - Updated the logger and added debugging options to the SubiConnectProvider.
- #73
5d17675
Thanks @keeganpotgieter! - Added a tooltip to the sync status column headers to better understand what each status means
d51f4b9
Thanks @keeganpotgieter! - Added more information to the README
b3706e6
Thanks @keeganpotgieter! - Fix the README links
-
#51
8b2fba7
Thanks @keeganpotgieter! - First major release of Subi Connect- Our documentation provides all the necessary details on how to integrate Subi Connect into your React project
- View the docs at https://subiconnect.subi.au/docs.html