Skip to content
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

Add dictionaryId to MdJSON export dataDictionary object #707

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

dvonanderson
Copy link
Contributor

@dvonanderson dvonanderson commented Dec 30, 2024

Closing issues

closes #679
closes #705
closes #682

Pull Request

  • Please check if the PR fulfills these requirements

    • The commit message follows our guidelines
    • Tests for the changes have been added (for bug fixes / features)
      - [ ] Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Add dictionaryId to dataDictionary object in MdJSON export

  • What is the current behavior? (You can also link to an open issue here)
    Export mdJSON function does not write dictionaryId #679

  • What is the new behavior (if this is a feature change)?

"dataDictionary": [
 "responsibleParty": {
          "party": [{ "contactId": "f16524f3-6ad7-44fa-842a-ec5bf8cb2c95" }],
          "role": "pointOfContact"
        },
        "subject": ["dataDictionary"],
        "dictionaryId": "7e520389-7b0a-4552-ac3f-f5f1bc81c056"
      }
    ]
  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
  • no

@hmaier-fws
Copy link
Contributor

@dvonanderson this still doesn't work. The dictionaryId is exported to the mdJSON. But, the dictionaryId from an imported mdJSON file is not beinig assigned to the internal mdEditor-Json object.

@hmaier-fws hmaier-fws marked this pull request as draft January 4, 2025 04:14
@dvonanderson
Copy link
Contributor Author

@hmaier-fws pushed up some new commits and revised the PR statement please take a look

@dvonanderson dvonanderson marked this pull request as ready for review January 16, 2025 17:09
@hmaier-fws
Copy link
Contributor

@dvonanderson there are still some problems.

Issue #679 seems to be resolved. But when importing mdJSON, the dataDictionary and contact arrays are still being embedded in the "type": "records" object (issue #682).

Import of mdJSON, still does not associate the dictionary with the metadata record (no dictionary selected under /record/xxx/edit/dictionary"). I assume this might be due to the dictionary records still not being structured properly. When viewing records using the mdEditor dashboard "Preview JSON":

  • contacts are properly structured
  • dictionaries should not enclose elements within a "dataDictionary" object. There should only be one object that contains all dictionary elements.

The dictionary is still structured as:

{
  "dataDictionary": {
    "citation": { },
    "subject": [ ],
    "responsibleParty": { },
    "entity": [ ],
    "domain": [ ],
    "description": " ",
    "dictionaryIncludedWithResource": false,
    "dictionaryId": "8dd05b0d-95c9-40f0-880d-72d18ef29c27"
  },
  "dictionaryId": "7648f752-1e09-4fdc-8cdd-c18d233f89bb"
}

It should be structured as follows:

{
  "citation": { },
  "subject": [ ],
  "responsibleParty": { },
  "entity": [ ],
  "domain": [ ],
  "description": " ",
  "dictionaryIncludedWithResource": false,
  "dictionaryId": "8dd05b0d-95c9-40f0-880d-72d18ef29c27"
}

On export, the mdDictionary array IS NOT using the identifiers from .dataDictionary.dictionaryId but it is generating a new .dictionaryId and using that instead of the identifier within the dataDictionary element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants