Repository navigation
[#603][1] Add the basic components for the new frontend - #604
Conversation
|
@henrychen0220 @avinash0161 Please review this PR |
|
Some comments are added to the |
|
I have added the initial frontend testing into the new gui code and integrated the testing procedure into Travis CI |
| capabilities: { | ||
| 'browserName': 'chrome' | ||
| }, | ||
| directConnect: true, |
There was a problem hiding this comment.
I believe this is an automatically generated script. The github page at top lists that we should give a driver path. But it's not here. Have we tested this config?
There was a problem hiding this comment.
This file is automatically generated by Angular CLI when creating a new project, you ignore can all these config files.
|
|
||
| it('should display welcome message', () => { | ||
| page.navigateTo(); | ||
| expect(page.getParagraphText()).toEqual('Welcome to texera!'); |
There was a problem hiding this comment.
I understand that this is just the first PR to integrate the testing mechanism, but we should settle on a proper naming and directory structure, so that tests can be mapped to components easily. Something like we have for backend
There was a problem hiding this comment.
This file is generated by Angular CLI as a placeholder of the file structure. So it's sort of official recommended placeholder test. We haven't integrated e2e test, which means "end to end test". into our project yet. You can ignore everything under e2e.
There was a problem hiding this comment.
NVM. Just saw that this is an automatically generated page. Individual component test files are attached with the components themselves. However, for the end to end tests too, we should formalize a directory structure.
There was a problem hiding this comment.
This directory structure is generated by Angular CLI, so we can view it as official recommended best practice directory structure.
| - cd core | ||
| - mvn test --batch-mode | ||
| - mvn test --batch-mode | ||
| - cd new-gui |
There was a problem hiding this comment.
In protractor config file, we say that source is localhost:4200. This will work locally if we have executed 'ng serve'. But, how will this work on Travis? Is this why we have 'ng test --browsers ChromeHeadless --single-run true'?
There was a problem hiding this comment.
it seems like protractor file is used by e2e test, which we haven't touched. They are just placeholders, please ignore them.
| } | ||
|
|
||
| getParagraphText() { | ||
| return element(by.css('texera-root h1')).getText(); |
There was a problem hiding this comment.
Same comment as above. Once we have proper refactoring, 'texera-root h1' should come from a common variable.
There was a problem hiding this comment.
Same comment, please ignore everything under e2e
There was a problem hiding this comment.
@avinash0161 I have added a new Relevant files: section, please look at files under there.
| @@ -0,0 +1,13 @@ | |||
| # Editor configuration, see http://editorconfig.org | |||
| root = true | |||
There was a problem hiding this comment.
The website at top says that VS code has to install an extension to support editor config. If so, can you change your ppt on frontend to include that this extension should also be installed.
There was a problem hiding this comment.
Sure, this is a nice suggestion.
|
@avinash0161 the purpose of However, this is another way to achieve what you said. They are |
| @@ -0,0 +1,6 @@ | |||
| /* tslint:disable:no-inferrable-types */ | |||
| export class AppSettings { | |||
| private static readonly SERVER_ADDRESS: string = 'http://localhost'; | |||
There was a problem hiding this comment.
where is the code to change this to actual server IP when deployed on server? Or will we manually do it?
There was a problem hiding this comment.
we manually do it, unless we find a way to do it better in the future
There was a problem hiding this comment.
Henry and I found a better solution about this, you can check this class again.
| MatGridListModule, | ||
| MatIconModule, | ||
| MatInputModule, | ||
| MatListModule, |
There was a problem hiding this comment.
This file includes many custom imports which will be included in app module. Is it possible to write a broad description at the beginning of the file about what these imports are used for?
| // Accordion ////////////////////////////////////////////////// | ||
|
|
||
| interface AccordionOptions extends AccordionEvents { | ||
| active?: any; // boolean or number |
There was a problem hiding this comment.
I thought we weren't using JQuery.
Again a short description about why this file is needed will be helpful.
There was a problem hiding this comment.
jquery ui is used for drag and drop later. and jquery is used by jointjs. We avoid using jquery in our own code. but when it comes to jointjs, we have to use it. Later when we introduce the drag and drop stuff, there will be description
We have to include this jquery ui type declaration file separately to let it work.
avinash0161
left a comment
There was a problem hiding this comment.
Considering this is the first PR with entire framework, it contained many files which is fine. I hope next PRs have fewer files.
I have given some comments. Please take a look.
|
@avinash0161 please do a second round of review according to my replies and new changes. |

This is the first PR of the integration of the new gui implementation. This PR creates a new Angular project generated using the latest Angular cli, adds important dependencies that will be used in the project, and creates the dummy components using CSS grid layout.
To run the new GUI:
Install NPM: https://www.npmjs.com/get-npm
Install Angular CLI: https://github.com/angular/angular-cli
cd new-gui, thennpm install, thenng serve. Openlocalhost:4200and you can see the UINew GUI General Structure
The frontend project is organized as this file structure:
Current Components:
Currently the UI consists of 5 sub-components:
navigation component: the navigation header
operator panel component: the operator sidebar on the left
property editor component: the property editor sidebar on the right
result panel component: the table to show the results in the bottom
workflow editor: the main editor to drag and drop a workflow plan in the middle
Each components has 4 files (generated automatically by Angular CLI):
for example:
xxx.component.html: this is the HTML template that each component uses to display the Viewxxx.component.scss: this is thescss(better CSS) file to control the stylexxx.component.ts: the maintypescript(better Javascript) file corresponds to a component. This file contains a class that controls the logic and data of each componentxxx.component.spec.ts: this is the test typescript file automatically generated by Angular CLI.Component Layout
We use Grid Layout ( a new and most powerful layout system available in CSS). Grid layout suits the need of the project. The UI is divided into a 3 x 3 grid. Each component occupies one or more grids. For example, the navigation component occupies all 3 grids of the first row.
UI screenshot
The frontend looks like this after the PR:
Frontend Testing
This PR integrated the frontend Angular testing framework and lifecycle into our Travis Continuous Integration process. Now when Travis test the project, it will also run the frontend tests along with the backend tests. This is the screenshot of Travis successfully runs 5 initial placeholder tests:
Relevant files:
This PR contains many files that are automatically generated by Angular CLI (angular's official command line helper tool) when creating a new project. These are the specific files that we write and needs to pay special attention. All other config files can be safely ignored.