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

[Designer] Version Restriction #3260

Closed
jeffhoang opened this issue Jul 26, 2019 · 7 comments · Fixed by #3508
Closed

[Designer] Version Restriction #3260

jeffhoang opened this issue Jul 26, 2019 · 7 comments · Fixed by #3508
Assignees
Labels
Area-Tooling no-recent-activity Platform-JavaScript Bugs or features related to the JavaScript renderer Task

Comments

@jeffhoang
Copy link

jeffhoang commented Jul 26, 2019

Platform

  • JavaScript

Version of SDK

1.1

Version of Adaptive Cards Designer

0.7.1

Issue / Feature Request

Is there a way to restrict the adaptive cards designer to only support a certain adapative cards version? We're still on version 1.1 and don't want our developers to use features beyond this.

@matthidinger
Copy link
Member

Thanks for the feedback. This is something that is being worked on, hopefully we'll have it finished it shortly. In the mean time, can you try this code to at least restrict items from the toolbar?

let designer = new ACDesigner.CardDesigner(hostContainers);
Adaptive.AdaptiveCard.elementTypeRegistry.unregisterType("RichTextBlock");
ACDesigner.CardDesignerSurface.cardElementPeerRegistry.unregisterPeer(Adaptive.RichTextBlock);
 
Adaptive.AdaptiveCard.elementTypeRegistry.unregisterType("ActionSet");
ACDesigner.CardDesignerSurface.cardElementPeerRegistry.unregisterPeer(Adaptive.ActionSet);
 
designer.attachTo(document.getElementById("designerRootHost"));
 
Adaptive.AdaptiveCard.actionTypeRegistry.unregisterType("Action.ToggleVisibility");
    ACDesigner.CardDesignerSurface.actionPeerRegistry.unregisterPeer(Adaptive.ToggleVisibilityAction);

@shalinijoshi19
Copy link
Member

@dclaux, can this be closed now?

@dclaux
Copy link
Member

dclaux commented Sep 4, 2019

@shalinijoshi19 no, there is still a lot to do to actually make the designer version aware. What Matt suggests above is a way to de-register elements, but that doesn't fully solve the problem.

@shalinijoshi19
Copy link
Member

Thanks; Do we have a quick one-pager/spec consolidating the versioning requirements we are targeting for the designer?

@shalinijoshi19 shalinijoshi19 added the Platform-JavaScript Bugs or features related to the JavaScript renderer label Sep 4, 2019
@dclaux
Copy link
Member

dclaux commented Sep 4, 2019

We don't. By the time I have a PR for the feature, I will open an issue with a description of what it entails. But it's fairly simple:

  • Designer has a version selector
  • Cards are parsed per the selected version (e.g. don't parse the "minHeight" property if selected version isn't 1.2 or greater)
  • Cards are serialized to JSON per the selected version (e.g. don't serialize the "minHeight" property if selected version isn't 1.2 or greater)
  • Property sheet only shows properties that existed in the selected version
  • Toolbox only shows elements that were available in selected version

@shalinijoshi19
Copy link
Member

Thanks. I've also captured this to the internal OneNote I'd created for tracking.

@ghost
Copy link

ghost commented Dec 6, 2019

This issue has been automatically marked as stale because it has not had any activity for 5 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tooling no-recent-activity Platform-JavaScript Bugs or features related to the JavaScript renderer Task
Projects
None yet
4 participants