-
Notifications
You must be signed in to change notification settings - Fork 22
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
Folder And Dataset Metadata #7886
base: master
Are you sure you want to change the base?
Conversation
* make login, registration and forgot password view more responsive to mobile devices - includes adding a link back to login for password reset view * make dashboard dataset view less awful * add changelog entry
* allow viewing a mapping * WIP: enable setting default active mappings in default view configuration * add default active mapping to default view configuration - add config settings to dataset settings default view config tab - auto load initial default mapping * fix bottom margin of layer settings - was broken in view mode with multiple segmentation layers; the "Save View Config..." Button had no spacing to towards * fix having the mapping settings enabled for layers with default mapping * WIP: move default mapping store proeprty to dataset layer config - undo moving mapping selection to a shared component * moved default active mapping from separate select to view config layer config - Also added validation check whether the mapping exists in the dataset view config settings * allow saving no default active mapping from view mode & model init to new dataset config version * rename defaultMapping to mapping * cache available mappings fetched from backend when checking config in dataset settings * remove logging statements * clean up * add changelog entry * apply pr feedback
* fix animation modal color layer validation * changelog * rename variable * apply pr feedback * improve error message of uint24 layers in animation modal --------- Co-authored-by: Michael Büßemeyer <[email protected]>
* validate BB size to be larger then 0 * changelog * appy PR feedback
73ae88a
to
1797a4e
Compare
…ontend dataset filtering - reason: ll.530 checks for sortedInfo.columnKey == null and columnKey is per default "" which makes this check fail and thus the chained map will never be executed
…der-dataset-properties
…der-dataset-properties
… WIP restyling of metadata / details table
…sion of the table
…der/dataset or update failed - Try forcing dropdown menu to stay open during update -> does not work atm :/
…autosave when changing focused dataset / folder
…der-dataset-properties
…id frequent remounting
…der-dataset-properties
…update to the backend breaking the whole metadata feature.
…der-dataset-properties
@philippotto I prepared the code ready for your feedback and testing :D. Moreover, I just removed an unnecessary dependency of a |
@markbader Metadata should now be updateable via the normal dataset update route |
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.
haven't looked at the code yet, but testing results are in :)
- the table head ("Property") and the validation warning are not aligned with the rest of the table entries. strictly speaking, the input box is also a bit too wide, but since the text within that box is aligned, it feels good.
- the trash icon is incorrectly positioned when a validation warning is there
- auto-save also happens when a field is focussed. after auto-saving that focus is not there anymore. it's probably easiest to not auto-save as long as a field is focussed.
@@ -320,23 +316,6 @@ class DatasetRenderer { | |||
</> | |||
); | |||
} | |||
renderTags() { |
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.
so, the old dataset tags don't exist anymore? are these migrated to the new metadata? ah, I just saw the open questions..
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.
I reviewed the code now. Cool stuff :) I left a couple of nitpicks. on a higher level I have two things (I commented both with more detail).
- I don't really get the index property of the metadata items. wouldn't it work without it?
- I'd enforce a remount when the user clicks on another folder/dataset, unless there is a strong reason against it.
it's probably best to discuss this in person before writing long walls of text :) 🤙
frontend/stylesheets/_dashboard.less
Outdated
position: relative; // Ensure the pseudo-element is positioned relative to the tr. | ||
&:not(:last-child)::after { | ||
// Using pseudo-element to create a border line that does not extend the whole width of the tr. | ||
content: ""; | ||
position: absolute; | ||
left: 8px; // Margin on the left side | ||
right: 8px; // Margin on the right side | ||
top: 0; | ||
height: var(--ant-line-width); // Height of the border line | ||
background-color: var(--ant-color-border); // Color of the border line |
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.
please remove the copilot comments. instead add a comment to the tr block and explain what is happening here on a higher level (instead of how). I think, a divider line is drawn?
callback: () => void | (() => void), | ||
dependencies: React.DependencyList, | ||
) { | ||
const isInitialRunRef = useRef(true); |
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.
const isInitialRunRef = useRef(true); | |
// Same as useEffect but doesn't trigger the callback on the initial mounting. Also, there's no update when the | |
// callback changes. | |
const isInitialRunRef = useRef(true); |
@@ -387,7 +366,7 @@ class FolderRenderer { | |||
class DatasetTable extends React.PureComponent<Props, State> { | |||
state: State = { | |||
sortedInfo: { | |||
columnKey: useLruRank ? "" : "created", | |||
columnKey: useLruRank ? undefined : "created", |
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.
hmm, good catch. it's definitely a bit fishy.
the logic should be as follows:
- if the table is sorted by a certain column (columnKey is properly defined), let antd sort the table accordingly (I think, this happens automatically)
- if not:
- if no search is active: sort by lastUsedByUser
- if a search is active: sort by dice coefficient
can you doublecheck that it works now correctly?
although this should be done by the backend nowadays, or am I wrong?
no, I think, the frontend should do the sorting.
const detailsWithoutEditedEntry = prev.filter((prop) => prop.index !== index); | ||
setHasUnsavedChanges(true); | ||
return [ | ||
...detailsWithoutEditedEntry, | ||
{ | ||
...entry, | ||
key: newPropName, | ||
error, | ||
}, | ||
]; |
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.
is there a reason for moving the item to the back? intuitively, I would have mapped the items and only update the one with the requested index (even though I'm still not sure I get the relevance of the index; isn't it redundant?).
const updatedEntry = { ...entry, value: newValue }; | ||
const detailsWithoutEditedEntry = prev.filter((prop) => prop.index !== index); | ||
setHasUnsavedChanges(true); | ||
return [...detailsWithoutEditedEntry, updatedEntry]; |
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.
same here
size: "small" as InputNumberProps<number>["size"], | ||
disabled: isSaving, | ||
}; | ||
switch (record.type) { |
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.
the switch block could be a good candidate for an own functional component.
<div className="flex-center-child empty-metadata-placeholder"> | ||
<img | ||
src="/assets/images/metadata-teaser.svg" | ||
alt="Metadata preview" | ||
style={{ width: "60%", marginBottom: 16 }} | ||
/> | ||
<span style={{ marginTop: 10 }}> | ||
<Dropdown | ||
menu={getTypeSelectDropdownMenu()} | ||
placement="bottom" | ||
trigger={["click"]} | ||
autoFocus | ||
> | ||
<Button icon={<PlusOutlined style={{ marginLeft: -2 }} />}> | ||
Add First Metadata Entry | ||
</Button> | ||
</Dropdown> | ||
</span> | ||
</div> |
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.
own component? :)
URL of deployed dev instance (used for testing):
Steps to test:
TODOs:
Open Question
Issues:
(Please delete unneeded items, merge only when none are left open)