Skip to content

refactor(frontend): Restructure Pages and Table components#1221

Merged
lusergit merged 16 commits intoedgehog-device-manager:mainfrom
ArnelaL:refactor-frontend
Feb 10, 2026
Merged

refactor(frontend): Restructure Pages and Table components#1221
lusergit merged 16 commits intoedgehog-device-manager:mainfrom
ArnelaL:refactor-frontend

Conversation

@ArnelaL
Copy link
Copy Markdown
Collaborator

@ArnelaL ArnelaL commented Feb 6, 2026

Refactor Frontend

Refactor Pages and Tables to separate data fetching from presentation

Checklist

  • I have read the CONTRIBUTING.md
  • I have added tests that prove my fix is effective or that my feature works
  • I have added or updated documentation (if appropriate)

Further Comments (optional)

Screenshots / Demos (optional)

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 6, 2026

Pull Request Test Coverage Report for Build 21858925309

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-81.7%) to 0.0%

Totals Coverage Status
Change from base Build b49ffb6884ea0420926eb15cd6416a79abc939c5: -81.7%
Covered Lines: 0
Relevant Lines: 0

💛 - Coveralls

@ArnelaL ArnelaL force-pushed the refactor-frontend branch 2 times, most recently from b2e1316 to 941e1f6 Compare February 6, 2026 08:54
@ArnelaL ArnelaL marked this pull request as ready for review February 6, 2026 09:40
@ArnelaL ArnelaL force-pushed the refactor-frontend branch 2 times, most recently from 15b3cce to 1b47882 Compare February 6, 2026 12:22
@@ -163,7 +156,7 @@ const formatJson = (jsonString: unknown) => {

type volumeDetailsProps = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if we are changing the naming volumes should follow the same pattern with the first capital letter

Comment on lines +91 to +126
const debounceRefetch = useMemo(
() =>
_.debounce((text: string) => {
if (text === "") {
refetch(
{
first: RECORDS_TO_LOAD_FIRST,
},
{ fetchPolicy: "network-only" },
);
} else {
refetch(
{
first: RECORDS_TO_LOAD_FIRST,
filter: {
or: [{ name: { ilike: `%${text}%` } }],
},
},
{ fetchPolicy: "network-only" },
);
}
}, 500),
[refetch],
);

useEffect(() => {
if (searchText !== null) {
debounceRefetch(searchText);
}
}, [debounceRefetch, searchText]);

const loadNextApplications = useCallback(() => {
if (hasNext && !isLoadingNext) {
loadNext(RECORDS_TO_LOAD_NEXT);
}
}, [hasNext, isLoadingNext, loadNext]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not a request, but it might be good to explore extracting this into something like hooks/usePaginatedSearch.ts, so that we dont have to duplicate it so much. Since the current implementation is all over the place, some are memonized some and some are not.

Example usage:

const { data, searchText, setSearchText, isLoading, loadMore } = 
  usePaginatedSearch({
    fragment: DEVICES_FRAGMENT,
    fragmentRef: devicesData,
    buildSearchFilter: (text) => ({
      or: [
        { name: { ilike: `%${text}%` } },
        { deviceId: { ilike: `%${text}%` } },
      ],
    }),
  });

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I like the idea, but I think it would be better to do it in a separate PR

- Refactor ApplicationsTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to Applications page
- Centralize delete behavior and modal handling

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor BaseImageCollectionsTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to
  BaseImageCollections page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor ChannelsTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to Channels page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor DeploymentCampaignsTable into a stateless,
  presentational component
- Move Relay pagination, search, and filtering logic to
  DeploymentCampaigns page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor DeploymentsTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to Deployments page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor DevicesTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to Devices page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor DeviceGroupsTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to DeviceGroups page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor HardwareTypesTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to
  HardwareTypes page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor ImageCredentialsTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to
  ImageCredentials page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor NetworksTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to Networks page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor SystemModelsTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to SystemModels page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor UpdateCampaignsTable into a stateless,
  presentational component
- Move Relay pagination, search, and filtering logic to
  UpdateCampaigns page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor VolumesTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to Volumes page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor ContainersTable and ReleaseDevicesTable into a stateless,
  presentational component
- Move Relay pagination, search, and filtering logic to Release page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor BaseImagesTable into a stateless, presentational component
- Move Relay pagination, search, and filtering logic to
  BaseImageCollection page

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
- Refactor ReleasesTable and ApplicationDevicesTable into a stateless,
  presentational component
- Move Relay pagination, search, and filtering logic to Application page
- Centralize delete behavior and modal handling

Signed-off-by: ArnelaL <arnela.lisic@secomind.com>
@lusergit
Copy link
Copy Markdown
Collaborator

/fast-forward

@lusergit lusergit merged commit cabf949 into edgehog-device-manager:main Feb 10, 2026
19 checks passed
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.

5 participants