Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Editor] Providing front end design for Streaming Integrator extension-installation features #1781

Merged
merged 6 commits into from
Feb 13, 2020

Conversation

SinthujanSintha
Copy link
Contributor

Purpose

$Subject

Goals

Provide the front end design facility to user which is she or he can install or uninstall extension by clicking related button and also provide more details about extensions.

Approach

In this PR I had developed the code only for front end designing with hard code json to the above mentioned features.In order to to that I added one new js file and edited some other existing js file to providing front end platform for user to install /uninstall extensions through editor.

Security checks

Samples

extesnionBox
operatorExtension

Test environment

Chrome,Fire fox

dnwick
dnwick previously approved these changes Jan 28, 2020
,
}
},
{name: "kafka", status: "not-installed"},
Copy link
Contributor

Choose a reason for hiding this comment

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

is this json has the latest format ? @senthuran16 please check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no its not a latest format i will change this json data as @senthuran16 shared json data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

88cbc98 this commit will fix this change request

/**
* functions to get the not installed extension array details.
*/
var getNotInstalledExtensionDetails = function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

change to getUninstalledExtensionDetails

Copy link
Contributor Author

Choose a reason for hiding this comment

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

88cbc98 this commit will fix this change request

Copy link
Member

@senthuran16 senthuran16 Jan 29, 2020

Choose a reason for hiding this comment

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

@dnwick Shall we say getNonInstalledExtensionDetails ? 'Uninstalled' might give the wrong idea as "Installed, and removed later"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since @dnwick asked me to change that as getUninstalledExtensionDetails,I have changed as that.If he ok with this i will be ok

if (isNotInstalledExtension(operatorExtension)) {
keyResult.push({
extension: getNotInstalledExtensionObject(operatorExtension),
status: "Not-Installed",
Copy link
Contributor

Choose a reason for hiding this comment

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

use constants please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

88cbc98 this commit will fix this change request

@dnwick dnwick self-requested a review January 28, 2020 10:25
@dnwick dnwick dismissed their stale review January 28, 2020 10:26

accidently approved

@@ -309,11 +309,11 @@ define(['jquery', 'lodash', 'log','remarkable', 'handlebar', 'designViewUtils','
/**
* functions to get the not installed extension array details.
*/
var getNotInstalledExtensionDetails = function () {
var getUninstalledExtensionDetails = function () {
Copy link
Member

Choose a reason for hiding this comment

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

@dnwick & @SinthujanSintha Shall we say getNonInstalledExtensionDetails ? 'Uninstalled' might give the wrong idea as "Installed, and removed later"

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

if (extension.manuallyInstall) {
extensionTableBodyData = $('<tr><td>' + extension.extensionInfo.name + '</td><td>Not-Installed' +
extensionsRendering();
var callbackUpdateForExtensionFileBrowser = function (updatedExtension, isUpdated) {
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 isUpdated means ? do u need to it

createAlertModalBoxForNotAndPartialExtension(extension, key, extensionTableBodyData);
} else {
extensionTableBodyData.find("button").click(function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can take this code out whithout duplicating in each case

"lookupRegex": "grpc-server-(.+).jar"
}
]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

@senthuran16 please check whether json config is correct

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this json config is correct.

alert(updateData.name + " " + updateData.action);
//this updatedExtension data should come from backend.
var updatedExtension = {
// "extensionStatus": "PARTIALLY_INSTALLED",
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comments

@@ -309,11 +309,11 @@ define(['jquery', 'lodash', 'log','remarkable', 'handlebar', 'designViewUtils','
/**
* functions to get the not installed extension array details.
*/
var getNotInstalledExtensionDetails = function () {
var getUninstalledExtensionDetails = function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

var isPartialInstalledExtension = function (operatorExtension) {
var partiallyInstalledExtensionArray = getPartiallyInstalledExtensionDetails();
for (var extension of partiallyInstalledExtensionArray) {
if (((operatorExtension.name.trim().toLowerCase()).indexOf(extension.extensionInfo.name.trim().toLowerCase())) > -1) return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

do not use if clauses without pranthesis even though u can write it in one line. its hard to read the code

@@ -368,14 +435,34 @@ define(['jquery', 'lodash', 'log','remarkable', 'handlebar', 'designViewUtils','
if (isNotInstalledExtension(operatorExtension)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

For each operator in order to check whether its uninstalled extension aren't you creating the same array again again in the getUninstalledExtensionDetails method ? I think that is same for isPartialInstalledExtension , isInstalledExtension functions. Create the the arrays one time and use else this will be a huge process

};
var extensionTable;

function renderExtensions() {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you move this funtion to higher level like this.render = function () {

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

Successfully merging this pull request may close these issues.

3 participants