-
Type:
New Feature
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: TermPortal
-
High
-
None
-
Added ability to define per-level visibility for static properties and attribute datatypes
-
None
-
Emptyshow more show less
Custom (proprietary) attributes: management and per-level visibility
- TermPortal: ‘Attributes management’ screen:
- Client-side
- ‘Default / TBX Basic attributes’ tab - 3 new columns should be added as checkcolumns for grid (“Entry”, “Language”, “Term”):
- Must be a read-write representation of values from entry, language and term boolean columns in terms_collection_attribute_datatype-table
- IMPORTANT: if a certain datatype is not applicable for some level - the checkboxes in the corresponding checkcolumns must be disabled.
- ‘Proprietary attributes’ tab -
- 4 new columns should be added for grid:
- 3 checkcolumns (“Entry”, “Language”, “Term”):
- Must be a read-write representation of values from entry, language and term boolean columns in terms_collection_attribute_datatype-table
- IMPORTANT: if a certain datatype is not applicable for some level - the checkboxes in the corresponding checkcolumns must be disabled.
- 4th - actioncolumn (“Actions”) (see TRANSLATE-3034 for details):
- Edit-actionicon
- Copy-actionicon
- Delete-actionicon
- 3 checkcolumns (“Entry”, “Language”, “Term”):
- Add top toolbar with ‘Create new plaintext’ and ‘Create new picklist’ buttons (see TRANSLATE-3034 for details)
- 4 new columns should be added for grid:
- ‘Default / TBX Basic attributes’ tab - 3 new columns should be added as checkcolumns for grid (“Entry”, “Language”, “Term”):
- Server-side
- Migrations
- Add collectionId column to ‘terms_attributes_datatype’ table
- For each datatype-record that represents a proprietary datatype (i.e having isTbxBasic=0) - set collectionId with ID of the TermCollection where such datatype is really used (i.e. where at least one attribute-record exists with the corresponding dataTypeId)
- For each datatype-record that represents a proprietary datatype and that is really used in multiple TermCollections
- Clone that datatype-record for each of those TermCollections and set the corresponding collectionId for each clone.
- Update the attribute-records with dataTypId=<cloned id> where dataTypId=<original id> and collectionId = <corresponding collectionId>
- For each datatype-record that that represents a proprietary datatype but is NOT really used in any of TermCollections - remove such a datatype-record, as we won’t be able to detect and set collectionId and we don’t need orphan proprietary datatypes
- Add UNIQUE index on type + collectionId in terms_attributes_datatype-table
- Add entry, language and term as boolean columns to terms_collection_attribute_datatype-table - these columns will store the info about whether an attribute of a specific datatype in a specific TermCollection is viewable at the corresponding level in Simple UI TermPortal. Default values are false.
- Clean up terms_collection_attribute_datatype-table so the records representing proprietary datatypes for collection where they do not belong to - are removed
- Add collectionId column to ‘terms_attributes_datatype’ table
- Runtime
- When a TBX file is imported with an attribute of a new proprietary datatype - only one terms_collection_attribute_datatype-record should be created (instead of X records for each of X currently existing TermCollections), so TBX import script should be amended.
- API test (as well as T5 CLI implementation) for checking terms_collection_attribute_datatype consistency - should be amended according to what we don’t anymore multiply terms_collection_attribute_datatype-record for each TermCollection.
- Check all places that rely on type-uniqueness on frontend and backend, decide whether adding ‘-<collectionId>’ suffix to values of type-column of proprietary datatype-records right after they're fetched from datatype-table - is needed, so from the viewpoint of any further php code and js code values of type-column will be still unique, which is crucial to keep things working.
- When proprietary datatype is created
or an existing one’s `type` is edited- the duplication with types of TBX basic ones, and with types of proprietary ones within the same TermCollection - should be prevented (see TRANSLATE-3034 for details).
- Migrations
- Client-side
- SimpleUI
- Client-side
- For attributes of both kinds of datatypes (i.e. proprietary and TBX basic ones), Simple UI app must respect per-level visibility status given for each datatype in json.filterWindow.attributes[..].simpleUI object containing visible: bool and {*}visibleAt: {collectionId1:
{entry: bool, language: bool, term: bool}
, collectionId2: {...}, ...}. The general *visible: bool property is added for convenience, and is indicating whether a specific datatype is configured as visible at at least one level for at least one TermCollection accessible to current user. If visible is false, it immediately means that the corresponding choice in Attributes-dropdown should not be shown at all in SimpleUI's Filter window. Else, if some TermCollections are selected in the TermCollections-dropdown in that window - then the visibility of the corresponding choice in Attributes-dropdown should be dynamically determined based on merged visibility status across these TermCollections choices.
- For attributes of both kinds of datatypes (i.e. proprietary and TBX basic ones), Simple UI app must respect per-level visibility status given for each datatype in json.filterWindow.attributes[..].simpleUI object containing visible: bool and {*}visibleAt: {collectionId1:
{entry: bool, language: bool, term: bool}
- Client-side
-
- Server-side
- Append simpleUI property for each of json.filterWindow.attributes[..] with the values structured as described above for proprietary and tbx basic ones.
- Make sure attributes are excluded from search results json response, if their datatypes are configured as not visible for the levels they're at and for the TermCollections they're in.
- Server-side
Properties management and multi-level visibility
- TermPortal: ‘Attributes management’ screen:
- Client-side
- New ‘Properties’ tab should be added after ‘Proprietary attributes’ in Attributes management screen in current TermPortal, similar to ‘Proprietary attributes’ with columns:
Name Levels Entry Language Term TermEntryTbxId Entry (checkbox) (disabled) (disabled) TermTbxId Term (disabled) (disabled) (checkbox) Created (by, since, until, at) Entry,Language,Term (checkbox) (checkbox) (checkbox) Updated (by, since,until, at) Entry,Language,Term (checkbox) (checkbox) (checkbox)
- Client-side
-
-
- Checkboxes for inapplicable levels should be disabled
- Server-side
- Migrations
- New terms_properties_visibility-table should be created with columns:
- `id` INT
- `collectionId` INT
- `property` ENUM (‘termEntryTbxId’, ‘termTbxId’, ‘tbxCreated’, ‘tbxUpdated’)
- `levels` SET (‘entry’,’language’,’term’)
- `entry` BOOLEAN
- `language` BOOLEAN
- `term` BOOLEAN
- Table should be filled with records: 4 records per each TermCollection
- New terms_properties_visibility-table should be created with columns:
- Runtime
- When a new TermCollection is created - 4 records in terms_properties_visibility-table should be INSERTED
- Non-disabled checkboxes should be (un)checkable and their (un)checked state must be saved into corresponding columns in terms_properties_visibility-table
- Migrations
-
- SimpleUI
- Client-side
- For properties, Simple UI app must respect per-level visibility status given for each property in json.filterWindow.properties[..].simpleUI object containing visible: bool and {*}visibleAt: {collectionId1:
{entry: bool, language: bool, term: bool}
, collectionId2: {...}, ...}. The general *visible: bool property is added for convenience, and is indicating whether a specific property is configured as visible at at least one level for at least one TermCollection accessible to current user. If visible is false, it immediately means that the corresponding filter-field should not be shown at all in SimpleUI's Filter window. Else, if some TermCollections are selected in the TermCollections-dropdown in that window - then the visibility of the corresponding filter-field should be dynamically determined based on merged visibility status across these TermCollections choices.
- For properties, Simple UI app must respect per-level visibility status given for each property in json.filterWindow.properties[..].simpleUI object containing visible: bool and {*}visibleAt: {collectionId1:
{entry: bool, language: bool, term: bool}
- Client-side
-
- Server-side
- Append simpleUI property for each of json.filterWindow.properties[..] with the values structured as described above.
- Make sure properties are excluded from search results json response, if they're configured as not visible for the levels they're at and for the TermCollections they're in.
- Server-side
Testing
Attention TRANSLATE-3034 Manage custom attributes in TermPortal GUI
is contained in that issue! Test separatly.
- has to be done before
-
TRANSLATE-5213 TermPortal: Very simple UI for "search only"
- Done
- is parent of
-
TRANSLATE-5159 Link custom attributes to specific TermCollection
- Done
- relates to
-
TRANSLATE-3034 Manage custom attributes in TermPortal GUI
- Done