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

[2877] Add support for breadcrumbs in Portals #2879

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pcdavid
Copy link
Member

@pcdavid pcdavid commented Jan 5, 2024

No description provided.

Bug: #2765
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@pcdavid pcdavid changed the base branch from master to pcd/enh/portal January 5, 2024 14:10
@pcdavid pcdavid added this to the 2024.1.0 milestone Jan 5, 2024
@pcdavid pcdavid linked an issue Jan 5, 2024 that may be closed by this pull request
Bug: #2877
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@pcdavid
Copy link
Member Author

pcdavid commented Jan 5, 2024

Note that this version completely crashes the backend.

For some reason I don't yet completely understand, the editing context event processor stays blocked indefinitly on future.get() after submitting the () -> this.doHandle(payloadSink, input).
Well, not indefinitely in this version as I added a 5s timeout (which seems like a good idea anyway, though the actual value of delay is debatable and should probably be configurable).

Anyway, I don't really see how the new GraphQL field, data fetcher and handler I added are different from what's already done for RepresentationMetadataDescriptionDataFetcher.

In summary, the changes are:

// portal.graphqls
extend type RepresentationMetadata {
  breadcrumbs: [WorkbenchSelectionEntry!]!
}

The corresponding data fetcher is RepresentationMetadataBreadcrumbsDataFetcher and follows the same patterns as RepresentationMetadataDescriptionDataFetcher:

  • read the data from the GraphQL environment
  • create a custom input record, here a RepresentationBreadcumbsInput instead of a GetRepresentationDescriptionInput
  • the actual handling is done in RepresentationBreadcrumbEventHandler which emit a RepresentationBreadcrumbsSuccessPayload (instead of a GetRepresentationDescriptionPayload) and ChangeKind.NOTHING change description.

The only difference I see is that on the front:

  • I fetch (possibly) multiple "instances" of this field, one for each representation embedded inside a portal:
views {
  id
  representationMetadata {
    id
    kind
    label
    breadcrumbs {
      id
      kind
      label
    }
  }
}
  • this is done in the context of a subscription and not a plain query.

@sbegaudeau do you see what I'm doing wrong?

@pcdavid
Copy link
Member Author

pcdavid commented Jan 5, 2024

PS: ignore the fact that in this version the handler hard-codes the computation of the breadcrumbs using EMF-specific code. This was just for the initial PoC.

Base automatically changed from pcd/enh/portal to master January 8, 2024 14:17
@pcdavid pcdavid modified the milestones: 2024.1.0, 2024.3.0 Jan 19, 2024
@pcdavid pcdavid removed this from the 2024.3.0 milestone Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for breadcrumbs in Portals
1 participant