-
Notifications
You must be signed in to change notification settings - Fork 378
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
fix: save extension state #6309
Conversation
Why can't the extension save its own state? I'm concerned that by exposing extension state to the client, the extensions become un-encapsulated. Why not at that point just move the publish extension into the client itself? What is the point of the extension anymore? |
extensions/azurePublish/src/components/azureProvisionDialog.tsx
Outdated
Show resolved
Hide resolved
extensions/azurePublish/src/components/azureProvisionDialog.tsx
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/pages/botProject/create-publish-profile/PublishProfileDialog.tsx
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/pages/botProject/create-publish-profile/ProfileFormDialog.tsx
Show resolved
Hide resolved
Composer/packages/client/src/pages/botProject/create-publish-profile/PublishProfileDialog.tsx
Outdated
Show resolved
Hide resolved
extensions/azurePublish/src/components/azureProvisionDialog.tsx
Outdated
Show resolved
Hide resolved
@a-b-r-o-w-n Your are right, but now the profile adding page[like below] is in client and share with other type of profile. I'm not sure how to keep the form state in client and extension during we moving forward and backward is better? Could you give me some advises? Thanks. |
Hi @a-b-r-o-w-n, I use localStorage to save the extension state now. could your help to review the PR? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't what we discussed. What we discussed is adding an api in the extension client package called useLocalStorage
that returns scoped apis for extensions (and more specifically, bundles) to access local storage.
The extension client will manage scoping those apis correctly. In order to do so we discussed adding a __bundleId
to window in order to create a local storage item with the following shape:
{ "composer:extensions": { [__extensionId]: { [__bundleId]: {} } }
Composer/packages/client/src/pages/botProject/create-publish-profile/PublishProfileDialog.tsx
Outdated
Show resolved
Hide resolved
Composer/packages/client/src/pages/botProject/create-publish-profile/PublishProfileDialog.tsx
Outdated
Show resolved
Hide resolved
Removing from 1.4 |
Hi @a-b-r-o-w-n, I resolved all the comments, could you take a look please? |
Composer/packages/extension-client/src/hooks/useLocalStorage.ts
Outdated
Show resolved
Hide resolved
Composer/packages/extension-client/src/hooks/useLocalStorage.ts
Outdated
Show resolved
Hide resolved
Composer/packages/extension-client/src/hooks/useLocalStorage.ts
Outdated
Show resolved
Hide resolved
Composer/packages/extension-client/src/hooks/useLocalStorage.ts
Outdated
Show resolved
Hide resolved
extensions/azurePublish/src/components/azureProvisionDialog.tsx
Outdated
Show resolved
Hide resolved
extensions/azurePublish/src/components/azureProvisionDialog.tsx
Outdated
Show resolved
Hide resolved
* save name and target state * save extension status * remove annotation * fix comments * use localStorage instead of setExtensionState to parent component to save state * remove setExtensionState, add useLocalStorage * polish * update uselocalStorage, use hooks in extension to save state; * fix comments * polish Co-authored-by: Lu Han <[email protected]> Co-authored-by: Ben Brown <[email protected]> Co-authored-by: Tony Anziano <[email protected]> Co-authored-by: Srinaath Ravichandran <[email protected]> Co-authored-by: Dong Lei <[email protected]>
Description
save extension state
Task Item
close #6086
Screenshots