-
Notifications
You must be signed in to change notification settings - Fork 35
Onboarding finished #31
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
Open
YuveerMaharaj
wants to merge
2
commits into
IMQS:master
Choose a base branch
from
YuveerMaharaj:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,96 +1,90 @@ | ||
| # Onboarding project for JavaScript | ||
| # Onboarding project for JavaScript | ||
|
|
||
| This is a JavaScript project for all new developers to complete before venturing into our web frontend codebase. | ||
| This is a JavaScript project for all new developers to complete before venturing into our web frontend codebase. | ||
|
|
||
| Once you complete this project, and have been through code review, you will have a much better understanding of JavaScript | ||
| and it's superset, TypeScript, that we use for development. | ||
| and it's superset, TypeScript, that we use for development. | ||
|
|
||
| ## Technologies you will encounter | ||
| ## Technologies you will encounter | ||
|
|
||
| 1. HTML | ||
| 1. CSS | ||
| 1. JavaScript | ||
| 1. TypeScript | ||
| 1. HTML | ||
| 1. CSS | ||
| 1. JavaScript | ||
| 1. TypeScript | ||
| 1. Node Package Manager (npm) | ||
| 1. JQuery | ||
| 1. JQuery | ||
|
|
||
| ## Brief | ||
| ## Brief | ||
|
|
||
| You task is to build a grid/table in TypeScript that fetches data from a server and displays it. Here are the requirements: | ||
| You task is to build a grid/table in TypeScript that fetches data from a server and displays it. Here are the requirements: | ||
|
|
||
| 1. The grid should cover the entire screen. The browser scrollbar should not appear. | ||
| 1. The columns widths should be distributed evenly. | ||
| 1. Display column headings based on the data you get back from the web service. | ||
| 1. The grid should have controls to navigate through data. You can choose a suitable way of doing this. | ||
| 1. Display the first page of data when you open up page for first time. | ||
| 1. Don't use any third-party libraries other than JQuery (already included in `third_party` directory). | ||
| 1. The grid should cover the entire screen. The browser scrollbar should not appear. | ||
| 1. The columns widths should be distributed evenly. | ||
| 1. Display column headings based on the data you get back from the web service. | ||
| 1. The grid should have controls to navigate through data. You can choose a suitable way of doing this. | ||
| 1. Display the first page of data when you open up page for first time. | ||
| 1. Don't use any third-party libraries other than JQuery (already included in `third_party` directory). | ||
|
|
||
| ## Web Service API | ||
| ## Web Service API | ||
|
|
||
| The web service you will retrieve data from is a little Golang REST service that is packaged with this repository. It runs on port 2050. | ||
| The web service you will retrieve data from is a little Golang REST service that is packaged with this repository. It runs on port 2050. | ||
| Here are the relevant API calls: | ||
|
|
||
| 1. Get total number of records | ||
| Path: `HTTP GET /recordCount` | ||
| Response: Integer number in body of response | ||
| Example response: | ||
| `350` | ||
| Path: `HTTP GET /recordCount` | ||
| Response: Integer number in body of response | ||
| Example response: | ||
| `350` | ||
|
|
||
| 1. Get column names | ||
| Path: `HTTP GET /columns` | ||
| Response: JSON in body of response | ||
| Example response: | ||
| `[ | ||
| "ID", | ||
| "City", | ||
| "Population" | ||
| ]` | ||
| Path: `HTTP GET /columns` | ||
| Response: JSON in body of response | ||
| Example response: | ||
| `[ "ID", "City", "Population" ]` | ||
|
|
||
| 1. Get records | ||
| Path: `HTTP GET /records?from={fromID}&to={toID}` | ||
| Response: JSON in body of response | ||
| The order of entries in a record corresponds to the order of the columns returned by the `/columns` API | ||
| The `from` and `to` parameters correspond to the record index which run from `0` to `record count - 1` | ||
| Example response: | ||
| `[ | ||
| [0, "Cape Town", 3500000], | ||
| [1, "New York", 8500000], | ||
| [2, "Johannesburg", 4500000] | ||
| ]` | ||
|
|
||
| ## Code Review | ||
|
|
||
| Once you are done and happy with your solution, submit your code for code review by creating a pull request in GITHUB. The code review will take the following into account: | ||
|
|
||
| 1. Was the brief correctly followed, does the grid work as expected | ||
| 1. Is the code style according to our [JavaScript Style Guide](https://imqssoftware.atlassian.net/wiki/display/AR/Javascript+Style+Guide) | ||
| 1. User-centric thinking - is the grid easy to use | ||
| 1. Suitable comments | ||
| 1. Performance considerations | ||
| 1. Aesthetics | ||
|
|
||
| ## Pre-requisites | ||
|
|
||
| 1. You need to have set up your development environment [as described here](https://imqssoftware.atlassian.net/wiki/display/AR/Dev+Environment). | ||
| 1. We suggest using VSCode, but you can use your IDE of choice. | ||
|
|
||
| ## Getting Started | ||
| Path: `HTTP GET /records?from={fromID}&to={toID}` | ||
| Response: JSON in body of response | ||
| The order of entries in a record corresponds to the order of the columns returned by the `/columns` API | ||
| The `from` and `to` parameters correspond to the record index which run from `0` to `record count - 1` | ||
| Example response: | ||
| `[ [0, "Cape Town", 3500000], [1, "New York", 8500000], [2, "Johannesburg", 4500000] ]` | ||
|
|
||
| ## Code Review | ||
|
|
||
| Once you are done and happy with your solution, submit your code for code review by creating a pull request in GITHUB. The code review will take the following into account: | ||
|
|
||
| 1. Was the brief correctly followed, does the grid work as expected | ||
| 1. Is the code style according to our [JavaScript Style Guide](https://imqssoftware.atlassian.net/wiki/display/AR/Javascript+Style+Guide) | ||
| 1. User-centric thinking - is the grid easy to use | ||
| 1. Suitable comments | ||
| 1. Performance considerations | ||
| 1. Aesthetics | ||
|
|
||
| ## Pre-requisites | ||
|
|
||
| 1. You need to have set up your development environment [as described here](https://imqssoftware.atlassian.net/wiki/display/AR/Dev+Environment). | ||
| 1. We suggest using VSCode, but you can use your IDE of choice. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| These steps include just enough detail to guide you. Each step will require some additional research on your part: | ||
| 1. Fork this GIT repository under your own GIT account | ||
|
|
||
| 1. Fork this GIT repository under your own GIT account | ||
| 1. Start up the backend server: | ||
| - Open console and change directory to `server` directory | ||
| - Run `env.bat` | ||
| - Run `go run main.go` | ||
| - Open up your browser and point it to [http://localhost:2050](http://localhost:2050). You should see "Hello" | ||
| 1. Create the frontend project: | ||
| - Open another console in the project root directory | ||
| - Run `npm init` to initialise the JavaScript project. You can just use the default options. | ||
| - Install the TypeScript npm package. | ||
| - Install TypeScript type definitions for JQuery. | ||
| - Create an `app.ts` file in the root directory and add the following code to it: | ||
| `window.onload = () => { $("body").text("Hello world"); }` | ||
| - Add a npm script called "build" to `package.json` that does the TypeScript build (using the `tsconfig.json` included in the project). | ||
| - Run `npm run build` | ||
| - You will see a new file `app.js` in the project root. Add an entry for this script in `index.html`. | ||
| - Refresh [http://localhost:2050](http://localhost:2050). You should see "Hello world" | ||
| 1. Get coding! | ||
| - Open console and change directory to `server` directory | ||
| - Run `env.bat` | ||
| - Run `go run main.go` | ||
| - Open up your browser and point it to [http://localhost:2050](http://localhost:2050). You should see "Hello" | ||
| 1. Create the frontend project: | ||
| - Open another console in the project root directory | ||
| - Run `npm init` to initialise the JavaScript project. You can just use the default options. | ||
| - Install the TypeScript npm package. | ||
| - Install TypeScript type definitions for JQuery. | ||
| - Create an `app.ts` file in the root directory and add the following code to it: | ||
| `window.onload = () => { $("body").text("Hello world"); }` | ||
| - Add a npm script called "build" to `package.json` that does the TypeScript build (using the `tsconfig.json` included in the project). | ||
| - Run `npm run build` | ||
| - You will see a new file `app.js` in the project root. Add an entry for this script in `index.html`. | ||
| - Refresh [http://localhost:2050](http://localhost:2050). You should see "Hello world" | ||
| 1. Get coding! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
|
|
||
|
|
||
|
|
||
| body{ | ||
| background-image: url("https://previews.123rf.com/images/provector/provector1303/provector130300080/18783350-abstract-technology-database-background.jpg"); | ||
| } | ||
|
|
||
|
|
||
| table { | ||
|
|
||
| top: 6%; | ||
| bottom: 20; | ||
| left: 0; | ||
| right: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| table-layout: fixed; | ||
| position: relative; | ||
| text-align: left; | ||
| } | ||
|
|
||
| body{ | ||
|
|
||
| overflow: hidden; | ||
| } | ||
|
|
||
| th { | ||
| width: 100/11%; | ||
| border: 2px solid red; | ||
| background-color: red; | ||
| } | ||
|
|
||
| tr:hover td{ | ||
| background-color: blueviolet; | ||
| } | ||
|
|
||
| td { | ||
| width: 100/11%; | ||
| border: 2px solid blue; | ||
| background:black; | ||
| color: yellow; | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| .searchButtons{ | ||
| top:1%; | ||
| left: 50%; | ||
| border-radius: 20px; | ||
| background-color: blueviolet; | ||
| border: none; | ||
| color: white; | ||
| padding: 8px 16px; | ||
| text-align: center; | ||
| display: inline-flex; | ||
| font-size: 16px; | ||
| margin: 0%; | ||
| -webkit-transition-duration: 0.4s; /* Safari */ | ||
| transition-duration: 0.4s; | ||
| cursor: pointer; | ||
| height: 20px; | ||
|
|
||
| } | ||
|
|
||
| #previousPage{ | ||
|
|
||
| top:1%; | ||
| float: left; | ||
| border-radius: 20px; | ||
| border: none; | ||
| background-color:blueviolet; | ||
| color: white; | ||
| padding: 8px 16px; | ||
| text-align: center; | ||
| /* display: inline-flex; */ | ||
| font-size: 16px; | ||
| -webkit-transition-duration: 0.4s; /* Safari */ | ||
| transition-duration: 0.4s; | ||
| cursor: pointer; | ||
|
|
||
|
|
||
|
|
||
| } | ||
|
|
||
| #nextPage { | ||
|
|
||
|
|
||
| top:1%; | ||
| float: right; | ||
| transition: 0.5s; | ||
| border-radius: 20px; | ||
| border: none; | ||
| background-color: blueviolet; | ||
| color: white; | ||
| padding: 8px 16px; | ||
| text-align: center; | ||
| /* display: inline-flex; */ | ||
| font-size: 16px; | ||
| -webkit-transition-duration: 0.4s; /* Safari */ | ||
| transition-duration: 0.4s; | ||
| cursor: pointer; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good on you for using Styles that work across different browsers :)