-
Notifications
You must be signed in to change notification settings - Fork 6
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
[0.10] Fix table performance & rework attribute(list) logic #504
base: release-0.10
Are you sure you want to change the base?
Conversation
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
…rformance Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
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.
In current state the creation of a table attribute is not working.
disabled: computed(_ => data.value.isDisabled || disabled.value), | ||
value: computed(_ => getValueOrDefault()), | ||
// TODO check for selection need? | ||
selection: computed(_ => getAttributeSelection(data.value.id) || {}), |
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.
This is a problem, I think this should return an array as default => ... | [ ]
Throws error when creating table attribute.
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.
Yeah, selections should be Arrays 👍
reactTo, | ||
hideLinks, | ||
preview, | ||
previewData, |
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.
Those are not used.
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.
These are some remains from stuff I copy&wasted 😅 can be deleted 👍
@@ -620,8 +510,8 @@ | |||
initialValue: value.value, | |||
}); | |||
const state = reactive({ | |||
isPreview: computed(_ => previewColumns.value && Object.keys(previewColumns.value).length > 0), | |||
columns: computed(_ => state.isPreview ? previewColumns.value : getAttribute(attribute.value.id).columns), | |||
isPreview: computed(_ => preview.value && previewData.value && Object.keys(previewData.value).length > 0), |
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.
Why isn't preview.value check enough?
Maybe a different name if it does more than one thing?
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 just did a double check to make sure that we enabled preview (preview.value
) and have actual data to preview (previewData.value
).
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 think there was a mix up from the old structure. preview
and previewData
is part of Attribute.vue
and Tabular.vue
only receives previewColumns
. Thus, checking for previewColumns
existance and content is enough.
class="text-center" | ||
v-if="row.hidden_info" | ||
class="text-muted text-center fs-5 p-2 bg-primary-subtle" | ||
:colspan="Object.keys(state.columns).length + 2" |
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.
use computed at this and the next position? (redundancy)
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.
👍
resources/js/helpers/helpers.js
Outdated
case 'string-sc': | ||
case 'date': | ||
case 'url': | ||
return ''; |
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.
There are 3 positions where we return ' '. Combine the non-default cases that return ''?
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, we can add this at the end right before default
. Thought I already did that 🤔
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
ecc6cc7
to
97b80f7
Compare
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
255d304
to
a177433
Compare
I resolved merge conflicts and added our new si-unit-attribute, that was added to the pre-PR attribute handling logic. Can you also confirm it is still working @Severino ? |
I tried getting it to work, but when I create a new and empty table with an SiUnit Attribute, I cannot add a new line, as it creates an empty object, however the si attribute need a metadata object for the bast_unit and the default_unit |
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
Signed-off-by: Vinzenz Rosenkranz <vinzenz.rosenkranz@uni-tuebingen.de>
This branch started as a simple performance booster for table attributes. But the whole attribute handling was a huge code block with DRY code in the table component as well.
Thus, I reworked the attributelist and table component to be based on a new
Attribute
component (tables also has a newTabularRow
component). This introduced a new problem with entity attributes (especially in tables), so I tried to move all logic that loads the data needed for the frontend to theserialize
andunserialize
in the AttributeType classes.