Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
chore: upgrade to ember 4.4 (#1044)
Browse files Browse the repository at this point in the history
* refactor(filter-sidebar): to glimmer syntax

* refactor(date-buttons): to glimmer syntax

* refactor(models): use native js classes in (#921)

* fix: use native js class in absance balance model

* fix: use native js class in absence credit model

* fix: use native js class in absence type model

* fix: use native js class in absence model

* fix: use native js class in attendance model

* fix: use native js class in billing type model

* fix: use native js class in cost center model

* fix: use native js class in customer assignee model

* fix: use native js class in customer model

* fix: use native js class in employment model

* fix: use native js class in location model

* fix: use native js class in month statistic model

* fix: use native js class in project assignee model

* fix: use native js class in public holiday model

* fix: use native js class in report intersection model

* fix: use native js class in task assingee model

* fix: use native js class in user statisitic model

* fix: use native js class in user model

* fix: use native js class in worktime balance model

* fix: use native js class in year statistic model

* refactor(loading-icon): to glimmer syntax

* refactor(duratio-since): to glimmer syntax

* refactor: adapt CSS path for file name compatibility

* refactor(filter-sidebar-label): to glimmer syntax (#929)

* fix: refactor not identical warning to glimmer component

* fix: refactor component  test of not identical warnings

* refactor(paginated-table): to glimmer syntax (#932)

* refactor(no-permission): to glimmer syntax (#930)

* fix: add glimming to the checked boxes in analysis & timesheet (#919)

* fix: add glimming to the checked boxes in analysis & timesheet

* fix(sy-checkmark): change highlight class name with it tests

* refactor: users edit credit route (#908)

* refactor: users edit credit route

* fix: use new component syntax in the template

* refactor: user edit overtime credits, and absance credits

* fix: fetching the correct data when transfering

* chore: add editors files to git ignore

* refactor(balance-donut): to glimmer sytax

* fix(balance-donut): style

* refactor(report-review-warning): to glimmer syntax

* refactor(weekly-overview): to glimmer syntax

* refactor(weekly-overview-benchmark): to glimmer syntax

* fix: weekly overview benchmark tests

* refactor(weekly-overview-day): to glimmer syntax

* fix(weekly-overview-day): use unless instead of if

* fix: `@holiday` argument name in weekly overview day template

* refactor: moment transforms classes

* refactor(worktime-balance-chart): mitigate deprecations of EmberObject.extend

* feat: login page (#915)

* feat: login page

* fix: use link-to component for routing

* fix: after logout uri in environment file

* fix: centering the clock in login page

* style(login-page): add a little margin to h1 element

* refactor(timed-clock): glimmerify component and increase clock size in login page

---------

Co-authored-by: Falk <[email protected]>

* refactor(activity-model): use modern class syntax

* refactor(task-model): use modern class syntax

* chore(progress-bar): delete unused component

* chore(paginated-table): delete unused component with it exclusive packages

* fix: implication injections in deprecation workflow

* chore: clean unused code in deprecation workflow

* refactor(reports-ability): use getter instead of local state

* refactor: replace ember-site-tour > ember-shepherd

* test(tour): adapt to new tour service

* refactor: untangle tour service implementation

* test(tour): cover all tour steps

* fix(lint): tour steps

* refactor(activities): use native class for route

* fix(protected): restore code coverage

* fix: deprecation workflows (#1024)

* fix: remove the fixed deprecations

* refactor(ember-can): usage to fix the deprecation

* refactor(user-model): to fix the deprecation

* refactor(meber-cli-mirage): to fix the deprecation

* chore: remove ember parachute (#1018)

* chore: remove ember parachute from timed fronend

* chore: create unit functions of query parameters `queryParamsState`, `resetQueryParams`

* fix: js linting to use strictEqual

* fix: cleaning the code

* refactor(statistic): template to use `setModelFilter` instate of using custom setter for dates

* refactor(analytics): controller to use utils function `queryParamsState` instate of class function

* refactor(analytics): router to use utils `resetQueryFunction`

* refactor(analysis): move `queryParamsState` to utils function

* refactor(analysis-edit): tests to be compatible with the new changes

* refactor(statistic): controller to use `queryParamsState`, `resetQueryParams` in utils function

* fix: clean not needed comment

* fix: import order after rebase

* chore: ember 4.4 upgrade (#1067)

* chore: upgrade to ember 4.4

BREAKING CHANGE: Requires node >= 16.

* chore: remove custom unique-id helper

It's included now in ember by default.

* chore(deps): use optional features package for jquery

* use optional-features package
* remove route-action-helper addon

* fix: replace ember-scrollable with simplebar

* fix(index-reports-route): add missing notification service

* fix(ember-cli-nouislider): prevent global usage of Logger

The logger was exported of the global Ember object which is
no longer available as of ember v4. Therefor we may use the
forked version of the addon. Replace addon completely in the
near future or upgrade original repository.

* refactor(unverfified-reports): prevent global ember object usage

* refactor(worktime-balance-chart): to glimmer component

* fix(page-ability): safe property access

* refactor(worktime-balance-chart): adapt integration test

* fix(user-edit-credits): do not assert default query params

---------

Co-authored-by: Mitan Omar <[email protected]>
  • Loading branch information
derrabauke and MitanOmar authored Sep 28, 2023
1 parent cbc2f1a commit 4ab1005
Show file tree
Hide file tree
Showing 187 changed files with 2,457 additions and 3,200 deletions.
13 changes: 12 additions & 1 deletion .ember-cli
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": true,
"usePods": true

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try

# template lint ci config
.template-lintrc-ci.js
19 changes: 14 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@ testem.log
*.swp
*.orig

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try

# vscode
jsconfig.json

/.vscode/
/.idea/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
25 changes: 25 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache
.lint-todo/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ You will need the following things properly installed on your computer.

- [Git](https://git-scm.com/)
- [Node.js](https://nodejs.org/)
- [pnpm](https://pnpm.io/)
- [Ember CLI](https://ember-cli.com/)
- [Chrome](https://www.google.com/chrome/)
- [Yarn](https://yarnpkg.com/)
- [Ember CLI](https://cli.emberjs.com/release/)
- [Google Chrome](https://google.com/chrome/)
- [Firefox](https://www.mozilla.org/firefox/)

Optional:
Expand Down
19 changes: 13 additions & 6 deletions app/abilities/absence-credit.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { reads } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { Ability } from "ember-can";

const AbsenceCreditAbility = Ability.extend({
canEdit: reads("user.isSuperuser"),
canCreate: reads("user.isSuperuser"),
});
export default class AbsenceCreditAbility extends Ability {
@service session;

export default AbsenceCreditAbility;
get user() {
return this.session.data.user;
}
get canEdit() {
return this.user.isSuperuser;
}
get canCreate() {
return this.user.isSuperuser;
}
}
19 changes: 13 additions & 6 deletions app/abilities/overtime-credit.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { reads } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { Ability } from "ember-can";

const OvertimeCreditAbility = Ability.extend({
canEdit: reads("user.isSuperuser"),
canCreate: reads("user.isSuperuser"),
});
export default class OvertimeCreditAbility extends Ability {
@service session;

export default OvertimeCreditAbility;
get user() {
return this.session.data.user;
}
get canEdit() {
return this.user.isSuperuser;
}
get canCreate() {
return this.user.isSuperuser;
}
}
30 changes: 16 additions & 14 deletions app/abilities/page.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { computed } from "@ember/object";
import { inject as service } from "@ember/service";
import { Ability } from "ember-can";

export default Ability.extend({
canAccess: computed(
"user.{activeEmployment.isExternal,isReviewer}",
function () {
if (!this.user) {
return false;
}
return (
!this.user.activeEmployment.isExternal ||
(this.user.activeEmployment.isExternal && this.user.isReviewer)
);
export default class PageAbility extends Ability {
@service session;

get user() {
return this.session.data.user;
}
get canAccess() {
if (!this.user) {
return false;
}
),
});
return (
!this.user.activeEmployment?.isExternal ||
(this.user.activeEmployment?.isExternal && this.user.isReviewer)
);
}
}
57 changes: 28 additions & 29 deletions app/abilities/report.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import { computed } from "@ember/object";
import { inject as service } from "@ember/service";
import { Ability } from "ember-can";

export default Ability.extend({
canEdit: computed(
// eslint-disable-next-line ember/use-brace-expansion
"model.user.{id,supervisors}",
"model.verifiedBy.id",
"model.{billed,customerAssignees,projectAssignees,taskAssignees}",
"user.{id,isSuperuser}",
function () {
const isEditable =
this.user?.isSuperuser ||
(!this.model?.verifiedBy?.get("id") &&
export default class ReportAbility extends Ability {
@service session;

get user() {
return this.session.data.user;
}

get canEdit() {
const isEditable =
this.user?.isSuperuser ||
(!this.model?.verifiedBy?.get("id") &&
// eslint-disable-next-line ember/no-get
(this.model?.user?.get("id") === this.user?.get("id") ||
// eslint-disable-next-line ember/no-get
(this.model?.user?.get("id") === this.user?.get("id") ||
// eslint-disable-next-line ember/no-get
(this.model?.user?.get("supervisors") ?? [])
.mapBy("id")
.includes(this.user?.get("id"))));
const isReviewer =
(this.model?.taskAssignees ?? [])
.concat(
this.model?.projectAssignees ?? [],
this.model?.customerAssignees ?? []
)
.mapBy("user.id")
.includes(this.user?.get("id")) && !this.model?.verifiedBy?.get("id");
return isEditable || isReviewer;
}
),
});
(this.model?.user?.get("supervisors") ?? [])
.mapBy("id")
.includes(this.user?.get("id"))));
const isReviewer =
(this.model?.taskAssignees ?? [])
.concat(
this.model?.projectAssignees ?? [],
this.model?.customerAssignees ?? []
)
.mapBy("user.id")
.includes(this.user?.get("id")) && !this.model?.verifiedBy?.get("id");
return isEditable || isReviewer;
}
}
30 changes: 16 additions & 14 deletions app/abilities/user.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { computed } from "@ember/object";
import { inject as service } from "@ember/service";
import { Ability } from "ember-can";

export default Ability.extend({
canRead: computed(
"user.{id,isSuperuser}",
"model.{id,supervisors}",
function () {
return (
this.user?.isSuperuser ||
this.user?.id === this.model.id ||
this.model.supervisors.mapBy("id").includes(this.user?.id)
);
}
),
});
export default class UserAbility extends Ability {
@service session;

get user() {
return this.session.data.user;
}

get canRead() {
return (
this.user?.isSuperuser ||
this.user?.id === this.model.id ||
this.model.supervisors.mapBy("id").includes(this.user?.id)
);
}
}
Loading

0 comments on commit 4ab1005

Please sign in to comment.