Skip to content

Conversation

@SAMMOLOI
Copy link
Contributor

No description provided.

Copy link

@nkosimarz nkosimarz left a comment

Choose a reason for hiding this comment

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

You need to get a formatter for your VScode and also get rid of a lot of empty line

app.ts Outdated
@@ -0,0 +1,374 @@
namespace onboardproject {

Choose a reason for hiding this comment

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

remove empty lines

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 manage to fix my format and empty line on the code

app.ts Outdated
const response = await fetch('http://localhost:2050/recordCount');

let promise = new Promise((res, rej) => {
setTimeout(() => res("Now it's done!"), 50)

Choose a reason for hiding this comment

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

is this meant to be Load

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, which mean my async function is going to be pause until a Promise is Settled (that is, fulfilled or rejected), and to resume execution of the async function after fulfillment( i was using it ,to test my function inside )

@SAMMOLOI SAMMOLOI requested a review from nkosimarz August 23, 2021 09:38
Copy link
Contributor

@FritzOnFire FritzOnFire left a comment

Choose a reason for hiding this comment

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

In general, remove your try-catches. All of them seem to be in functions that are async and return promises so the calling function should be able to catch any errors.

Please put an empty line between your function definitions.

@FritzOnFire
Copy link
Contributor

Also, why is your previouses an array? I think you should rather just have a number or two.

Copy link

@pierrehenrinortje pierrehenrinortje left a comment

Choose a reason for hiding this comment

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

Agree with Fritz, some extra comments on my end.

const fromId = ConvertNumber($("#index").val() as string, false);
const possibleStep = calculateToId(fromId) - fromId;
if (fromId < 0) {
alert('only insert Id greater than or equal to 0');

Choose a reason for hiding this comment

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

add a return here so we can remove the next "else" below. This is more readable and reduces excessive indentation in cases where larger nested "if else" statements exist.

Copy link
Contributor

Choose a reason for hiding this comment

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

The comment on this line is still relevant.

app.ts Outdated
namespace onboardproject {
module onboardprojects {

//Load Variable declarations
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a space after the //

Copy link
Contributor

Choose a reason for hiding this comment

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

My comment on this line is still relevant.

app.ts Outdated
let Load = 50;
// Previous Variable declarations
let previous: number[];
//Previous Process Variable declarations
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a space after the //

Copy link
Contributor

Choose a reason for hiding this comment

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

My comment on this line is still relevant.

});
//Searching function for index
$("#go-button").click(async () => {
const recordCount = await getRecordCountCall();
Copy link
Contributor

Choose a reason for hiding this comment

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

You are allowed to skip this step. For this project the record count will not change after the initial call.

@SAMMOLOI SAMMOLOI closed this Aug 25, 2021
@SAMMOLOI SAMMOLOI reopened this Aug 25, 2021
Copy link
Contributor

@FritzOnFire FritzOnFire left a comment

Choose a reason for hiding this comment

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

So the formatting looks a lot better. But for me to approve this, I am going to need you to remove all the try-catchs, and you have to stop using an array to store your fromid and toid (it just feels like an anti-pattern).

Oh, and add your dist/app.min.js to your gitignore.

app.ts Outdated
Comment on lines 18 to 20
// let promise = new Promise((res, rej) => {
// setTimeout(() => res("Now it's done!"), 50)
// });
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need these comments anymore.

app.ts Outdated
Comment on lines 31 to 33
// let promise = new Promise((res, rej) => {
// setTimeout(() => res("Now it's done!"), 50)
// });
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need these comments anymore.

app.ts Outdated
Comment on lines 44 to 46
// let promise = new Promise((res, rej) => {
// setTimeout(() => res("Now it's done!"), 50)
// });
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need these comments anymore.

app.ts Outdated
// }
// };
// }
//region Data Loading methods
Copy link
Contributor

Choose a reason for hiding this comment

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

My comment is still relevant on this line.

app.ts Outdated
DisplayContent += '</tr>';
$("#wrapper-table-content-body").empty();
$("#wrapper-table-content-body").append(DisplayContent);
throw new Error("Error No data");
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this not throw an error every time you call this function?

app.ts Outdated
return toID;
}

//Onload Function
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a space after the //, and an empty line above this line.

app.ts Outdated
//Onload Function
window.onload = async () => {

//Previous_Page_Resize Function
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a space after the //, and an empty line above this line.

app.ts Outdated
return [previous[0] - (nextPageResize(previous) - previous[0]), toId];
}

//On Resize_Function
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a space after the //, and an empty line above this line.

app.ts Outdated
Comment on lines 144 to 145
const toId = calculateToId(previous[0] - (nextPageResize(previous) - previous[0]));
return [previous[0] - (nextPageResize(previous) - previous[0]), toId];
Copy link
Contributor

Choose a reason for hiding this comment

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

You should rather store the result of nextPageResize and use that, than calling that function multiple times

const fromId = ConvertNumber($("#index").val() as string, false);
const possibleStep = calculateToId(fromId) - fromId;
if (fromId < 0) {
alert('only insert Id greater than or equal to 0');
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment on this line is still relevant.

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.

4 participants