Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

Comments

Add documentation for register method#155

Closed
shiqimei wants to merge 15 commits intoRocketChat:masterfrom
shiqimei:add-documentation-for-register
Closed

Add documentation for register method#155
shiqimei wants to merge 15 commits intoRocketChat:masterfrom
shiqimei:add-documentation-for-register

Conversation

@shiqimei
Copy link
Contributor

@shiqimei shiqimei commented Oct 4, 2019

resolved review: #145 (comment)

shiqimei and others added 15 commits August 6, 2019 14:50
* Add interfaces IExternalComponent and IExternalComponentExtend

* Add externalComponents property for IConfigurationExtend

* export IExternalComponent

* Add interface IExternalComponentLocationOptions

* implement the interface IExternalComponentsExtend

* export ExternalComponentsExtend

* Add externalComponentManager for AppManager

* implement AppExternalComponentManager

* Implement IExternalComponentBridge

* Add getExternalComponentBridge method for AppBridges

* export AppExternalComponentManager

* Update getConfigurationExtend method for AppAccessorManager

* [TEST] Update appBridge and add externalComponentBridge

* Update related test scripts

* Remove IExternalComponentBridge interface

* AppExternalComponentManager maintains the list of all registered components itself

* Update test scripts

* Add webhooks interface for the external component

* Update the interface IExternalComponent

* Add description field to the interface IExternalComponent
* update IWebHooks interface

* Add util randomString

* add AppEmbeddedSDK

* move constants to src/client/constants directory

* separate initListener from call method
* rename initListener to init
* chore: change comment style to obtain VS Code Intellisense

* feat: add unregisterComponent method

We made follwing changes for the AppExternalComponentManager:
* add new private property - appTouchedComponents
* add new public method unregisterComponent
* add new public method getExternalComponent

* Add unregisterComponent in the lifecycle methods

We need to call unregisterComponent method to remove the corresponding external  components from the providedComponents when following AppManager's methods are called:
*  `unload` is called
* `disable` is called <-> Disable an app
*  `remove` is called <-> Uninstall an app
*  `updateAppsMarketplaceInfo` is called and validateLicense not pass
* `initializeApp` is called and validateLicense not pass
* `enableApp` is called but is not success

* Add new AppExternalComponentManager method purgeComponent

when remove an app from the system, we need delete its external component from both providedComponents map set and appTouchedCompoents map set.

* fix: new deployed app registers externalComponents automatically

since the new deployed app will try to register their externalComponent when the  `initializeApp` method of AppManager is called. This is not expected behavior. We introduce a new parameter `addToProvidedComponents` for the method `registerComponent` to handle the above problem. Without specifying `registerComponent` to true, the app only "declares" it touched the external component when it is initialized. Only if the `enableApp` method is called, the external component will truly added to providedComponents map set, which means we can access it in the `Game Center`.
)

* Add new location to external components
* MODAL (new)

* update enum ExternalComponentLocation
* update IWebHooks interface

* Add util randomString

* add AppEmbeddedSDK

* move constants to src/client/constants directory

* separate initListener from call method
* rename initListener to init

* add appId to IExternalComponent interface
* Add interfaces IUserInfo and IRoomInfo

* Add documentation for the public methods
* getUserInfo
* getRoomInfo

* Rename AppEmbeddedSDK to AppClientEmbeddedSDK
* rename to make sure others can see that it's for client-side
* add the class documentation for the AppClientEmbeddedSDK

* Rename the AppClientEmbeddedSDK methods
* Rename to make sure others can see it's for client-side
* Add documentation for the IClientRoomInfo and IClientInfo interfaces
* remove tests externalComponentBridge

* remove the extra blank line

* fix typos and add necessary blank lines

* fix a grammar error in comments

* Rename names to avoid confusions
* rename IExternalComponentsExtend to IExternalComponentExtend
* rename externalComponents to externalComponent
@shiqimei shiqimei closed this Oct 4, 2019
@codecov
Copy link

codecov bot commented Oct 4, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@7db6e7c). Click here to learn what that means.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #155   +/-   ##
=========================================
  Coverage          ?   57.67%           
=========================================
  Files             ?       65           
  Lines             ?     2266           
  Branches          ?      350           
=========================================
  Hits              ?     1307           
  Misses            ?      959           
  Partials          ?        0
Impacted Files Coverage Δ
src/server/managers/AppSlashCommandManager.ts 99.38% <ø> (ø)
src/server/accessors/ConfigurationExtend.ts 100% <100%> (ø)
src/server/managers/AppAccessorManager.ts 100% <100%> (ø)
src/server/managers/AppExternalComponentManager.ts 20% <20%> (ø)
src/server/AppManager.ts 15.42% <27.27%> (ø)
src/server/accessors/ExternalComponentExtend.ts 50% <50%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7db6e7c...29fe99d. Read the comment docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants