-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
2,100 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,107 @@ | ||
"use-strict"; | ||
|
||
module.exports = { | ||
extends: ["@adfinis/eslint-config/ember-app"], | ||
root: true, | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
}, | ||
plugins: ["ember", "@typescript-eslint", "import"], | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:ember/recommended", | ||
"plugin:prettier/recommended", | ||
], | ||
env: { | ||
browser: true, | ||
}, | ||
rules: { | ||
"ember/no-actions-hash": "warn", | ||
"ember/no-component-lifecycle-hooks": "warn", | ||
"ember/no-mixins": "warn", | ||
"ember/no-new-mixins": "warn", | ||
"ember/no-classic-classes": "warn", | ||
"ember/no-classic-components": "warn", | ||
"ember/no-get": "warn", | ||
"ember/no-observers": "warn", | ||
"qunit/no-assert-equal": "warn", | ||
"ember/require-tagless-components": "warn", | ||
// possible errors | ||
"no-await-in-loop": "error", | ||
|
||
// best practices | ||
"array-callback-return": "error", | ||
"dot-notation": "error", | ||
eqeqeq: "error", | ||
"no-alert": "error", | ||
"no-else-return": "error", | ||
"no-eval": "error", | ||
"no-extend-native": "error", | ||
"no-extra-bind": "error", | ||
"no-floating-decimal": "error", | ||
"one-var": ["error", "never"], | ||
curly: ["error", "multi-line"], | ||
|
||
// ES6 | ||
"no-var": "error", | ||
"object-shorthand": "error", | ||
"prefer-const": "error", | ||
"prefer-destructuring": [ | ||
"error", | ||
{ AssignmentExpression: { array: false, object: false } }, | ||
], | ||
"prefer-rest-params": "error", | ||
"prefer-spread": "error", | ||
"prefer-template": "error", | ||
|
||
// import | ||
"import/no-duplicates": "error", | ||
"import/no-unresolved": "off", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"newlines-between": "always", | ||
alphabetize: { order: "asc", caseInsensitive: true }, | ||
}, | ||
], | ||
|
||
// tooling | ||
"no-console": ["error", { allow: ["warn", "error"] }], | ||
"no-debugger": "error", | ||
}, | ||
overrides: [ | ||
// js files | ||
{ | ||
files: ["**/*.js"], | ||
extends: [ | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
], | ||
rules: {}, | ||
}, | ||
// ts files | ||
{ | ||
files: ["**/*.ts"], | ||
extends: [ | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
], | ||
rules: {}, | ||
}, | ||
// node files | ||
{ | ||
files: [ | ||
"./.eslintrc.js", | ||
"./.prettierrc.js", | ||
"./.stylelintrc.js", | ||
"./.template-lintrc.js", | ||
"./ember-cli-build.js", | ||
"./testem.js", | ||
"./blueprints/*/index.js", | ||
"./config/**/*.js", | ||
"./lib/*/index.js", | ||
"./server/**/*.js", | ||
], | ||
env: { | ||
browser: false, | ||
node: true, | ||
}, | ||
extends: ["plugin:n/recommended"], | ||
}, | ||
{ | ||
// test files | ||
files: ["tests/**/*-test.{js,ts}"], | ||
extends: ["plugin:qunit/recommended"], | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Type declarations for | ||
* import config from 'my-app/config/environment' | ||
*/ | ||
declare const config: { | ||
environment: string; | ||
modulePrefix: string; | ||
podModulePrefix: string; | ||
locationType: "history" | "hash" | "none" | "auto"; | ||
rootURL: string; | ||
APP: Record<string, unknown>; | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Model, { attr, belongsTo, hasMany } from "@ember-data/model"; | ||
|
||
export default class AbsenceBalance extends Model { | ||
@attr("number") | ||
declare credit: number; | ||
|
||
@attr("number") | ||
declare usedDays: number; | ||
|
||
@attr("django-duration") usedDuration; | ||
@attr("number") balance; | ||
@belongsTo("user", { async: false, inverse: "absenceBalances" }) user; | ||
@belongsTo("absence-type", { async: false, inverse: "absenceBalances" }) | ||
absenceType; | ||
@hasMany("absence-credit", { async: true, inverse: null }) absenceCredits; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* @module timed | ||
* @submodule timed-models | ||
* @public | ||
*/ | ||
import Model, { attr, belongsTo } from "@ember-data/model"; | ||
|
||
/** | ||
* The absence credit model | ||
* | ||
* @class AbsenceCredit | ||
* @extends DS.Model | ||
* @public | ||
*/ | ||
export default class AbsenceCredit extends Model { | ||
/** | ||
* The days | ||
* | ||
* @property {Number} days | ||
* @public | ||
*/ | ||
@attr("number") days; | ||
|
||
/** | ||
* The date | ||
* | ||
* @property {moment} date | ||
* @public | ||
*/ | ||
@attr("django-date") date; | ||
|
||
/** | ||
* The comment | ||
* | ||
* @property {String} comment | ||
* @public | ||
*/ | ||
@attr("string", { defaultValue: "" }) comment; | ||
|
||
/** | ||
* The absence type for which this credit counts | ||
* | ||
* @property {AbsenceType} absenceType | ||
* @public | ||
*/ | ||
@belongsTo("absence-type", { async: false, inverse: null }) absenceType; | ||
|
||
/** | ||
* The user to which this credit belongs to | ||
* | ||
* @property {User} user | ||
* @public | ||
*/ | ||
@belongsTo("user", { async: false, inverse: null }) user; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* @module timed | ||
* @submodule timed-models | ||
* @public | ||
*/ | ||
import Model, { attr, hasMany } from "@ember-data/model"; | ||
|
||
/** | ||
* The absence type model | ||
* | ||
* @class AbsenceType | ||
* @extends DS.Model | ||
* @public | ||
*/ | ||
export default class AbsenceType extends Model { | ||
/** | ||
* The name of the absence type | ||
* | ||
* E.g Military, Holiday or Sickness | ||
* | ||
* @property {String} name | ||
* @public | ||
*/ | ||
@attr("string") name; | ||
|
||
/** | ||
* Whether the absence type only fills the worktime | ||
* | ||
* @property {Boolean} fillWorktime | ||
* @public | ||
*/ | ||
@attr("boolean") fillWorktime; | ||
|
||
/** | ||
* The balances for this type | ||
* | ||
* @property {AbsenceBalance[]} absenceBalances | ||
* @public | ||
*/ | ||
@hasMany("absence-balance", { async: true, inverse: "absenceType" }) | ||
absenceBalances; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* @module timed | ||
* @submodule timed-models | ||
* @public | ||
*/ | ||
import Model, { attr, belongsTo } from "@ember-data/model"; | ||
import moment from "moment"; | ||
|
||
/** | ||
* The report model | ||
* | ||
* @class Report | ||
* @extends DS.Model | ||
* @public | ||
*/ | ||
export default class Absence extends Model { | ||
/** | ||
* The comment | ||
* | ||
* @property {String} comment | ||
* @public | ||
*/ | ||
@attr("string", { defaultValue: "" }) comment; | ||
|
||
/** | ||
* The duration | ||
* | ||
* @property {moment.duration} duration | ||
* @public | ||
*/ | ||
@attr("django-duration", { defaultValue: () => moment.duration() }) duration; | ||
|
||
/** | ||
* The date | ||
* | ||
* @property {moment} date | ||
* @public | ||
*/ | ||
@attr("django-date") date; | ||
|
||
/** | ||
* The type of the absence | ||
* | ||
* @property {AbsenceType} absenceType | ||
* @public | ||
*/ | ||
@belongsTo("absence-type", { async: false, inverse: null }) absenceType; | ||
|
||
/** | ||
* The user | ||
* | ||
* @property {User} user | ||
* @public | ||
*/ | ||
@belongsTo("user", { async: true, inverse: null }) user; | ||
} |
Oops, something went wrong.