diff --git a/backend/config-test.js b/backend/config-test.js index 756610bc..9afaf952 100644 --- a/backend/config-test.js +++ b/backend/config-test.js @@ -11,6 +11,7 @@ module.exports = { }, login: { adminRole: 'adsy-user', + employeeRole: 'adsy-user', ldap: { searchBase: 'cn=users,dc=adsy-ext,dc=becs,dc=adfinis-sygroup,dc=ch', @@ -86,7 +87,7 @@ module.exports = { timed: { type: 'timed', host: 'http://timedbackend', - user: 'sysupport_api', + user: 'timed_api', password: 'hallo123', prefix: '/api/v1', authPath: '/auth/login', diff --git a/backend/config.example.js b/backend/config.example.js index b3a63758..a912c0c4 100644 --- a/backend/config.example.js +++ b/backend/config.example.js @@ -12,6 +12,9 @@ module.exports = { cert: '/path/to/root_ca_cert.crt' }, login: { + adminRole: 'some-role', + employeeRole: 'some-other-role', + ldap: { // Further information how to configure LDAP under: // https://github.com/vesse/passport-ldapauth diff --git a/backend/src/app.js b/backend/src/app.js index 369a18e9..0c9f60af 100644 --- a/backend/src/app.js +++ b/backend/src/app.js @@ -10,7 +10,7 @@ import passwordreset from './password-reset' import services from './services' import userRoute from './user/route' import vaultTokenRenewer from './vault/vault-token' -import { timedTokenRenew } from './sysupport/token' +import { timedTokenRenew } from './timed/token' import config from './config' const app = express() diff --git a/backend/src/login/index.js b/backend/src/login/index.js index c58803e5..19220877 100644 --- a/backend/src/login/index.js +++ b/backend/src/login/index.js @@ -5,8 +5,8 @@ import passport from 'passport' import LdapStrategy from 'passport-ldapauth' import User from '../user/model' import config from '../config' -import { timedLogin } from '../sysupport/token' -import { getCustomer as getTimedCustomer } from '../sysupport/custom' +import { timedLogin } from '../timed/token' +import { getCustomer as getTimedCustomer } from '../timed/custom' passport.use( 'ldapauth-user', @@ -115,8 +115,8 @@ function loginSuccessful(req, res, next, ldapUser) { ) } - // If user is in the sysupport group, get timed token - if (isMember('sysupport')) { + // If user is in the timed group, get timed token + if (isMember('timed')) { req.session = await addTimedTokenToSession( req.session, users.get(ldapUser) @@ -146,7 +146,7 @@ async function addTimedTokenToSession(session, user) { try { session.timedToken = await timedLogin() session.timedTokenTTL = new Date().getTime() - if (!user.isAdmin()) { + if (!user.isEmployee()) { session.timedCustomer = await getTimedCustomer(session.timedToken, user) } } catch (e) { diff --git a/backend/src/services.js b/backend/src/services.js index 1d9287f1..f2fddf8e 100644 --- a/backend/src/services.js +++ b/backend/src/services.js @@ -1,7 +1,7 @@ import express from 'express' import VaultProxy from './vault/vault-proxy' import vaultCustom from './vault/vault-custom' -import SysupportProxy from './sysupport/proxy' +import TimedProxy from './timed/proxy' import gitlabProxy from './gitlab/proxy' import config from './config' @@ -12,7 +12,7 @@ const { vault, timed, gitlab } = config.services router.use('/vault', vaultCustom(vault)) router.use('/proxy/vault', VaultProxy.createProxy(vault)) -router.use('/proxy/sysupport', SysupportProxy.createProxy(timed)) +router.use('/proxy/timed', TimedProxy.createProxy(timed)) router.use('/proxy/gitlab', gitlabProxy(gitlab)) diff --git a/backend/src/sysupport/custom.js b/backend/src/timed/custom.js similarity index 100% rename from backend/src/sysupport/custom.js rename to backend/src/timed/custom.js diff --git a/backend/src/sysupport/proxy.js b/backend/src/timed/proxy.js similarity index 86% rename from backend/src/sysupport/proxy.js rename to backend/src/timed/proxy.js index 02359469..96d301d9 100644 --- a/backend/src/sysupport/proxy.js +++ b/backend/src/timed/proxy.js @@ -6,6 +6,7 @@ const routes = { path: /^\/subscription-projects(\/[1-9][0-9]*|)$/, access: { admin: ['GET'], + user: ['GET'], customer: ['GET'] } }, @@ -19,13 +20,15 @@ const routes = { path: /^\/subscription-orders$/, access: { admin: ['GET', 'DELETE', 'POST'], + user: ['GET', 'DELETE'], customer: ['GET', 'POST'] } }, subscriptionOrder: { path: /^\/subscription-orders\/[1-9][0-9]*$/, access: { - admin: ['DELETE'] + admin: ['DELETE'], + user: ['DELETE'] } }, subscriptionOrderConfirm: { @@ -38,13 +41,15 @@ const routes = { path: /^\/reports$/, access: { admin: ['GET'], + user: ['GET'], customer: ['GET'] } }, customer: { path: /^\/customers(\/[1-9][0-9]*|)$/, access: { - admin: ['GET'] + admin: ['GET'], + user: ['GET'] } } } @@ -54,10 +59,15 @@ const routes = { * @return boolean - returns true if has access **/ function checkAccess(req) { - if (!req.user.isAdmin() && typeof req.session.timedCustomer === 'undefined') { + if ( + !req.user.isEmployee() && + typeof req.session.timedCustomer === 'undefined' + ) { return false } - let access = req.user.isAdmin() ? 'admin' : 'customer' + let access = req.user.isAdmin() + ? 'admin' + : req.user.isAdsyUser() ? 'user' : 'customer' for (let route in routes) { if (req.path.match(routes[route].path)) { if (routes[route].access.hasOwnProperty(access)) { @@ -88,7 +98,7 @@ function createProxy(config) { .map(key => `${key}=${queryParams[key]}`) .join('&') - if (!req.user.isAdmin()) { + if (!req.user.isEmployee()) { newPath += `customer=${req.session.timedCustomer.id}` } if (req.path.match(routes.reports.path)) { diff --git a/backend/src/sysupport/token.js b/backend/src/timed/token.js similarity index 100% rename from backend/src/sysupport/token.js rename to backend/src/timed/token.js diff --git a/backend/src/user/model.js b/backend/src/user/model.js index 6cd9a567..aaf7fa9e 100644 --- a/backend/src/user/model.js +++ b/backend/src/user/model.js @@ -6,8 +6,7 @@ const { isArray } = Array const bookshelf = new Bookshelf(knex(config.database)) /** - * User model - * + * User model * * @class User * @public */ @@ -71,6 +70,28 @@ export default bookshelf.Model.extend( return this.getGroupNames().includes(config.login.adminRole) }, + /** + * Check if user is employee + * + * @returns {boolean} + * @public + * @author Jonas Cosandey (jonas.cosandey@adfinis-sygroup.ch) + */ + isAdsyUser() { + return this.getGroupNames().includes(config.login.employeeRole) + }, + + /** + * Is user a adsy user + * + * @returns {boolean} + * @public + * @author Jonas Cosandey (jonas.cosandey@adfinis-sygroup.ch) + */ + isEmployee() { + return this.isAdmin() || this.isAdsyUser() + }, + /** * Does this user have redmine access? * diff --git a/frontend/app/adapters/application.js b/frontend/app/adapters/application.js index 79197e2b..a481a8e5 100644 --- a/frontend/app/adapters/application.js +++ b/frontend/app/adapters/application.js @@ -2,7 +2,7 @@ import DS from 'ember-data' import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin' export default DS.JSONAPIAdapter.extend(DataAdapterMixin, { - namespace: '/api/proxy/sysupport', + namespace: '/api/proxy/timed', authorize(xhr) { if (this.get('session.data.authenticated.data.token')) { xhr.setRequestHeader( diff --git a/frontend/app/gitlab/route.js b/frontend/app/gitlab/route.js index 26283d4f..904eb068 100644 --- a/frontend/app/gitlab/route.js +++ b/frontend/app/gitlab/route.js @@ -6,7 +6,10 @@ import { computed } from '@ember/object' export default Route.extend(RouteAccessMixin, { //specify which groups have access to this route. - groups: computed(() => ['adsy-customer', 'gitlab']), + groups: computed(() => ({ + requireAll: ['gitlab'], + requireOne: ['adsy-customer'] + })), i18n: service(), session: service(), diff --git a/frontend/app/helpers/format-duration.js b/frontend/app/helpers/format-duration.js index 2866c7a8..593d09e5 100644 --- a/frontend/app/helpers/format-duration.js +++ b/frontend/app/helpers/format-duration.js @@ -12,8 +12,8 @@ export default Helper.extend({ hoursCount: 0, minutesCount: 0, - hoursTranslation: t('sysupport.durations.hour', { count: 'hoursCount' }), - minutesTranslation: t('sysupport.durations.minute', { + hoursTranslation: t('timed.durations.hour', { count: 'hoursCount' }), + minutesTranslation: t('timed.durations.minute', { count: 'minutesCount' }), diff --git a/frontend/app/locales/de/translations.js b/frontend/app/locales/de/translations.js index 9e90c58b..806688a7 100644 --- a/frontend/app/locales/de/translations.js +++ b/frontend/app/locales/de/translations.js @@ -57,8 +57,8 @@ export default { symonitoring: 'SyMonitoring', 'symonitoring.description': 'Überwachung von Server und Diensten', - sysupport: 'SySupport', - 'sysupport.description': 'Support Abonnemente', + timed: 'Credits / Reports', + 'timed.description': 'Support Abonnemente', ppa: 'PPA', 'ppa.description': 'Verwaltung ihrer Webhostings', @@ -74,7 +74,7 @@ export default { nav: { dashboard: 'Übersicht', vault: 'Vault', - sysupport: 'SySupport', + timed: 'Credits / Reports', gitlab: 'Projekte', settings: 'Einstellungen', logout: 'Logout' @@ -92,7 +92,7 @@ export default { 'Das Passwort konnte nicht in die Zwischenablage kopiert werden.' }, - sysupport: { + timed: { breadcrumbs: { reload: 'Aufladen', overview: 'Übersicht' @@ -120,7 +120,7 @@ export default { }, index: { - title: 'Sysupport Abonnements', + title: 'Abonnements', charge: 'Aufladen', details: 'Details' }, diff --git a/frontend/app/locales/en/translations.js b/frontend/app/locales/en/translations.js index f6d0f4ed..401ac795 100644 --- a/frontend/app/locales/en/translations.js +++ b/frontend/app/locales/en/translations.js @@ -57,8 +57,8 @@ export default { symonitoring: 'SyMonitoring', 'symonitoring.description': 'Monitoring of servers and services', - sysupport: 'SySupport', - 'sysupport.description': 'Support subscriptions', + timed: 'Credits / Reports', + 'timed.description': 'Support subscriptions', ppa: 'PPA', 'ppa.description': 'Manage your web-hostings', @@ -74,7 +74,7 @@ export default { nav: { dashboard: 'Dashboard', vault: 'Vault', - sysupport: 'SySupport', + timed: 'Credits / Reports', gitlab: 'Projects', settings: 'Settings', logout: 'Sign out' @@ -91,7 +91,7 @@ export default { 'clipboard-error': 'The secret could not be saved to your clipboard.' }, - sysupport: { + timed: { breadcrumbs: { reload: 'Reload', overview: 'Overview' @@ -118,7 +118,7 @@ export default { } }, index: { - title: 'Sysupport Subscriptions', + title: 'Credits / Reports', charge: 'Reload', details: 'Details' }, diff --git a/frontend/app/mixins/route-access-mixin.js b/frontend/app/mixins/route-access-mixin.js index a6b4387b..b7853b6c 100644 --- a/frontend/app/mixins/route-access-mixin.js +++ b/frontend/app/mixins/route-access-mixin.js @@ -12,8 +12,17 @@ export default Mixin.create({ }, _hasPermissions(user) { - return this.groups.every( - role => user.get(role) || user.get('groups').includes(role) + return ( + (this.groups.requireAll + ? this.groups.requireAll.every( + role => user.get(role) || user.get('groups').includes(role) + ) + : true) && + (this.groups.requireOne + ? this.groups.requireOne.some( + role => user.get(role) || user.get('groups').includes(role) + ) + : true) ) } }) diff --git a/frontend/app/models/user.js b/frontend/app/models/user.js index 024fba8c..dddbf561 100644 --- a/frontend/app/models/user.js +++ b/frontend/app/models/user.js @@ -29,8 +29,8 @@ export default Model.extend({ return this._checkGroup('vault') }), - sysupport: computed('groups.[]', function() { - return this._checkGroup('sysupport') + timed: computed('groups.[]', function() { + return this._checkGroup('timed') }), gitlab: computed('groups.[]', function() { @@ -64,6 +64,10 @@ export default Model.extend({ return this._checkGroup(ENV.APP.adminGroup) }), + adsyUser: computed('groups.[]', function() { + return this._checkGroup(ENV.APP.adsyUserGroup) + }), + _checkGroup(name) { return this.groups.find(g => g.endsWith(name)) } diff --git a/frontend/app/protected/template.hbs b/frontend/app/protected/template.hbs index 144c4a69..a222ccc5 100644 --- a/frontend/app/protected/template.hbs +++ b/frontend/app/protected/template.hbs @@ -35,18 +35,20 @@ {{#list.item 'gitlab'}}{{t 'nav.gitlab'}}{{/list.item}} {{/if}} - {{#if (and (service-enabled 'sysupport') model.sysupport)}} - {{#if model.admin}} - {{#list.item 'sysupport-admin' }}{{t 'nav.sysupport'}}{{/list.item}} - + {{#if (and (service-enabled 'timed') model.timed)}} + {{#if (or model.adsyUser model.admin)}} + {{#list.item 'timed-admin' }}{{t 'nav.timed'}}{{/list.item}} + {{#if model.admin}} + + {{/if}} {{else}} - {{#list.item 'sysupport-subscriptions' }}{{t 'nav.sysupport'}}{{/list.item}} + {{#list.item 'timed-subscriptions' }}{{t 'nav.timed'}}{{/list.item}} {{/if}} {{/if}} {{/nav.list}} diff --git a/frontend/app/router.js b/frontend/app/router.js index 8ba8cda4..ce351f92 100644 --- a/frontend/app/router.js +++ b/frontend/app/router.js @@ -18,12 +18,12 @@ Router.map(function() { this.route('vault', { resetNamespace: true }, function() { this.route('edit', { path: '/*path' }) }) - this.route('sysupport-subscriptions', { resetNamespace: true }, function() { + this.route('timed-subscriptions', { resetNamespace: true }, function() { this.route('detail', { path: ':project_id' }, function() { this.route('reload') }) }) - this.route('sysupport-admin', { resetNamespace: true }, function() { + this.route('timed-admin', { resetNamespace: true }, function() { this.route('detail', { path: ':project' }) this.route('confirm-subscriptions') }) diff --git a/frontend/app/sysupport-admin/confirm-subscriptions/route.js b/frontend/app/timed-admin/confirm-subscriptions/route.js similarity index 61% rename from frontend/app/sysupport-admin/confirm-subscriptions/route.js rename to frontend/app/timed-admin/confirm-subscriptions/route.js index 9c26904c..e3a99523 100644 --- a/frontend/app/sysupport-admin/confirm-subscriptions/route.js +++ b/frontend/app/timed-admin/confirm-subscriptions/route.js @@ -1,14 +1,21 @@ +import { computed } from '@ember/object' import Route from '@ember/routing/route' import { inject as service } from '@ember/service' -export default Route.extend({ +import RouteAccessMixin from 'customer-center/mixins/route-access-mixin' + +export default Route.extend(RouteAccessMixin, { i18n: service(), notify: service(), + groups: computed(() => ({ + requireAll: ['timed', 'adsy-admin'] + })), + init() { this._super(...arguments) this.set('breadCrumb', { - title: this.i18n.t('sysupport.admin.confirm-subscription') + title: this.i18n.t('timed.admin.confirm-subscription') }) }, @@ -34,14 +41,14 @@ export default Route.extend({ order.confirm() order.unloadRecord() this.notify.info( - this.i18n.t('sysupport.admin.confirmSuccess', order.get('project.name')) + this.i18n.t('timed.admin.confirmSuccess', order.get('project.name')) ) }, _deny(order) { order.destroyRecord() this.notify.info( - this.i18n.t('sysupport.admin.confirmDeny', order.get('project.name')) + this.i18n.t('timed.admin.confirmDeny', order.get('project.name')) ) } }) diff --git a/frontend/app/sysupport-admin/confirm-subscriptions/template.hbs b/frontend/app/timed-admin/confirm-subscriptions/template.hbs similarity index 83% rename from frontend/app/sysupport-admin/confirm-subscriptions/template.hbs rename to frontend/app/timed-admin/confirm-subscriptions/template.hbs index 87053122..9c76d523 100644 --- a/frontend/app/sysupport-admin/confirm-subscriptions/template.hbs +++ b/frontend/app/timed-admin/confirm-subscriptions/template.hbs @@ -1,11 +1,11 @@ -

{{t 'sysupport.admin.confirm-subscription'}}

+

{{t 'timed.admin.confirm-subscription'}}

- - - - + + + + diff --git a/frontend/app/sysupport-admin/detail/controller.js b/frontend/app/timed-admin/detail/controller.js similarity index 93% rename from frontend/app/sysupport-admin/detail/controller.js rename to frontend/app/timed-admin/detail/controller.js index 783bbcc6..2173bec5 100644 --- a/frontend/app/sysupport-admin/detail/controller.js +++ b/frontend/app/timed-admin/detail/controller.js @@ -10,6 +10,7 @@ import UIkit from 'UIkit' export default Controller.extend({ i18n: service(), notify: service(), + session: service(), duration: computed('validation.{hour,minute}', 'hour', 'minute', function() { if (this.get('validation.hour') || this.get('validation.minute')) { @@ -82,7 +83,7 @@ export default Controller.extend({ ) }) } catch (e) { - this.notify.error(this.i18n.t('sysupport.reload.error-loading')) + this.notify.error(this.i18n.t('timed.reload.error-loading')) } }).drop(), @@ -95,11 +96,11 @@ export default Controller.extend({ }) yield order.save() - this.notify.success(this.i18n.t('sysupport.reload.success')) + this.notify.success(this.i18n.t('timed.reload.success')) UIkit.accordion('[data-reload-acc]').toggle() this.setProperties({ hour: null, minute: null }) } catch (e) { - this.notify.error(this.i18n.t('sysupport.reload.error')) + this.notify.error(this.i18n.t('timed.reload.error')) } finally { this.fetchModels.perform() this.set('preview', false) diff --git a/frontend/app/sysupport-admin/detail/route.js b/frontend/app/timed-admin/detail/route.js similarity index 100% rename from frontend/app/sysupport-admin/detail/route.js rename to frontend/app/timed-admin/detail/route.js diff --git a/frontend/app/sysupport-admin/detail/template.hbs b/frontend/app/timed-admin/detail/template.hbs similarity index 84% rename from frontend/app/sysupport-admin/detail/template.hbs rename to frontend/app/timed-admin/detail/template.hbs index cea0c75f..df26a044 100644 --- a/frontend/app/sysupport-admin/detail/template.hbs +++ b/frontend/app/timed-admin/detail/template.hbs @@ -1,11 +1,12 @@ +{{#if (get (await session.user) 'admin')}}

+{{/if}}
@@ -46,19 +48,19 @@
-
{{t 'sysupport.admin.customer'}}:
+
{{t 'timed.admin.customer'}}:
{{project.customer.name}}
-
{{t 'sysupport.admin.billingType'}}:
+
{{t 'timed.admin.billingType'}}:
{{project.billingType.name}}
-
{{t 'sysupport.time.total'}}:
+
{{t 'timed.time.total'}}:
{{format-duration (if (and duration preview) previewDuration project.totalTime) }}
-
{{t 'sysupport.time.unconfirmed'}}:
+
{{t 'timed.time.unconfirmed'}}:
{{format-duration project.unconfirmedTime}}
@@ -70,16 +72,16 @@ {{#uk-card as |card|}} {{#card.header}} {{#card.title}} - {{t 'sysupport.detail.charges'}} + {{t 'timed.detail.charges'}} {{/card.title}} {{/card.header}} {{#card.body}}
{{t 'sysupport.admin.customer'}}{{t 'sysupport.admin.project'}}{{t 'sysupport.hours'}}{{t 'sysupport.date'}}{{t 'timed.admin.customer'}}{{t 'timed.admin.project'}}{{t 'timed.hours'}}{{t 'timed.date'}}
- - - + + + @@ -106,17 +108,17 @@ {{#uk-card as |card|}} {{#card.header}} {{#card.title}} - {{t 'sysupport.detail.expense'}} + {{t 'timed.detail.expense'}} {{/card.title}} {{/card.header}} {{#card.body}}
{{t 'sysupport.date'}}{{t 'sysupport.detail.amount'}}{{t 'sysupport.detail.acknowledged'}}{{t 'timed.date'}}{{t 'timed.detail.amount'}}{{t 'timed.detail.acknowledged'}}
- - - - + + + + diff --git a/frontend/app/sysupport-admin/index/controller.js b/frontend/app/timed-admin/index/controller.js similarity index 78% rename from frontend/app/sysupport-admin/index/controller.js rename to frontend/app/timed-admin/index/controller.js index 0247ae48..f55f2f44 100644 --- a/frontend/app/sysupport-admin/index/controller.js +++ b/frontend/app/timed-admin/index/controller.js @@ -6,40 +6,40 @@ export default Controller.extend({ return [ { type: 'search', - title: 'sysupport.admin.project', + title: 'timed.admin.project', attr: 'name' }, { type: 'search', - title: 'sysupport.admin.customer', + title: 'timed.admin.customer', attr: 'customer.name' }, { type: 'search', - title: 'sysupport.admin.billingType', + title: 'timed.admin.billingType', attr: 'billingType.name' }, { type: 'sort', - title: 'sysupport.time.ordered', + title: 'timed.time.ordered', attr: 'purchasedTime', customFilter: this._sortDurations }, { type: 'sort', - title: 'sysupport.time.used', + title: 'timed.time.used', attr: 'spentTime', customFilter: this._sortDurations }, { type: 'sort', - title: 'sysupport.time.total', + title: 'timed.time.total', attr: 'totalTime', customFilter: this._sortDurations }, { type: 'sort', - title: 'sysupport.time.unconfirmed', + title: 'timed.time.unconfirmed', attr: 'unconfirmedTime', customFilter: this._sortDurations } diff --git a/frontend/app/sysupport-admin/index/route.js b/frontend/app/timed-admin/index/route.js similarity index 88% rename from frontend/app/sysupport-admin/index/route.js rename to frontend/app/timed-admin/index/route.js index 969ed3f3..fcae7b50 100644 --- a/frontend/app/sysupport-admin/index/route.js +++ b/frontend/app/timed-admin/index/route.js @@ -7,7 +7,7 @@ export default Route.extend({ init() { this._super(...arguments) this.set('breadCrumb', { - title: this.i18n.t('sysupport.admin.admin') + title: this.i18n.t('timed.admin.admin') }) }, diff --git a/frontend/app/sysupport-admin/index/template.hbs b/frontend/app/timed-admin/index/template.hbs similarity index 93% rename from frontend/app/sysupport-admin/index/template.hbs rename to frontend/app/timed-admin/index/template.hbs index 7a98d0c9..cc60d4c2 100644 --- a/frontend/app/sysupport-admin/index/template.hbs +++ b/frontend/app/timed-admin/index/template.hbs @@ -1,9 +1,9 @@ -

{{t 'sysupport.admin.projects'}}

+

{{t 'timed.admin.projects'}}

{{#cc-data-table headers=headers model=model as |results|}} {{#each results as |project index|}} - {{#link-to "sysupport-admin.detail" project.id + {{#link-to "timed-admin.detail" project.id data-test-project=index class=(concat "uk-link-reset pointer " (if project.isTimeAlmostConsumed "highlight-left")) diff --git a/frontend/app/sysupport-subscriptions/route.js b/frontend/app/timed-admin/route.js similarity index 66% rename from frontend/app/sysupport-subscriptions/route.js rename to frontend/app/timed-admin/route.js index 988289b1..b755280d 100644 --- a/frontend/app/sysupport-subscriptions/route.js +++ b/frontend/app/timed-admin/route.js @@ -3,5 +3,8 @@ import { computed } from '@ember/object' import RouteAccessMixin from 'customer-center/mixins/route-access-mixin' export default Route.extend(RouteAccessMixin, { - groups: computed(() => ['sysupport', 'adsy-customer']) + groups: computed(() => ({ + requireAll: ['timed'], + requireOne: ['adsy-user', 'adsy-admin'] + })) }) diff --git a/frontend/app/sysupport-admin/template.hbs b/frontend/app/timed-admin/template.hbs similarity index 100% rename from frontend/app/sysupport-admin/template.hbs rename to frontend/app/timed-admin/template.hbs diff --git a/frontend/app/sysupport-subscriptions/detail/index/route.js b/frontend/app/timed-subscriptions/detail/index/route.js similarity index 84% rename from frontend/app/sysupport-subscriptions/detail/index/route.js rename to frontend/app/timed-subscriptions/detail/index/route.js index cca715ad..aa79baf7 100644 --- a/frontend/app/sysupport-subscriptions/detail/index/route.js +++ b/frontend/app/timed-subscriptions/detail/index/route.js @@ -3,7 +3,7 @@ import { hash } from 'rsvp' export default Route.extend({ model() { - let project = this.modelFor('sysupport-subscriptions.detail').id + let project = this.modelFor('timed-subscriptions.detail').id return hash({ reports: this.store.query('timed-report', { project, diff --git a/frontend/app/sysupport-subscriptions/detail/index/template.hbs b/frontend/app/timed-subscriptions/detail/index/template.hbs similarity index 79% rename from frontend/app/sysupport-subscriptions/detail/index/template.hbs rename to frontend/app/timed-subscriptions/detail/index/template.hbs index 8132281a..8e2f444c 100644 --- a/frontend/app/sysupport-subscriptions/detail/index/template.hbs +++ b/frontend/app/timed-subscriptions/detail/index/template.hbs @@ -3,17 +3,17 @@ {{#uk-card as |card|}} {{#card.header}} {{#card.title}} - {{t 'sysupport.detail.expense'}} + {{t 'timed.detail.expense'}} {{/card.title}} {{/card.header}} {{#card.body}}
{{t 'sysupport.date'}}{{t 'sysupport.detail.effort'}}{{t 'sysupport.detail.employee'}}{{t 'sysupport.detail.description'}}{{t 'timed.date'}}{{t 'timed.detail.effort'}}{{t 'timed.detail.employee'}}{{t 'timed.detail.description'}}
- - - - + + + + @@ -34,16 +34,16 @@ {{#uk-card as |card|}} {{#card.header}} {{#card.title}} - {{t 'sysupport.detail.charges'}} + {{t 'timed.detail.charges'}} {{/card.title}} {{/card.header}} {{#card.body}}
{{t 'sysupport.date'}}{{t 'sysupport.detail.effort'}}{{t 'sysupport.detail.employee'}}{{t 'sysupport.detail.description'}}{{t 'timed.date'}}{{t 'timed.detail.effort'}}{{t 'timed.detail.employee'}}{{t 'timed.detail.description'}}
- - - + + + diff --git a/frontend/app/sysupport-subscriptions/detail/reload/controller.js b/frontend/app/timed-subscriptions/detail/reload/controller.js similarity index 78% rename from frontend/app/sysupport-subscriptions/detail/reload/controller.js rename to frontend/app/timed-subscriptions/detail/reload/controller.js index a024d53d..60af9403 100644 --- a/frontend/app/sysupport-subscriptions/detail/reload/controller.js +++ b/frontend/app/timed-subscriptions/detail/reload/controller.js @@ -14,14 +14,14 @@ export default Controller.extend({ .createRecord('timed-subscription-order', order) .save() .then(() => { - this.notify.success(this.i18n.t('sysupport.reload.success')) + this.notify.success(this.i18n.t('timed.reload.success')) this.transitionToRoute( - 'sysupport-subscriptions.detail.index', + 'timed-subscriptions.detail.index', this.get('model.project') ) }) .catch(() => { - this.notify.error(this.i18n.t('sysupport.reload.error')) + this.notify.error(this.i18n.t('timed.reload.error')) }) }, diff --git a/frontend/app/sysupport-subscriptions/detail/reload/route.js b/frontend/app/timed-subscriptions/detail/reload/route.js similarity index 77% rename from frontend/app/sysupport-subscriptions/detail/reload/route.js rename to frontend/app/timed-subscriptions/detail/reload/route.js index a8de45be..6b716b55 100644 --- a/frontend/app/sysupport-subscriptions/detail/reload/route.js +++ b/frontend/app/timed-subscriptions/detail/reload/route.js @@ -8,12 +8,12 @@ export default Route.extend({ init() { this._super(...arguments) this.set('breadCrumb', { - title: this.i18n.t('sysupport.breadcrumbs.reload') + title: this.i18n.t('timed.breadcrumbs.reload') }) }, async model() { - let project = await this.modelFor('sysupport-subscriptions.detail') + let project = await this.modelFor('timed-subscriptions.detail') return RSVP.hash({ project, packages: this.store.findAll('timed-subscription-package', { diff --git a/frontend/app/sysupport-subscriptions/detail/reload/template.hbs b/frontend/app/timed-subscriptions/detail/reload/template.hbs similarity index 75% rename from frontend/app/sysupport-subscriptions/detail/reload/template.hbs rename to frontend/app/timed-subscriptions/detail/reload/template.hbs index 4eaa3621..8e69b24e 100644 --- a/frontend/app/sysupport-subscriptions/detail/reload/template.hbs +++ b/frontend/app/timed-subscriptions/detail/reload/template.hbs @@ -1,4 +1,4 @@ -

{{t 'sysupport.reload.select'}}

+

{{t 'timed.reload.select'}}

{{#each model.packages as |package index|}}
{{t 'sysupport.date'}}{{t 'sysupport.detail.amount'}}{{t 'sysupport.detail.acknowledged'}}{{t 'timed.date'}}{{t 'timed.detail.amount'}}{{t 'timed.detail.acknowledged'}}