Skip to content

feat: enhance configuration item import functionality and folder hierarchy management - #5165

Merged
IvanIlyichev merged 1 commit into
shesha-io:mainfrom
micanipho:feat/config-import-folder-hierarchy
Jul 30, 2026
Merged

feat: enhance configuration item import functionality and folder hierarchy management#5165
IvanIlyichev merged 1 commit into
shesha-io:mainfrom
micanipho:feat/config-import-folder-hierarchy

Conversation

@micanipho

@micanipho micanipho commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces support for storing and importing the folder hierarchy of configuration items, ensuring that items retain their folder structure when exported and imported between environments. It also improves the import UI by allowing the caller to refresh the configuration tree after a successful import. The main changes are grouped below.

Backend: Folder Hierarchy Support for Configuration Items

  • Added a FolderPath property to DistributedConfigurableItemBase to represent the item's folder hierarchy in export/import operations. This property is set during export and used during import to place items in the correct folders. [1] [2]
  • Implemented EnsureFolderAsync in ConfigurationItemImportBase to resolve or create the target folder structure during import, ensuring folders are matched by name and parent within the module.
  • Modified the import logic to apply the folder from the package as the source of truth, updating the item's folder even if the content is unchanged, and persisting folder-only moves.
  • Added property injection for the folder repository (FolderRepo) in ConfigurationItemImportBase to support folder creation without changing constructors.
  • Fixed a missing await in DeleteFolderRecursiveAsync to ensure items are deleted before processing subfolders.

Frontend: Import UI Improvements

  • Updated ConfigurationItemsImportFooter and related modal logic to accept an optional onImported callback, allowing the caller to refresh the configuration tree after a successful import. The fallback remains to simply close the modal if no callback is provided. [1] [2] [3] [4]

These changes ensure that configuration item folders are preserved across export/import and improve the user experience for configuration item import operations.

Related to issue: #5005

Summary by CodeRabbit

  • New Features

    • Configuration packages now preserve and recreate folder hierarchies during import and export.
    • Imported items can be moved into their specified folders, including newly created folder paths.
    • Configuration Studio automatically refreshes its tree after a successful package import.
  • Bug Fixes

    • Folder deletion now completes all item deletions before removing subfolders and the parent folder.
    • Existing items can have folder-only changes saved even when other import updates are skipped.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a959f06d-ee04-4f1b-997b-06eef3f5ed99

📥 Commits

Reviewing files that changed from the base of the PR and between 0c1e46e and 1dc15b2.

📒 Files selected for processing (6)
  • shesha-core/src/Shesha.Application/ConfigurationStudio/ConfigurationStudioAppService.ConfigurationTree.cs
  • shesha-core/src/Shesha.Framework/ConfigurationItems/Distribution/ConfigurationPackageManager.cs
  • shesha-core/src/Shesha.Framework/ConfigurationItems/Distribution/DistributedConfigurableItemBase.cs
  • shesha-core/src/Shesha.Framework/Services/ConfigurationItems/ConfigurationItemImportBase.cs
  • shesha-reactjs/src/configuration-studio/cs/configurationStudio.tsx
  • shesha-reactjs/src/providers/sheshaApplication/configurable-actions/configuration-items-import.tsx

Walkthrough

Configuration exports now preserve folder hierarchies, imports create or resolve those folders, and the UI refreshes after successful imports. Recursive folder deletion also awaits item removal before deleting folders.

Changes

Configuration folder hierarchy

Layer / File(s) Summary
Folder path contract and export
shesha-core/src/Shesha.Framework/ConfigurationItems/Distribution/*
Distributed items expose an optional FolderPath, and exports populate it from the folder parent chain.
Folder hierarchy reconciliation
shesha-core/src/Shesha.Framework/Services/ConfigurationItems/ConfigurationItemImportBase.cs
Imports resolve or create folder nodes, assign imported items to them, and persist folder-only moves.

Import UI completion flow

Layer / File(s) Summary
Import completion callback wiring
shesha-reactjs/src/configuration-studio/cs/configurationStudio.tsx, shesha-reactjs/src/providers/.../configuration-items-import.tsx
Successful imports invoke the supplied callback so the configuration tree can reload.

Recursive folder deletion

Layer / File(s) Summary
Ordered recursive deletion
shesha-core/src/Shesha.Application/ConfigurationStudio/ConfigurationStudioAppService.ConfigurationTree.cs
Item deletion is awaited before recursive folder deletion continues.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: james-baloyi

Poem

I’m a rabbit with folders in rows,
Packing each path where the configuration goes.
Imports hop home, and the tree blooms anew,
While deletes wait till their work is through.
onImported twitches its nose—
Fresh branches appear where the old workflow grows!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: improved configuration item import flow and folder hierarchy support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@IvanIlyichev
IvanIlyichev merged commit 2f06829 into shesha-io:main Jul 30, 2026
2 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.

2 participants