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

Comments

Alpha (1.9.0)#145

Merged
d-gubert merged 26 commits intobetafrom
alpha
Nov 15, 2019
Merged

Alpha (1.9.0)#145
d-gubert merged 26 commits intobetafrom
alpha

Conversation

@d-gubert
Copy link
Member

@d-gubert d-gubert commented Sep 27, 2019

Changes:

  • [NEW] External Components

shiqimei and others added 12 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
@CLAassistant
Copy link

CLAassistant commented Sep 27, 2019

CLA assistant check
All committers have signed the CLA.

@d-gubert d-gubert changed the base branch from master to beta September 27, 2019 18:14
@codecov
Copy link

codecov bot commented Sep 27, 2019

Codecov Report

❗ No coverage uploaded for pull request base (beta@cf40265). Click here to learn what that means.
The diff coverage is 64.63%.

Impacted file tree graph

@@           Coverage Diff           @@
##             beta     #145   +/-   ##
=======================================
  Coverage        ?   56.87%           
=======================================
  Files           ?       79           
  Lines           ?     2639           
  Branches        ?      381           
=======================================
  Hits            ?     1501           
  Misses          ?     1138           
  Partials        ?        0
Impacted Files Coverage Δ
src/server/managers/AppSlashCommandManager.ts 99.38% <ø> (ø)
src/server/managers/AppListenerManager.ts 4.19% <0%> (ø)
src/server/managers/AppAccessorManager.ts 100% <100%> (ø)
src/server/accessors/ConfigurationExtend.ts 100% <100%> (ø)
src/server/managers/index.ts 100% <100%> (ø)
src/server/compiler/AppImplements.ts 100% <100%> (ø)
src/server/accessors/index.ts 100% <100%> (ø)
src/server/AppManager.ts 14.91% <30%> (ø)
src/server/accessors/ExternalComponentsExtend.ts 50% <50%> (ø)
src/server/managers/AppExternalComponentManager.ts 97.43% <97.43%> (ø)

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 cf40265...3ed8371. Read the comment docs.

@graywolf336
Copy link
Contributor

Can we get a better pull request name?

Copy link
Contributor

@graywolf336 graywolf336 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, some good work but I would like to see some things clarified and/or made consistent with the rest of the code base.

@shiqimei shiqimei changed the title Alpha [NEW] External Component Support: Foundation for playing HTML5 games in Rocket.Chat Oct 2, 2019
@shiqimei shiqimei changed the title [NEW] External Component Support: Foundation for playing HTML5 games in Rocket.Chat [NEW] Add external component as a foundation to play HTML5 games in Rocket.Chat Oct 2, 2019
* 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 mentioned this pull request Oct 2, 2019
@d-gubert d-gubert changed the title [NEW] Add external component as a foundation to play HTML5 games in Rocket.Chat Alpha (1.7.0) Oct 2, 2019
shiqimei and others added 2 commits October 29, 2019 19:10
* Revert "Rename names to avoid confusions"

This reverts commit d444646.

* support multiple external components per app

* Add error handlers for AppExternalComponentManager

* Add unit tests for two new errors
* ExternalComponentAlreadyTouchedError
* ExternalComponentNotMatchWithAppError

* Add getters for AppExternalComponentManager

* Add unit tests for AppExternalComponentManager
* did some changes to AppExternalComponentManager according to tests

* fix a serious logic error

* compare objects after serialization

* add space before parenttheses

* Modify documentation to state the name unique

* Redesign getExternalComponents
* Rename providedExternalComponents to registeredExternalComponents
* Redesign getExternalComponents

* Remove ExternalComponentAlreadyTouchedError

* overwrite an external component with the same name

* Remove ExternalComponentNotMatchWithAppError
* Because of the caller of the method addExternalComponent is apps-engine. So we can trust the appId provided.
* Always overwrite the externalComponent.appId to the appId via the method addExternalComponent

* Add external components only if it is not empty

* Add a new public method getProvidedComponents

* Make sure the return is an array
@d-gubert d-gubert changed the title Alpha (1.7.0) Alpha (1.8.0) Nov 11, 2019
Shiqi Mei and others added 6 commits November 11, 2019 02:04
* [ALPHA] Move host logic into apps-engine repo

* Rename EClientEmbeddedSDKActions

* Remove the word `embedded` from client SDK files

* Rename the client SDK to AppsEngineClient

* Redesign external component webhooks (#168)

* Remove IWebHooks
* Remove IWebHooks
* Remove webhooks options from IExternalComponentOptions and redesign it

Introduce state for external components

Add IPreExternalComponentOpenedPrevent handler

Add IPostExternalComponentOpened handler
* add accessors for IPreExternalComponentOpenedPrevent handler
* Add IPostExternalComponentOpened handler

Add IPostExternalComponentClosed handler

Remove IPreExternalComponentOpenedPrevent

* export modules

* Update metadata AppMethod

* Update AppImplements

* Add methods to AppListenerManager

* Remove IWebHooks
* Remove IWebHooks
* Remove webhooks options from IExternalComponentOptions and redesign it

Introduce state for external components

Add IPreExternalComponentOpenedPrevent handler

Add IPostExternalComponentOpened handler
* add accessors for IPreExternalComponentOpenedPrevent handler
* Add IPostExternalComponentOpened handler

Add IPostExternalComponentClosed handler

Remove IPreExternalComponentOpenedPrevent

* export modules

* Update metadata AppMethod

* Update AppImplements

* Add methods to AppListenerManager

* rebase onto move-host-logic

* Remove check methods from event handlers

* Rename a few interfaces

* Rename a few interfaces

* Renamings

* Refactor

* Remove unused files

* Make AppsEngineUIClient use the MESSAGE_ID constant
* Add the command `bundle` for bundling SDK

* Bundle sdk before publishing
@d-gubert d-gubert marked this pull request as ready for review November 15, 2019 15:44
@d-gubert d-gubert dismissed graywolf336’s stale review November 15, 2019 15:45

All requests have been addressed

@d-gubert d-gubert changed the title Alpha (1.8.0) Alpha (1.9.0) Nov 15, 2019
@d-gubert d-gubert merged commit 3ed8371 into beta Nov 15, 2019
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.

6 participants