-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2534 UID Mapping #2567
base: main
Are you sure you want to change the base?
#2534 UID Mapping #2567
Conversation
9967148
to
2b8f9ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking a while. Started on a review, but not finished yet. Anyways, added some comments on things that can be improved, and some questions to help me understand the logic.
Src/WitsmlExplorer.Frontend/components/ContextMenus/ContextMenuUtils.tsx
Outdated
Show resolved
Hide resolved
Src/WitsmlExplorer.Frontend/components/ContextMenus/ContextMenuUtils.tsx
Outdated
Show resolved
Hide resolved
9f9a206
to
96fd79d
Compare
- refactoring - removed unused usings - added missing objects mappings for show on server - added missing validation - changed complex key to serialized JSON (LiteDB doesn't support complex objects as key) - updated tests
}; | ||
|
||
const mappings = await UidMappingService.queryUidMapping(dbQuery); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't getTargetWellboreID also be used here? Not tested, but something like
const sourceWellboreName = toCopy[0].wellboreName;
const { targetWellId, targetWellboreId } = await getTargetWellboreID({
sourceServerId: sourceServer.id,
sourceWellId: sourceWellUid,
sourceWellboreId: sourceWellboreUid,
targetServerId: targetServer.id
});
let wellbore: Wellbore;
try {
wellbore = await WellboreService.getWellbore(
targetWellId,
targetWellboreId,
null,
targetServer
);
} catch {
return; // Cancel the operation if unable to authorize to the target server.
}
const targetWellboreRef: WellboreReference = {
wellUid: targetWellId,
wellboreUid: targetWellboreId,
wellName: wellbore?.wellName ?? sourceWellName,
wellboreName: wellbore?.name ?? sourceWellboreName
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll check that again. However, I guess this would probably need a little bit more refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I map a wellbore to a wellbore on another server, and then delete the target wellbore, the mapping will exist but not the target wellbore. If I then try to use the copyToServer-functionality it asks me to create the target wellbore as expected. However, it fails with this message:
I would expect either of these (maybe this should be discussed?):
- Any mapping that exists for a wellbore that is deleted should also be removed. If this is chosen, we need to take into account what should happen if the wellbore is deleted from the query view or another application (when we don't know that it has been deleted).
- CopyToServer will create the wellbore with the mapped uid, and then copy the object over (without any errors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good point, that hasn't been discussed. I think, the first solution is correct. We should probably discuss this in weekly meeting.
- refactoring - removed unused usings - added missing objects mappings for show on server - added missing validation - changed complex key to serialized JSON (LiteDB doesn't support complex objects as key) - updated tests
…om/vaclavbasniar/witsml-explorer into features/2534_wellbore_uid_mapping
# Conflicts: # Src/WitsmlExplorer.Frontend/components/ContextMenus/FluidContextMenu.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/LogCurveInfoContextMenu.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/LogsContextMenu.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/ObjectMenuItems.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/ObjectsSidebarContextMenu.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/TrajectoryStationContextMenu.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/TubularComponentContextMenu.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/WbGeometrySectionContextMenu.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/WellContextMenu.tsx # Src/WitsmlExplorer.Frontend/components/ContextMenus/WellboreContextMenu.tsx
* bug fixes * automatic removal of UID mapping on well/wellbore delete * automatic cleanup of UID mappings pointing to deleted well/wellbores on copy to * unit tests update
Fixes
This pull request fixes issue #2534
Description
Type of change
Impacted Areas in Application
Checklist:
Communication
Code quality
Test coverage
Further comments