Skip to content

updated onboarding project#40

Open
SAMMOLOI wants to merge 50 commits into
IMQS:masterfrom
SAMMOLOI:master
Open

updated onboarding project#40
SAMMOLOI wants to merge 50 commits into
IMQS:masterfrom
SAMMOLOI:master

Conversation

@SAMMOLOI

Copy link
Copy Markdown
Contributor

No description provided.

@nkosimarz nkosimarz left a comment

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

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
Copy Markdown
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

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

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

Copy link
Copy Markdown

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
Copy Markdown
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 )

Comment thread app.ts Outdated
Comment thread app.ts Outdated
@SAMMOLOI
SAMMOLOI requested a review from nkosimarz August 23, 2021 09:38

@FritzOnFire FritzOnFire left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread style.css Outdated
Comment thread style.css Outdated
@FritzOnFire

Copy link
Copy Markdown
Contributor

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

@pierrehenrinortje pierrehenrinortje left a comment

Copy link
Copy Markdown

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.

Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts
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
Copy Markdown

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
Copy Markdown
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.

Comment thread app.ts Outdated
Comment thread app.ts Outdated
namespace onboardproject {
module onboardprojects {

//Load Variable declarations

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread app.ts Outdated
let Load = 50;
// Previous Variable declarations
let previous: number[];
//Previous Process Variable declarations

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts Outdated
Comment thread app.ts
});
//Searching function for index
$("#go-button").click(async () => {
const recordCount = await getRecordCountCall();

Copy link
Copy Markdown
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

@FritzOnFire FritzOnFire left a comment

Copy link
Copy Markdown
Contributor

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.

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

Copy link
Copy Markdown
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.

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

Copy link
Copy Markdown
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.

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

Copy link
Copy Markdown
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.

Comment thread app.ts Outdated
// }
// };
// }
//region Data Loading methods

Copy link
Copy Markdown
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.

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

Copy link
Copy Markdown
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?

Comment thread app.ts Outdated
return toID;
}

//Onload Function

Copy link
Copy Markdown
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.

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

//Previous_Page_Resize Function

Copy link
Copy Markdown
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.

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

//On Resize_Function

Copy link
Copy Markdown
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.

Comment thread 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
Copy Markdown
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

Comment thread app.ts
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
Copy Markdown
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