Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1e40d3a
feature/errors -> creating errors component to use when service retur…
guilhermewm Feb 15, 2020
34ea852
feature/loader -> creating loader component to use when requests are …
guilhermewm Feb 15, 2020
b9d84c2
feature/search -> creating search component to do the control of inpu…
guilhermewm Feb 15, 2020
02c4aaf
feature/services -> creating service file to do the requests to the o…
guilhermewm Feb 15, 2020
43fc551
feature/custom-header -> creating custom header
guilhermewm Feb 15, 2020
78adeea
feature/model -> creating models of movies and movies service return
guilhermewm Feb 15, 2020
f95aa43
feature/movie -> creating movie card component to use on movies-list
guilhermewm Feb 15, 2020
3707365
feature/movies-list -> creating movies list component to list movies …
guilhermewm Feb 15, 2020
a930334
feature/home -> creating app home first version
guilhermewm Feb 15, 2020
bcf7211
feature/variables -> creating variables, using styleguide. Adding som…
guilhermewm Feb 15, 2020
c87a77e
feature/logo -> adding app logo
guilhermewm Feb 15, 2020
b91925a
feature/image-not-found -> adding image to use on movies that dont ha…
guilhermewm Feb 15, 2020
5c0b3d2
feature/button -> creating first version of app buttons
guilhermewm Feb 15, 2020
6365a5a
updating/general -> adding new modules, providers and components to a…
guilhermewm Feb 15, 2020
a395bf2
updating/styles -> adding base body styles
guilhermewm Feb 15, 2020
f5ef009
feature/not-found -> adding not found page
guilhermewm Feb 16, 2020
db45f54
update/routes -> adding new routes
guilhermewm Feb 16, 2020
4ee9b68
update/search -> removing icon and change variables import
guilhermewm Feb 16, 2020
15eaa2e
update/movie -> removing some functions
guilhermewm Feb 17, 2020
94dff15
update/movies-list -> removing some logics and functions
guilhermewm Feb 17, 2020
87307bc
update/services -> adding some services tests
guilhermewm Feb 17, 2020
d3d2c52
update/model -> adding some new movies attributes
guilhermewm Feb 17, 2020
9c02051
feature/README -> adding readme
guilhermewm Feb 17, 2020
07e0a77
update/home -> new home version, adding movies logics
guilhermewm Feb 17, 2020
8f78425
geature/movie-detail -> creating new component to use as movie detail…
guilhermewm Feb 17, 2020
ac2f9a5
feature/styles -> creating folder to centralize all variables and glo…
guilhermewm Feb 17, 2020
432d090
update/general -> corrections of some tests and delection of files
guilhermewm Feb 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions code/omdb/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions code/omdb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
40 changes: 40 additions & 0 deletions code/omdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frontend-test OMDB

## Informações do projeto

### Desafio criado utilizando [Angular CLI](https://github.com/angular/angular-cli) version 9.0.2.

## Pré-requisitos

### Instale o NodeJS acima da versão v10.0 atráves deste [link](https://nodejs.org/en/download/).

### Após ter instalado o NodeJS

### Instale o Angular:
```
npm install -g @angular/cli
```

## Rodando o projeto

### Instale as dependências dentro da pasta root do projeto:
```
npm install
```

### Rode o projeto executando:
```
ng serve --open
```

## Rodando os testes

### Rode os testes executando:
```
ng test
```

### Caso queira ver a cobertuda do código, rode:
```
ng test --code-coverage
```
129 changes: 129 additions & 0 deletions code/omdb/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"omdb": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/omdb",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss",
"./node_modules/font-awesome/css/font-awesome.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "omdb:build"
},
"configurations": {
"production": {
"browserTarget": "omdb:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "omdb:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "omdb:serve"
},
"configurations": {
"production": {
"devServerTarget": "omdb:serve:production"
}
}
}
}
}},
"defaultProject": "omdb"
}
12 changes: 12 additions & 0 deletions code/omdb/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
32 changes: 32 additions & 0 deletions code/omdb/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
23 changes: 23 additions & 0 deletions code/omdb/e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';

describe('workspace-project App', () => {
let page: AppPage;

beforeEach(() => {
page = new AppPage();
});

it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('omdb app is running!');
});

afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
11 changes: 11 additions & 0 deletions code/omdb/e2e/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
}

getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}
13 changes: 13 additions & 0 deletions code/omdb/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
32 changes: 32 additions & 0 deletions code/omdb/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/omdb'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
Loading