Add support for editing UUIDs in Compass

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: CRUD
    • 5
    • None
    • Developer Tools

      Currently UUIDs (BSON Binary data subtype 3 and 4) are readonly and can't be edited in Compass in the crud list view. This ticket involves updating them to be editable.
      The subtype 3 data has a setting which determines how it's encoded.
      For the editors lets show a text input like UUID(" <TEXT_INPUT> ") so folks know what it'll look like when editing. 

      A user should be able to edit all of the different UUID types:

      1. UUID: UUID subtype 4
      2. LegacyJavaUUID: UUID subtype 3, Java driver encoding
      3. LegacyCSharpUUID: UUID subtype 3, .NET/C# driver encoding
      4. LegacyPythonUUID: UUID subtype 3, Python driver encoding

      We added support for showing the encodings in COMPASS-9690 

      We'll need to make some exceptions for the Binary type so that those subtypes are `editable`:
      https://github.com/mongodb-js/compass/blob/98c0b961d3761476ff1f500a4c638a2c77ed01c4/packages/hadron-document/src/element.ts#L43 

      Here's where we have the editors currently that reference that:
      https://github.com/mongodb-js/compass/blob/main/packages/compass-components/src/components/document-list/element.tsx#L155 

      We will need the type to be able to be selected in the types dropdown:

      The select and its types are here: https://github.com/mongodb-js/compass/blob/98c0b961d3761476ff1f500a4c638a2c77ed01c4/packages/compass-components/src/components/document-list/element-editors.tsx#L380 
      We'll need to add to those types and then have conversions set up for the UUID types for when folks swap to them. That's referenced here: https://github.com/mongodb-js/compass/blob/98c0b961d3761476ff1f500a4c638a2c77ed01c4/packages/hadron-document/src/element.ts#L237 and the changes will need to be in hadron-type-checker.

      That select with the types in the table view is here: https://github.com/mongodb-js/compass/blob/98c0b961d3761476ff1f500a4c638a2c77ed01c4/packages/compass-crud/src/components/table-view/types-dropdown.tsx#L41  

            Assignee:
            Ivan Medina
            Reporter:
            Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: