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

feat(core): decorator multi property #713

Merged
merged 10 commits into from
Oct 2, 2023
Merged

Conversation

dselman
Copy link
Contributor

@dselman dselman commented Sep 8, 2023

Closes #709

Updates the decorator command set model to allow a decorator command target to reference multiple properties.

Changes

  • Update model
  • Update validation
  • Update apply decorator
  • Update dependencies
  • Update tests

Flags

Screenshots or Video

Here is an example command that targets an array of properties.

namespace [email protected]

scalar SSN extends String

@Editable
concept Person {
    @Custom
    o String firstName
    o String lastName
    o String bio
    o SSN ssn
    o String address1
    o String address2
    o Integer zip
}
{
            "$class" : "[email protected]",
            "type" : "UPSERT",
            "target" : {
                "$class" : "[email protected]",
                "namespace" : "test",
                "declaration" : "Person",
                "type" : "[email protected]",
                "properties" : ["address1", "address2", "zip"]
            },
            "decorator" : {
                "$class" : "[email protected]",
                "name" : "Address",
                "arguments" : []
            }
        }

Note that the decorator does not get applied to the zip property because it is not a string property.

Related Issues

  • Issue #
  • Pull Request #

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

@dselman dselman marked this pull request as ready for review September 8, 2023 11:50
@dselman dselman requested a review from a team September 8, 2023 11:50
@mttrbrts mttrbrts changed the title decorator multi property feat(core): decorator multi property Sep 8, 2023
Copy link
Member

@mttrbrts mttrbrts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bump test coverage.

Also, it looks like we need to update the metamodel.

@dselman dselman requested a review from mttrbrts October 2, 2023 12:22
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
@dselman dselman merged commit f3970a2 into main Oct 2, 2023
11 checks passed
@dselman dselman deleted the ds-decorator-multi-property branch October 2, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for applying same decorator to multiple properties in the same model with single command
2 participants