Skip to content
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

feat: rewrite of the Ember frontend #143

Merged
merged 15 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "customer-center-backend",
"description": "Adfinis AG Customer Center - Backend",
"description": "Adfinis customer support portal with LDAP and Timed integration.",
"version": "1.1.0",
"private": true,
"author": {
Expand All @@ -9,8 +9,9 @@
"url": "https://adfinis.com/"
},
"maintainers": [
"Florian Mäder <[email protected]>",
"Akanksh Saxena <[email protected]>",
"Florian Mäder <florian.maeder@adfinis.com>"
"Jonas Cosandey <jonas.cosandey@adfinis.com>"
],
"scripts": {
"start": "babel-node app/start.js",
Expand Down
4 changes: 0 additions & 4 deletions frontend/.bowerrc

This file was deleted.

14 changes: 14 additions & 0 deletions frontend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EditorConfig.org

root = true

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

[*.{diff,md}]
trim_trailing_whitespace = false
21 changes: 20 additions & 1 deletion frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/blueprints/*/files/**/*.js
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
45 changes: 9 additions & 36 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,12 @@
"use strict";

module.exports = {
globals: {
server: true
},
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
parser: 'babel-eslint',
env: {
browser: true
},
plugins: ['ember', 'prettier'],
extends: ['eslint:recommended', 'plugin:ember/recommended', 'prettier'],
extends: "@adfinis-sygroup/eslint-config/ember-app",

rules: {
'prettier/prettier': 'error'
"no-unused-vars": "off",
"prefer-rest-params": "off",
"ember/use-brace-expansion": "off",
"ember/no-get": "off",
},
overrides: [
// node files
{
files: [
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
}
};
24 changes: 13 additions & 11 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/dist/
/tmp/

# dependencies
/node_modules
/bower_components
/bower_components/
/node_modules/

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

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
4 changes: 0 additions & 4 deletions frontend/.prettierrc

This file was deleted.

10 changes: 10 additions & 0 deletions frontend/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use strict";

module.exports = {
extends: "octane",

rules: {
"no-bare-strings": true,
"block-indentation": true,
},
};
28 changes: 28 additions & 0 deletions frontend/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
velrest marked this conversation as resolved.
Show resolved Hide resolved
language: node_js
node_js:
- "10"

dist: xenial

addons:
chrome: stable

cache:
yarn: true

env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1

branches:
only:
- master

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

script:
- yarn test
2 changes: 1 addition & 1 deletion frontend/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignore_dirs": ["tmp", "dist", "node_modules"]
"ignore_dirs": ["node_modules", "tmp", "dist", "build"]
}
47 changes: 47 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# customer-center

Rewrite of the never release Adfinis customer center.
velrest marked this conversation as resolved.
Show resolved Hide resolved

## Prerequisites

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://ember-cli.com/)
* [Google Chrome](https://google.com/chrome/)

## 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).

### Code Generators

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

### Running Tests

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

### Linting

* `yarn lint:hbs`
* `yarn lint:js`
* `yarn lint:js --fix`

### Building

* `ember build` (development)
* `yarn build` (production)

## Further Reading / Useful Links

* [ember.js](https://emberjs.com/)
* [ember-cli](https://ember-cli.com/)
* 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/)
27 changes: 16 additions & 11 deletions frontend/app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import DS from 'ember-data'
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin'

export default DS.JSONAPIAdapter.extend(DataAdapterMixin, {
authorize(xhr) {
if (this.get('session.data.authenticated.data.token')) {
xhr.setRequestHeader(
'X-Authorization',
this.get('session.data.authenticated.data.token')
)
import JSONAPIAdapter from "@ember-data/adapter/json-api";
import { computed } from "@ember/object";
import { inject as service } from "@ember/service";

export default class ApplicationAdapter extends JSONAPIAdapter {
@service session;

@computed("session.data.authenticated.token", "session.isAuthenticated")
get headers() {
const headers = {};

if (this.session.isAuthenticated) {
headers["X-Authorization"] = this.session.data.authenticated.token;
}

return headers;
}
})
}
7 changes: 7 additions & 0 deletions frontend/app/adapters/billing-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ApplicationAdapter from "./application";

export default class TimedBillingTypeAdapter extends ApplicationAdapter {
namespace = "/api/proxy/timed";

pathForType = () => "billing-types";
}
7 changes: 7 additions & 0 deletions frontend/app/adapters/customer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ApplicationAdapter from "./application";

export default class TimedCustomerAdapter extends ApplicationAdapter {
namespace = "/api/proxy/timed";

pathForType = () => "customers";
}
7 changes: 7 additions & 0 deletions frontend/app/adapters/report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ApplicationAdapter from "./application";

export default class TimedReportAdapter extends ApplicationAdapter {
namespace = "/api/proxy/timed";

pathForType = () => "reports";
}
7 changes: 7 additions & 0 deletions frontend/app/adapters/subscription-order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ApplicationAdapter from "./application";

export default class TimedSubscriptionOrderAdapter extends ApplicationAdapter {
namespace = "/api/proxy/timed";

pathForType = () => "subscription-orders";
}
7 changes: 7 additions & 0 deletions frontend/app/adapters/subscription-package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ApplicationAdapter from "./application";

export default class TimedSubscriptionPackageAdapter extends ApplicationAdapter {
namespace = "/api/proxy/timed";

pathForType = () => "subscription-packages";
}
7 changes: 7 additions & 0 deletions frontend/app/adapters/subscription-project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ApplicationAdapter from "./application";

export default class TimedSubscriptionProjectAdapter extends ApplicationAdapter {
namespace = "/api/proxy/timed";

pathForType = () => "subscription-projects";
}
5 changes: 0 additions & 5 deletions frontend/app/adapters/timed-billing-type.js

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/app/adapters/timed-customer.js

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/app/adapters/timed-report.js

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/app/adapters/timed-subscription-order.js

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/app/adapters/timed-subscription-package.js

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/app/adapters/timed-subscription-project.js

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/app/adapters/timed-user.js

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/app/adapters/timed.js

This file was deleted.

7 changes: 7 additions & 0 deletions frontend/app/adapters/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ApplicationAdapter from "./application";

export default class TimedUserAdapter extends ApplicationAdapter {
namespace = "/api/proxy/timed";

pathForType = () => "users";
}
Loading