Skip to content

Commit

Permalink
hotfix/improvements (#23)
Browse files Browse the repository at this point in the history
* Told prettier and eslint to ignore the github actions, they might be causing issues

* Added vscode folder and started to fix some resolver bugs

* Reworked the single movie resolver and model

* Fixed the original language functionality

* Updated the resolvers which used the movies model and updated some of the unit tests

* Wrapped up the Movie resolver and model improvements

* Updated the utils for the Cast, Credits and SocialLinks.

* Improved the readability of all tests, reworked some of the resolvers and models

* Updated the shows model and resolvers

* Added the featuredCrew functionality

* Refactored the popular person resolver and model

* Updated setSocial link util to support the single person data

* Updated the jsdoc documentation

* Updated the object names to make them more consistent

* Added the episode count functionality, but it needs improving

* Refactored the setCast episodeCount functionality and created unit tests for the new  functionality

* Added role to the resonse for the setCredits

* Fixed an with the setCast util. When it failed it returned the incorrect data

* Made the utils compatiable with node version 12

* Updated the github actions .yml files

* Fixed a github action syntax error

* Updated the action names as they were incorrect
  • Loading branch information
AlexMachin1997 authored Nov 8, 2020
1 parent 79eda97 commit 6d8a4cd
Show file tree
Hide file tree
Showing 154 changed files with 5,001 additions and 3,192 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/linting-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
name: Application Linting

# When the to run the greeting
on: [pull_request]
on: [pull_request, push]

# Jobs to run for the action (You can have multiple actions in one file)
jobs:
run-linters:
# Job display name
name: Linting Action
name: Running the eslint checks

# Runs on a Linux based OS
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
# Installs all the project dependencies e.g. prettier, eslint etc via a custom project script
- name: Install Node.js dependencies
run: npm run all-dependencies
run: npm run allDependencies

# Run the linting action
- name: Run linters
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Job name
name: Intergration and Unit Tests
name: Integration and Unit Tests

# When the to run the greeting
on: [pull_request]
on: [pull_request, push]

# Jobs to run for the action (You can have multiple actions in one file)
jobs:
test:
# Job display name
name: Running React-Testing-Library and Jest tests
name: Running the jest tests

# Runs on a Linux based OS
runs-on: ubuntu-latest
Expand All @@ -20,7 +20,7 @@ jobs:

# Steps involved for this particular task
steps:
# Checks out the reporsitoy and enables the use of commands made avaliable in the project ie npm run
# Checks out the repository and enables the use of commands made available in the project ie npm run
- name: Check out Git repository
uses: actions/checkout@v2

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
# Installs all the project dependencies e.g. prettier, eslint etc via a custom project script
- name: Install Node.js dependencies
run: npm run all-dependencies
run: npm run allDependencies

# Run the react-testing-library tests
- name: Run all tests
Expand Down
20 changes: 20 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"VisualStudioExptTeam.vscodeintellicode",
"christian-kohler.npm-intellisense",
"letrieu.expand-region",
"formulahendry.auto-rename-tag",
"christian-kohler.path-intellisense",
"2gua.rainbow-brackets",
"PKief.material-icon-theme",
"orta.vscode-jest",
"kumar-harsh.graphql-for-vscode",
"jpoissonnier.vscode-styled-components",
"ionutvmi.path-autocomplete",
"emmanuelbeziat.vscode-great-icons",
"vincaslt.highlight-matching-tag",
"eamodio.gitlens"
]
}
67 changes: 67 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.detectIndentation": true,
"editor.fontLigatures": false,
"editor.snippetSuggestions": "top",
"editor.suggest.localityBonus": true,
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.renderWhitespace": "boundary",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.cursorSmoothCaretAnimation": true,
"editor.fontSize": 20,
"editor.minimap.enabled": false,
"editor.tabSize": 2,

"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,

"workbench.sideBar.location": "left",

"javascript.updateImportsOnFileMove.enabled": "always",

