Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

CHE-9840 add factory events handling #3

Merged
merged 1 commit into from
Jul 17, 2018
Merged

CHE-9840 add factory events handling #3

merged 1 commit into from
Jul 17, 2018

Conversation

olexii4
Copy link
Contributor

@olexii4 olexii4 commented Jul 6, 2018

What does this PR do?

Add factory events handling. Implement OpenFile action.

What issues does this PR fix or reference?

eclipse-che/che#10162
eclipse-che/che#9840

https://bluejeans.com/s/s@Q@K/

Signed-off-by: Oleksii Orel oorel@redhat.com

greetingTitle?: string,
greetingContentUrl?: string
}
}

Choose a reason for hiding this comment

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

Missed line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


this.git.clone(
importProjectPromices.push(this.git.clone(

Choose a reason for hiding this comment

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

We could use "await" here. But up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am sure about that. We should start in parallel and wait for resolve importProjectPromices.

this.git.checkout(repo, options);
}
return Promise.resolve();
}
).catch((error) => {
console.error(`Couldn't clone ${source.location} to ${projectPath}... ${error}`);

Choose a reason for hiding this comment

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

Minor, but such case: clone could be done successfully, but than error can be thrown on checkout operation. Message service always displays error message "Couldn't clone...", but in this case it should only notify about checkout fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Done


this.onAppLoaded((event: { actions: Array<IFactoryAction> }) => {
event.actions.forEach((onAppLoadedAction: IFactoryAction) => {
console.log('>>>>>>>>>>> onAppLoaded.action', onAppLoadedAction);
Copy link
Member

Choose a reason for hiding this comment

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

log trace to be removed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

});
this.onAppClosed(() => {
this.onAppClosedActions.forEach((onAppClosedAction: IFactoryAction) => {
console.log('>>>>>>>>>>> onAppClosed.action', onAppClosedAction);
Copy link
Member

Choose a reason for hiding this comment

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

log trace to remove ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

}

getEnvVariable(name: string): EnvVariable | undefined {
if (!this.envVariables) {
return undefined;
}
return this.envVariables.find(function(envVariable) { return envVariable.name === name });
return this.envVariables.find(function (envVariable) {
Copy link
Member

Choose a reason for hiding this comment

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

use of arrow function instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@sunix sunix left a comment

Choose a reason for hiding this comment

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

missing
in che-theia-factory/package.json ?

"@theia/editor": "0.3.12",

@sunix
Copy link
Contributor

sunix commented Jul 16, 2018

could you also rebase ? (so it works on Theia 0.3.12)

@olexii4
Copy link
Contributor Author

olexii4 commented Jul 17, 2018

Done

@@ -0,0 +1,93 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

FYI license there https://github.com/eclipse/che-theia-factory-extension/blob/master/LICENSE is EPL 2.0

so copyright headers should be 2.0 as well.

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2018-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
Copy link
Member

Choose a reason for hiding this comment

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

link is still pointing to v10.html

example of EPL 2.0 headers:
https://github.com/eclipse/theia-generator-plugin/blob/master/src/app/index.ts#L1-L9

Copy link
Member

Choose a reason for hiding this comment

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

@benoitf
Copy link
Member

benoitf commented Jul 17, 2018

headers should be

/*********************************************************************
* Copyright (c) 2018 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/

https://www.eclipse.org/legal/epl-2.0/faq.php#h.q72cnghf29k0

@olexii4
Copy link
Contributor Author

olexii4 commented Jul 17, 2018

Done

Copy link
Member

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

thx

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@olexii4 olexii4 merged commit 0ee74c9 into eclipse:master Jul 17, 2018
@olexii4 olexii4 deleted the CHE-9840 branch July 17, 2018 14:14
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.

5 participants