refactor!: uncouple fields from hard-coded values#1354
Open
refactor!: uncouple fields from hard-coded values#1354
Conversation
Collaborator
Computerdores
left a comment
There was a problem hiding this comment.
welp that was a huge PR ^^
didn't test it locally and probably won't have time to do so either
Comment on lines
+74
to
+76
| "field_type.datetime": "Datetime", | ||
| "field_type.text": "Text", | ||
| "field_type.unknown": "Unknown Type", |
Collaborator
There was a problem hiding this comment.
If you want you can throw this into the german translation:
"field_type.datetime": "Datum - Uhrzeit",
"field_type.text": "Text",
"field_type.unknown": "Unbekannter Typ",
Member
Author
There was a problem hiding this comment.
I'll wait to do that on the Weblate side afterwards 👍
Collaborator
|
I think this conflicts with #1198 btw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
This PR bumps the major version of the library database to 200. Please backup any existing libraries before testing.
Summary
This PR uncouples fields from hard-coded values such as enums and immutable SQLite tables, allowing for the foundation of independently customizable field names and user field templates (intended for a future PR).
Legacy "TEXT_LINE" and "TEXT_BOX" field types are now a single
TextFieldtype, distinguished by anis_multilineboolean attribute. This allows for a future UI change where all text fields can be edited in a single modal that adapts to the attributes present and allows for any text attributes to be changed for the field.I've also reduced the set of default field "templates", in preparation for a future PR that allows for the creation of user created field templates. Unlike the built-in tags, these fields are merely a jumping-off point for users to customize or remove as they see fit.

These changes also open the door for additional field type attributes, for example
is_rich_textoris_hyperlinkforTextFieldsoris_timeforDatetimeFields.NOTE: I was unable to remove the now-unused
type_keycolumns from thetext_fieldsanddatetime_fieldstables for existing libraries due to them containing foreign key relationships. This is not an urgent issue, but is something that should be addressed in the future. See this issue with dropping columns foreign keys in SQLite: https://www.sqlite.org/lang_altertable.html#making_other_kinds_of_table_schema_changesTasks Completed