-
Notifications
You must be signed in to change notification settings - Fork 21
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
Remove short ID #2148
Remove short ID #2148
Conversation
Deployed to https://pr-2148.aam-digital.net/ |
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 looks pretty good to me!
Not sure how far the indexing still has problems or what tasks remain open?
Not functionally tested yet.
emit(["${School.ENTITY_TYPE}:" + doc.schoolId, start]); | ||
emit([doc.childId, start]); |
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.
which needs to come first: the migration of data or the update of these index definitions? would these indices still work in old or new form with both migrated and previous data?
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 we update and migrate at the same time, the user will most likely get the data before getting the app update which means it doesn't matter if we support both formats here.
On the other side I don't think we can make the code work with both the new and old data format as this is exactly why we decided for the migration.
// TODO or de we rather want to pass full IDs around here as well? | ||
const entityId = Entity.createPrefixedId(ConfigurableEnum.ENTITY_TYPE, 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.
good question ... would be redundant, as the dataType already makes it clear. But if that makes it much easier to implement ...?
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.
At the moment it wouldn't add a benefit to migrate it. But the question is more if we want to keep it consistent (full ID whenever possible)
// TODO should this be migrated? | ||
const schemaFields = [...entity.schema.entries()] | ||
.filter( | ||
([_, schema]) => | ||
schema.innerDataType === this.enumEntity.getId() || | ||
schema.additional === this.enumEntity.getId(), | ||
schema.innerDataType === this.enumEntity.getId(true) || | ||
schema.additional === this.enumEntity.getId(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.
yes, maybe. Could be a point when we introduce a dataType for enum-multi/-array (#2121)
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.
Do you mean a select field where values from multiple configurable enums can be selected?
src/app/core/basic-datatypes/entity/display-entity/display-entity.component.ts
Outdated
Show resolved
Hide resolved
src/app/core/entity-details/entity-details/entity-details.component.spec.ts
Show resolved
Hide resolved
src/app/core/entity-details/entity-details/entity-details.component.ts
Outdated
Show resolved
Hide resolved
public getId(withPrefix: boolean = false): string { | ||
if (withPrefix) return this._id; | ||
return this.entityId; | ||
public getId(withoutPrefix = false): string { |
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 would prefer to switch the default value instead of the meaning of the param (i.e. getId(withPrefix = true)
) - at least for people who have used the previous system this seems the safer, less confusing way?
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.
But this introduces the problem that the check if (withPrefix)
would be false
if no argument is passed. So I think the saver and generally more common approach would be that passing no argument or passing a false
argument results in the same output.
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 would mean not passing the param is different from passing false - but if the expected standard is to get it with prefix and explicitly passing false disables that, in my opinion that is as explicit as the other way round.
I am not insisting on this though - it mostly confused me during review here but I'll get used to the new way quickly.
src/app/core/export/data-transformation-service/data-transformation.service.spec.ts
Outdated
Show resolved
Hide resolved
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.
Looks good to me now!
I did a general walkthrough of the pr deployed app, looking at references and lists. Didn't notice any issues there functionally.
I guess the last open point is whether we do something special for aligning update + migration. And some test still failing?
# Conflicts: # src/app/child-dev-project/schools/child-school-overview/child-school-overview.component.ts # src/app/core/common-components/entity-form/entity-form.service.spec.ts # src/app/core/common-components/entity-subrecord/entity-subrecord/entity-subrecord.component.spec.ts # src/app/core/common-components/entity-subrecord/entity-subrecord/entity-subrecord.component.ts # src/app/core/filter/filters/filters.ts
Tested deployed version on dev.aam-digital.net with the migration from Aam-Digital/ndb-admin#18 that you already applied:
I'll look into the "update only on reload" issue separately. Except the Notes/Todos bug things seem to work very well. (some unit test failing, however) |
# Conflicts: # src/app/child-dev-project/notes/notes-related-to-entity/notes-related-to-entity.component.ts # src/app/features/todos/todos-related-to-entity/todos-related-to-entity.component.ts
🎉 This PR is included in version 3.31.0-master.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.31.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
closes: #1526
change reference to enum inadditional
property of schemaaddPrefix
query function andtoEntities(...)
' prefix variable - REQUIRES MIGRATION