Skip to content

Commit

Permalink
fix: fixed naming, formatting and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Oct 23, 2023
1 parent 9404715 commit 4deca23
Show file tree
Hide file tree
Showing 26 changed files with 460 additions and 461 deletions.
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,43 @@ help:
.PHONY: start-backend
start-backend: ## Starts only the backend
@docker-compose up -d --build
@cd backend/;poetry run ./manage.py runserver
@cd backend/ && poetry run ./manage.py runserver

.PHONY: start-frontend-using-backend
start-frontend-using-backend: ## Start the frontend, using the API
@cd frontend/; yarn ember server --proxy=http://localhost:8000
@cd frontend/ && yarn ember server --proxy=http://localhost:8000

.PHONY: start-frontend
start-frontend: ## Start the frontend, using Mirage
@cd frontend/; yarn ember s
@cd frontend/ && yarn ember s

.PHONY: lint-backend
lint-backend: ## Lint the backend
@cd backend/; poetry run black .; poetry run isort .; poetry run flake8;
@cd backend/ && poetry run black .
@cd backend/ && poetry run flake8

.PHONY: lint-frontend
lint-frontend: ## Lint the frontend
@cd frontend/; yarn lint
@cd frontend/ && yarn lint

.PHONY: lint
lint: lint-backend lint-frontend ## Lint front- & backend

.PHONY: test-backend
test-backend: ## Test the backend
@cd backend/; poetry run pytest --no-cov-on-fail --cov
@cd backend/ && poetry run pytest --no-cov-on-fail --cov

.PHONY: test-frontend
test-frontend: ## Test the frontend
@cd frontend/; yarn test
@cd frontend/ && yarn test

.PHONY: test
test: test-backend test-frontend ## Test front- & backend

.PHONY: makemigrations
makemigrations: ## Make django migrations
@cd backend/; poetry run ./manage.py makemigrations
@cd backend/ && poetry run ./manage.py makemigrations

.PHONY: migrate
migrate: ## Migrate django
@cd backend/; poetry run ./manage.py migrate
@cd backend/ && poetry run ./manage.py migrate
4 changes: 4 additions & 0 deletions .editorconfig → frontend/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
Expand Down
55 changes: 1 addition & 54 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,5 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
},
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
extends: '@adfinis-sygroup/eslint-config/ember-app',
};
44 changes: 22 additions & 22 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,51 @@ A short introduction of this app could easily go here.

You will need the following things properly installed on your computer.

* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org/)
* [Yarn](https://yarnpkg.com/)
* [Ember CLI](https://cli.emberjs.com/release/)
* [Google Chrome](https://google.com/chrome/)
- [Git](https://git-scm.com/)
- [Node.js](https://nodejs.org/)
- [Yarn](https://yarnpkg.com/)
- [Ember CLI](https://cli.emberjs.com/release/)
- [Google Chrome](https://google.com/chrome/)

## Installation

* `git clone <repository-url>` this repository
* `cd outdated`
* `yarn install`
- `git clone <repository-url>` this repository
- `cd outdated`
- `yarn install`

## Running / Development

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
- `ember serve`
- Visit your app at [http://localhost:4200](http://localhost:4200).
- Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).

### Code Generators

Make use of the many generators for code, try `ember help generate` for more details

### Running Tests

* `ember test`
* `ember test --server`
- `ember test`
- `ember test --server`

### Linting

* `yarn lint`
* `yarn lint:fix`
- `yarn lint`
- `yarn lint:fix`

### Building

* `ember build` (development)
* `ember build --environment production` (production)
- `ember build` (development)
- `ember build --environment production` (production)

### Deploying

Specify what it takes to deploy your app.

## Further Reading / Useful Links

* [ember.js](https://emberjs.com/)
* [ember-cli](https://cli.emberjs.com/release/)
* Development Browser Extensions
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
- [ember.js](https://emberjs.com/)
- [ember-cli](https://cli.emberjs.com/release/)
- Development Browser Extensions
- [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
- [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
2 changes: 1 addition & 1 deletion frontend/app/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';
import config from 'outdated/config/environment';

export default class App extends Application {
Expand Down
22 changes: 14 additions & 8 deletions frontend/app/components/dependency-detailed/template.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<tr data-test-version-status class='text-{{@version.status}}'><td
data-test-version-dependency-name
>{{@version.dependency.name}}</td><td
data-test-version-version
>{{@version.version}}</td><td data-test-version-eol-date>
{{format-date @version.eolDate}}</td><td
data-test-version-release-date
>{{format-date @version.releaseDate}}</td></tr>
<tr data-test-version-status class='text-{{@version.status}}'>
<td data-test-version-dependency-name>
{{@version.dependency.name}}
</td>
<td data-test-version-version>
{{@version.version}}
</td>
<td data-test-version-eol-date>
{{format-date @version.eolDate}}
</td>
<td data-test-version-release-date>
{{format-date @version.releaseDate}}
</td>
</tr>
4 changes: 2 additions & 2 deletions frontend/app/components/project-compact/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from '@glimmer/component';

export default class ProjectCompactComponent extends Component {
get icon() {
let { project } = this.args;
const { project } = this.args;
const stateIconDict = {
OUTDATED: 'bolt',
WARNING: 'warning',
Expand All @@ -12,7 +12,7 @@ export default class ProjectCompactComponent extends Component {
return stateIconDict[project.status];
}
get version() {
let { project } = this.args;
const { project } = this.args;
return project.dependencyVersions.toArray()[0];
}
}
9 changes: 4 additions & 5 deletions frontend/app/components/project-compact/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
data-test-project-link='{{@project.id}}'
@model={{@project}}
>
<h3
data-test-project-name
class='title-compact'
>{{@project.name}}</h3></LinkTo>
<h3 data-test-project-name class='title-compact'>
{{@project.name}}
</h3>
</LinkTo>

<card.body data-test-project-status class='text-{{@project.status}}'>

<UkIcon @icon='{{this.icon}}' @ratio={{4}} />

<DependencyCompact @version={{this.version}} />

</card.body>
Expand Down
22 changes: 13 additions & 9 deletions frontend/app/components/project-detailed/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@
<div class='detailed-header'>

<h1 data-test-project-name>

{{@project.name}}

</h1>

<a href='{{@project.repo}}' target='blank_' data-test-repo-link><UkIcon
@icon='github'
@ratio={{3}}
/></a>
<a href='{{@project.repo}}' target='blank_' data-test-repo-link>
<UkIcon @icon='github' @ratio={{3}} />
</a>

</div>

<p class='seperator'></p>
{{#if @project.dependencyVersions}}
<table>
<thead><tr><th>Dependency</th><th>Version</th><th>End Of Life Date</th><th
>Release Date</th></tr></thead>
<thead>
<tr>
<th>Dependency</th>
<th>Version</th>
<th>End Of Life Date</th>
<th>Release Date</th>
</tr>
</thead>

<tbody>
{{#each
Expand All @@ -33,7 +36,8 @@
</table>
{{else}}
<div class='none-yet' data-test-dependency-versions-none>
<span class='text-UNDEFINED'>No dependencies yet</span></div>
<span class='text-UNDEFINED'>No dependencies yet</span>
</div>
{{/if}}

</div>
20 changes: 12 additions & 8 deletions frontend/app/components/top-nav/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@
<nav class='navbar-container' uk-navbar>
<div class='uk-navbar-left'>
<LinkTo @route='projects' class='uk-navbar-item uk-logo'>
Outdated</LinkTo>
Outdated
</LinkTo>
</div>
<div class='uk-navbar-right'>
<ul class='uk-navbar-nav uk-navbar-left'>
<div class='button-nav'>
<li>

<LinkTo @route='projects'><UkButton
@size='large'
>Overview</UkButton></LinkTo>
<LinkTo @route='projects'>
<UkButton @size='large'>
Overview
</UkButton>
</LinkTo>
</li>

<li>
<LinkTo @route='manage'><UkButton
@size='large'
>Manage</UkButton></LinkTo>
</li></div>
<LinkTo @route='manage'>
<UkButton @size='large'>Manage</UkButton>
</LinkTo>
</li>
</div>
</ul>
</div>
</nav>
Expand Down
1 change: 1 addition & 0 deletions frontend/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default class Router extends EmberRouter {
rootURL = config.rootURL;
}

// eslint-disable-next-line array-callback-return
Router.map(function () {
this.route('projects', { path: '/' }, function () {
this.route('project-detailed', { path: 'projects/:id' });
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/routes/projects/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Route from '@ember/routing/route';
import { service } from '@ember/service';

export default class ProjectsProjectsRoute extends Route {
export default class ProjectsRoute extends Route {
@service store;
model() {
return this.store.findAll('project', {
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/routes/projects/project-detailed.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Route from '@ember/routing/route';
import { service } from '@ember/service';
export default class ProjectsProjectDetailedRoute extends Route {
export default class ProjectDetailedRoute extends Route {
@service store;
model(params) {
return this.store.findRecord('project', params.id, {
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/dependency-version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Factory, trait } from 'miragejs';
import { faker } from '@faker-js/faker';
import { DateTime } from 'luxon';
import { Factory, trait } from 'miragejs';

export default Factory.extend({
version: () => faker.system.semver(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/mirage/factories/dependency.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Factory, hasMany } from 'miragejs';
import { faker } from '@faker-js/faker';
import { Factory, hasMany } from 'miragejs';
export default Factory.extend({
name: () =>
faker.helpers.arrayElement([
Expand Down
Loading

0 comments on commit 4deca23

Please sign in to comment.