"files.autoSave": "off",
"files.exclude": {
"USE_GITIGNORE": true
},
"files.defaultLanguage": "{activeEditorLanguage}",

"javascript.validate.enable": true, // Highligts the unused imports when true
"editor.showUnused": true, // Highligts the unused imports when true

"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
"**/build": true,
"**/.build": true
},

"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],

"javascript.implicitProjectConfig.checkJs": true,

"breadcrumbs.enabled": true,
"grunt.autoDetect": "off",
"npm.runSilent": true,
"explorer.confirmDragAndDrop": true,

"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.suggestSelection": "recentlyUsedByPrefix",
"editor.suggest.showKeywords": true
},

"[json]": {
"breadcrumbs.showBooleans": true
},

"files.associations": {
"*.react.js": "javascriptreact",
"*.jsx": "javascriptreact",
"*.js": "javascriptreact"
}
}
7 changes: 7 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"checkJs": true,
"target": "es5"
},
"exclude": ["node_modules", "**/node_modules/*"]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const { gql } = require('apollo-server');

const typeDef = gql`
type CreatedBy {
type BelowsToCollection {
id: Int
credit_id: String
name: String
gender: Int
profile_path: String
backgroundUrl: String
posterUrl: String
}
`;

Expand Down
11 changes: 4 additions & 7 deletions models/Cast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ const { gql } = require('apollo-server');

const typeDef = gql`
type Cast {
cast_id: Int
character: String
credit_id: String
gender: Int
id: Int
name: String
order: Int
image: String
character: String
profileImageUrl: String
gender: String
episodeCount: Int
}
`;

Expand Down
1 change: 0 additions & 1 deletion models/Company/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const typeDef = gql`
id: Int
logo: String
name: String
origin_country: String
}
`;

Expand Down
7 changes: 1 addition & 6 deletions models/Crew/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ const { gql } = require('apollo-server');

const typeDef = gql`
type Crew {
credit_id: String
department: String
gender: Int
id: Int
job: String
name: String
profile_path: String
roles: String
}
`;

Expand Down
10 changes: 0 additions & 10 deletions models/Language/index.js

This file was deleted.

17 changes: 17 additions & 0 deletions models/Movie/Movies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { gql } = require('apollo-server');

const MoviesModel = gql`
type Movies {
id: Int
name: String
overview: String
backgroundUrl: String
posterUrl: String
genres: [Int]
releaseDate: String
originalLanguage: String
voteAverage: Float
}
`;

module.exports = MoviesModel;
33 changes: 33 additions & 0 deletions models/Movie/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const { gql } = require('apollo-server');

const MovieModel = gql`
type Movie {
id: Int
name: String
overview: String
backgroundUrl: String
posterUrl: String
genres: [Genre]
homepage: String
originalLanguage: String
productionCompanies: [Company]
releaseDate: String
voteAverage: Float
status: String
reviews: [Review]
recommendations: [Movie]
keywords: [Keyword]
social: Social
featuredCast: [Cast]
featuredCrew: [Crew]
featuredVideo: Video
belongsToCollection: BelowsToCollection
tagline: String
runtime: String
budget: String
revenue: String
}
`;

module.exports = MovieModel;
40 changes: 0 additions & 40 deletions models/Movies/Movie.js

This file was deleted.

22 changes: 0 additions & 22 deletions models/Movies/index.js

This file was deleted.

15 changes: 10 additions & 5 deletions models/People/Credits.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ const { gql } = require('apollo-server');

const typeDef = gql`
type Credits {
release_date: String
original_title: String
episode_count: String
first_air_date: String
media_type: String
year: String
credits: [Credit]
}
type Credit {
releaseDate: String
title: String
episodeCount: String
mediaType: String
role: String
}
`;

Expand Down
24 changes: 0 additions & 24 deletions models/People/KnownFor.js

This file was deleted.

Loading

0 comments on commit 6d8a4cd

Please sign in to comment.