-
Notifications
You must be signed in to change notification settings - Fork 374
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. |
a-b-r-o-w-n
left a comment
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 <32191031+luhan2017@users.noreply.github.com> Co-authored-by: Ben Brown <benbro@microsoft.com> Co-authored-by: Tony Anziano <tonyanziano5@gmail.com> Co-authored-by: Srinaath Ravichandran <srinaath27@gmail.com> Co-authored-by: Dong Lei <donglei@microsoft.com>


Description
save extension state
Task Item
close #6086
Screenshots