Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

[aca-4419] add new event once user is logged in #1105

Merged
merged 10 commits into from May 11, 2021
Merged

Conversation

eromano
Copy link
Contributor

@eromano eromano commented May 11, 2021

Please check if the PR fulfills these requirements

[x] The commit message follows our [guidelines](https://github.com/Alfresco/alfresco-js-api/wiki/Commit-format)
[x] Tests for the changes have been added (for bug fixes / features)
[x] Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] Documentation
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
add new event once user is logged in

What is the new behavior?

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[ ] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@eromano eromano merged commit 6da29b8 into develop May 11, 2021
@eromano eromano deleted the dev-eromano-ACA-4419 branch May 11, 2021 14:56
@@ -78,6 +90,10 @@ export class AlfrescoApi implements Emitter {
this.oauth2Auth.setConfig(this.config, this);
}

this.oauth2Auth?.on('logged-in', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

By this time, can't we be sure, that we have this.oauth2Auth?

@@ -87,16 +103,23 @@ export class AlfrescoApi implements Emitter {
this.processAuth.setConfig(this.config);
}

this.processAuth?.on('logged-in', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

By this time, can't we be sure, that we have this.processAuth?

if (!this.contentAuth) {
this.contentAuth = new ContentAuth(this.config, this);
} else {
this.contentAuth.setConfig(config);
}

this.contentAuth?.on('logged-in', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

By this time, can't we be sure, that we have this.contentAuth?


reply(event: string, callback ?: any): void {
if (this.bufferEvents.indexOf(event) >= 0) {
Function.prototype.apply.call(callback, this, arguments);
Copy link
Contributor

Choose a reason for hiding this comment

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

callback?.apply(this, arguments)?

Copy link
Contributor

Choose a reason for hiding this comment

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

What is this reply method for?

@@ -141,7 +141,7 @@ export class AlfrescoApiCompatibility extends AlfrescoApi {
moduleCopy[currentClass] = module[currentClass];
let obj = this._stringToObject(currentClass, module);
let nameObj = this._lowerFirst(currentClass);
obj.init(this);
obj?.init(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this, if 2 lines above, we explicitly assigned a value to this variable? Is the returned interface of _stringToObject amboguous?

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

Successfully merging this pull request may close these issues.

None yet

3 participants