refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
This commit is contained in:
@@ -13,19 +13,19 @@
|
||||
### Task 1: Create TreeView.razor — Core Rendering (R1, R2, R3, R4, R14)
|
||||
|
||||
**Files:**
|
||||
- Create: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Create: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor`
|
||||
|
||||
**Step 1: Write the failing tests**
|
||||
|
||||
Create test file with core rendering tests.
|
||||
|
||||
Create: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs`
|
||||
Create: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs`
|
||||
|
||||
```csharp
|
||||
using Bunit;
|
||||
using ScadaLink.CentralUI.Components.Shared;
|
||||
using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared;
|
||||
|
||||
namespace ScadaLink.CentralUI.Tests;
|
||||
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests;
|
||||
|
||||
public class TreeViewTests : BunitContext
|
||||
{
|
||||
@@ -203,12 +203,12 @@ public class TreeViewTests : BunitContext
|
||||
|
||||
**Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Expected: Compilation error — `TreeView` component doesn't exist yet.
|
||||
|
||||
**Step 3: Implement TreeView.razor**
|
||||
|
||||
Create: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor`
|
||||
Create: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor`
|
||||
|
||||
The component should:
|
||||
- Accept `@typeparam TItem` with all parameters from the API summary in the requirements doc.
|
||||
@@ -224,13 +224,13 @@ The component should:
|
||||
|
||||
**Step 4: Run tests to verify they pass**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Expected: All tests PASS.
|
||||
|
||||
**Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ScadaLink.CentralUI/Components/Shared/TreeView.razor tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs
|
||||
git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs
|
||||
git commit -m "feat(ui): add TreeView<TItem> component with core rendering, expand/collapse, ARIA (R1-R4, R14)"
|
||||
```
|
||||
|
||||
@@ -239,8 +239,8 @@ git commit -m "feat(ui): add TreeView<TItem> component with core rendering, expa
|
||||
### Task 2: Add Selection Support (R5)
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Modify: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs`
|
||||
- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Modify: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs`
|
||||
|
||||
**Step 1: Write the failing tests**
|
||||
|
||||
@@ -332,7 +332,7 @@ public void Selection_AriaSelected_SetOnSelectedNode()
|
||||
|
||||
**Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.Selection" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.Selection" -v minimal`
|
||||
Expected: FAIL
|
||||
|
||||
**Step 3: Implement selection in TreeView.razor**
|
||||
@@ -345,13 +345,13 @@ Add to the component:
|
||||
|
||||
**Step 4: Run tests to verify they pass**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Expected: All PASS.
|
||||
|
||||
**Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ScadaLink.CentralUI/Components/Shared/TreeView.razor tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs
|
||||
git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs
|
||||
git commit -m "feat(ui): add selection support to TreeView (R5)"
|
||||
```
|
||||
|
||||
@@ -360,9 +360,9 @@ git commit -m "feat(ui): add selection support to TreeView (R5)"
|
||||
### Task 3: Add Session Storage Persistence (R11)
|
||||
|
||||
**Files:**
|
||||
- Create: `src/ScadaLink.CentralUI/wwwroot/js/treeview-storage.js`
|
||||
- Modify: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Modify: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs`
|
||||
- Create: `src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/treeview-storage.js`
|
||||
- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Modify: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs`
|
||||
|
||||
**Step 1: Write the failing tests**
|
||||
|
||||
@@ -426,12 +426,12 @@ public void SessionStorage_TakesPrecedenceOverInitiallyExpanded()
|
||||
|
||||
**Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.SessionStorage" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.SessionStorage" -v minimal`
|
||||
Expected: FAIL
|
||||
|
||||
**Step 3: Create JS interop file**
|
||||
|
||||
Create: `src/ScadaLink.CentralUI/wwwroot/js/treeview-storage.js`
|
||||
Create: `src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/treeview-storage.js`
|
||||
|
||||
```javascript
|
||||
window.treeviewStorage = {
|
||||
@@ -458,13 +458,13 @@ Add a `<script>` reference in the app's `_Host.cshtml` or `App.razor` layout (wh
|
||||
|
||||
**Step 5: Run tests to verify they pass**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Expected: All PASS.
|
||||
|
||||
**Step 6: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ScadaLink.CentralUI/wwwroot/js/treeview-storage.js src/ScadaLink.CentralUI/Components/Shared/TreeView.razor tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs
|
||||
git add src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/treeview-storage.js src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs
|
||||
git commit -m "feat(ui): add sessionStorage persistence for TreeView expansion state (R11)"
|
||||
```
|
||||
|
||||
@@ -473,8 +473,8 @@ git commit -m "feat(ui): add sessionStorage persistence for TreeView expansion s
|
||||
### Task 4: Add ExpandAll, CollapseAll, RevealNode (R12, R13)
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Modify: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs`
|
||||
- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Modify: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs`
|
||||
|
||||
**Step 1: Write the failing tests**
|
||||
|
||||
@@ -544,7 +544,7 @@ public void RevealNode_UnknownKey_NoOp()
|
||||
|
||||
**Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.ExpandAll|CollapseAll|RevealNode" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.ExpandAll|CollapseAll|RevealNode" -v minimal`
|
||||
Expected: FAIL (methods don't exist)
|
||||
|
||||
**Step 3: Implement the public methods**
|
||||
@@ -558,13 +558,13 @@ In `TreeView.razor`:
|
||||
|
||||
**Step 4: Run tests to verify they pass**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Expected: All PASS.
|
||||
|
||||
**Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ScadaLink.CentralUI/Components/Shared/TreeView.razor tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs
|
||||
git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs
|
||||
git commit -m "feat(ui): add ExpandAll, CollapseAll, RevealNode to TreeView (R12, R13)"
|
||||
```
|
||||
|
||||
@@ -573,8 +573,8 @@ git commit -m "feat(ui): add ExpandAll, CollapseAll, RevealNode to TreeView (R12
|
||||
### Task 5: Add Context Menu (R15)
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Modify: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs`
|
||||
- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor`
|
||||
- Modify: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs`
|
||||
|
||||
**Step 1: Write the failing tests**
|
||||
|
||||
@@ -641,7 +641,7 @@ public void ContextMenu_RightClickDifferentNode_ReplacesMenu()
|
||||
|
||||
**Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.ContextMenu" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.ContextMenu" -v minimal`
|
||||
Expected: FAIL
|
||||
|
||||
**Step 3: Implement context menu**
|
||||
@@ -659,13 +659,13 @@ In `TreeView.razor`:
|
||||
|
||||
**Step 4: Run tests to verify they pass**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Expected: All PASS.
|
||||
|
||||
**Step 5: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ScadaLink.CentralUI/Components/Shared/TreeView.razor tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs
|
||||
git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs
|
||||
git commit -m "feat(ui): add right-click context menu to TreeView (R15)"
|
||||
```
|
||||
|
||||
@@ -674,7 +674,7 @@ git commit -m "feat(ui): add right-click context menu to TreeView (R15)"
|
||||
### Task 6: Add External Filtering Tests (R8)
|
||||
|
||||
**Files:**
|
||||
- Modify: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs`
|
||||
- Modify: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs`
|
||||
|
||||
This task adds tests for filtering behavior that should already work from the core implementation (the component just renders whatever `Items` it receives). These tests verify that expansion state is preserved across re-renders with different items.
|
||||
|
||||
@@ -739,13 +739,13 @@ public void Filtering_SelectionCleared_WhenNodeDisappears()
|
||||
|
||||
**Step 2: Run tests**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.Filtering" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.Filtering" -v minimal`
|
||||
Expected: PASS (behavior comes from core implementation). If any fail, fix in TreeView.razor.
|
||||
|
||||
**Step 3: Commit**
|
||||
|
||||
```bash
|
||||
git add tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs
|
||||
git add tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs
|
||||
git commit -m "test(ui): add external filtering tests for TreeView (R8)"
|
||||
```
|
||||
|
||||
@@ -754,13 +754,13 @@ git commit -m "test(ui): add external filtering tests for TreeView (R8)"
|
||||
### Task 7: Integrate TreeView into Data Connections Page
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ScadaLink.CentralUI/Components/Pages/Admin/DataConnections.razor`
|
||||
- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/DataConnections.razor`
|
||||
|
||||
This is the simplest integration (two-level tree, no recursion).
|
||||
|
||||
**Step 1: Read the current file**
|
||||
|
||||
Read: `src/ScadaLink.CentralUI/Components/Pages/Admin/DataConnections.razor`
|
||||
Read: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/DataConnections.razor`
|
||||
|
||||
**Step 2: Implement the changes**
|
||||
|
||||
@@ -841,13 +841,13 @@ The page currently has a flat table. Replace it with a TreeView:
|
||||
|
||||
**Step 3: Build and verify**
|
||||
|
||||
Run: `dotnet build src/ScadaLink.CentralUI/ScadaLink.CentralUI.csproj`
|
||||
Run: `dotnet build src/ZB.MOM.WW.ScadaBridge.CentralUI/ZB.MOM.WW.ScadaBridge.CentralUI.csproj`
|
||||
Expected: Build succeeds.
|
||||
|
||||
**Step 4: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ScadaLink.CentralUI/Components/Pages/Admin/DataConnections.razor
|
||||
git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/DataConnections.razor
|
||||
git commit -m "refactor(ui): replace data connections table with TreeView grouped by site"
|
||||
```
|
||||
|
||||
@@ -856,11 +856,11 @@ git commit -m "refactor(ui): replace data connections table with TreeView groupe
|
||||
### Task 8: Integrate TreeView into Areas Page
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ScadaLink.CentralUI/Components/Pages/Admin/Areas.razor`
|
||||
- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/Areas.razor`
|
||||
|
||||
**Step 1: Read the current file**
|
||||
|
||||
Read: `src/ScadaLink.CentralUI/Components/Pages/Admin/Areas.razor`
|
||||
Read: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/Areas.razor`
|
||||
|
||||
**Step 2: Implement the changes**
|
||||
|
||||
@@ -901,13 +901,13 @@ The Areas page has a two-panel layout. Keep the left site list panel. Replace th
|
||||
|
||||
**Step 3: Build and verify**
|
||||
|
||||
Run: `dotnet build src/ScadaLink.CentralUI/ScadaLink.CentralUI.csproj`
|
||||
Run: `dotnet build src/ZB.MOM.WW.ScadaBridge.CentralUI/ZB.MOM.WW.ScadaBridge.CentralUI.csproj`
|
||||
Expected: Build succeeds.
|
||||
|
||||
**Step 4: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ScadaLink.CentralUI/Components/Pages/Admin/Areas.razor
|
||||
git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/Areas.razor
|
||||
git commit -m "refactor(ui): replace manual area tree rendering with TreeView component"
|
||||
```
|
||||
|
||||
@@ -916,13 +916,13 @@ git commit -m "refactor(ui): replace manual area tree rendering with TreeView co
|
||||
### Task 9: Integrate TreeView into Instances Page
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/ScadaLink.CentralUI/Components/Pages/Deployment/Instances.razor`
|
||||
- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/Instances.razor`
|
||||
|
||||
This is the most complex integration — deep hierarchy with filtering and context menu.
|
||||
|
||||
**Step 1: Read the current file**
|
||||
|
||||
Read: `src/ScadaLink.CentralUI/Components/Pages/Deployment/Instances.razor`
|
||||
Read: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/Instances.razor`
|
||||
|
||||
**Step 2: Add tree model and builder**
|
||||
|
||||
@@ -1087,13 +1087,13 @@ Remove from `@code`:
|
||||
|
||||
**Step 6: Build and verify**
|
||||
|
||||
Run: `dotnet build src/ScadaLink.CentralUI/ScadaLink.CentralUI.csproj`
|
||||
Run: `dotnet build src/ZB.MOM.WW.ScadaBridge.CentralUI/ZB.MOM.WW.ScadaBridge.CentralUI.csproj`
|
||||
Expected: Build succeeds.
|
||||
|
||||
**Step 7: Commit**
|
||||
|
||||
```bash
|
||||
git add src/ScadaLink.CentralUI/Components/Pages/Deployment/Instances.razor
|
||||
git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/Instances.razor
|
||||
git commit -m "refactor(ui): replace instances table with hierarchical TreeView (Site → Area → Instance)"
|
||||
```
|
||||
|
||||
@@ -1106,17 +1106,17 @@ git commit -m "refactor(ui): replace instances table with hierarchical TreeView
|
||||
|
||||
**Step 1: Build entire solution**
|
||||
|
||||
Run: `dotnet build ScadaLink.slnx`
|
||||
Run: `dotnet build ZB.MOM.WW.ScadaBridge.slnx`
|
||||
Expected: Build succeeds with 0 errors.
|
||||
|
||||
**Step 2: Run all tests**
|
||||
|
||||
Run: `dotnet test ScadaLink.slnx -v minimal`
|
||||
Run: `dotnet test ZB.MOM.WW.ScadaBridge.slnx -v minimal`
|
||||
Expected: All tests pass (including the new TreeView tests and existing tests).
|
||||
|
||||
**Step 3: Run TreeView tests specifically**
|
||||
|
||||
Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal`
|
||||
Expected: All TreeView tests pass.
|
||||
|
||||
**Step 4: Commit (if any fixes needed)**
|
||||
|
||||
Reference in New Issue
Block a user