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

Support schema-grouped descriptor arrays on operand details page #6178

Merged
merged 1 commit into from Jul 31, 2020

Conversation

TheRealJon
Copy link
Member

@TheRealJon TheRealJon commented Jul 31, 2020

Implement descriptor groups for descriptors which reference array values.
image

YAML

apiVersion: test.tectonic.com/v1
kind: MockResource
metadata:
  name: example
  namespace: operand-test
spec:
  arrayWithObject:
    - current: true
      organization:
        address:
          city: Raleigh
          state: NC
          street: Davie
        name: Red Hat
    - current: true
      organization:
        address:
          city: Durham
          state: NC
          street: Main
        name: City Hall
  objectWithArray:
    birthday:
      day: 1
      month: 1
      year: 2000
    name: Jon
    tags:
      - test
      - test2

Spec Descriptors:

  - displayName: Object With Array
    path: objectWithArray
  - displayName: Tags
    path: objectWithArray.tags
  - displayName: Tag Element
    path: "objectWithArray.tags[0]"
  - displayName: Birth Month
    path: objectWithArray.birthday.month
    x-descriptors:
      - "urn:alm:descriptor:com.tectonic.ui:number"
  - displayName: Birth Day
    path: objectWithArray.birthday.day
    x-descriptors:
      - "urn:alm:descriptor:com.tectonic.ui:number"
  - displayName: Birth Year
    path: objectWithArray.birthday.year
    x-descriptors:
      - "urn:alm:descriptor:com.tectonic.ui:number"
  - displayName: Name
    path: objectWithArray.name
  - displayName: Array With Object
    path: arrayWithObject
  - displayName: Element
    path: "arrayWithObject[0]"
  - displayName: Organization Name
    path: "arrayWithObject[0].organization.name"
  - displayName: Organization Street
    path: "arrayWithObject[0].organization.address.street"
  - displayName: Organization City
    path: "arrayWithObject[0].organization.address.city"
  - displayName: Organization State
    path: "arrayWithObject[0].organization.address.state"
  - displayName: Is Current
    path: "arrayWithObject[0].current"
    x-descriptors:
      - "urn:alm:descriptor:com.tectonic.ui:checkbox"
  - displayName: Resource Requirements
    path: "arrayWithObject[0].resourceRequirements"
    x-descriptors:
      - "urn:alm:descriptor:com.tectonic.ui:resourceRequirements"

Story: https://issues.redhat.com/browse/CONSOLE-2283
Sub-task: https://issues.redhat.com/browse/CONSOLE-2328

@TheRealJon
Copy link
Member Author

/assign @spadgett

@spadgett
Copy link
Member

/kind feature
/assign

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 31, 2020
@spadgett spadgett added this to the v4.6 milestone Jul 31, 2020
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

Thanks @TheRealJon, do you mind adding a screenshot?

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 31, 2020
@TheRealJon
Copy link
Member Author

cc @tlwu2013

@openshift-ci-robot openshift-ci-robot added component/olm Related to OLM approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 31, 2020
@TheRealJon TheRealJon changed the title [WIP] Support schema-grouped descriptor arrays on operand details page Support schema-grouped descriptor arrays on operand details page Jul 31, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 31, 2020
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

justify-content: start;
& > div {
margin-right: var(--pf-global--spacer--sm);
flex-grow: 1;
Copy link
Member

Choose a reason for hiding this comment

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

nit: alpha


// Replace '.', '[', and '].' with '/'.
export const getPatchPathFromDescriptor = (descriptor: Descriptor): string =>
_.toPath(descriptor.path).join('/');
Copy link
Member

Choose a reason for hiding this comment

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

This isn't new, but we probably need to account for escaping special characters. Let's deal with that separately, though.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 31, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spadgett, TheRealJon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 64d5d79 into openshift:master Jul 31, 2020
@spadgett spadgett linked an issue Dec 7, 2020 that may be closed by this pull request
@TheRealJon TheRealJon deleted the CONSOLE-2328 branch January 28, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/olm Related to OLM kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow grouping field in CR view
4 participants