diff --git a/.gitignore b/.gitignore index 86d943a..492f923 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ testem.log # System Files .DS_Store Thumbs.db + +.vscode diff --git a/messages.xlf b/messages.xlf deleted file mode 100644 index 36f4280..0000000 --- a/messages.xlf +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - src/app/app.component.html - 10 - - - - English - - src/app/app.component.html - 14 - - - - Deutsch - - src/app/app.component.html - 15 - - - - Home - - src/app/app.component.html - 25 - - - - Login - - src/app/app.component.html - 28 - - - - Apps - - src/app/app.component.html - 31 - - - - Account - - src/app/app.component.html - 34 - - - - Redeem tokens - - src/app/app.component.html - 37 - - - - Get tokens - - src/app/app.component.html - 40 - - - - Logout - - src/app/app.component.html - 43 - - - - - diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index a70bfe7..94887cc 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -16,7 +16,7 @@ import { PasswordResetComponent } from './pages/password-reset/password-reset.co import { AccountComponent } from './pages/account/account.component'; import { RegisterComponent } from './pages/register/register.component'; import { TokensComponent } from './pages/tokens/tokens.component'; -import { AppsComponent } from './pages/apps/apps.component'; +import { ServicesComponent } from './pages/services/services.component'; import { InfoComponent } from './pages/account/info/info.component'; import { ProfileComponent } from './pages/account/profile/profile.component'; import { VoucherComponent } from './pages/account/voucher/voucher.component'; @@ -43,7 +43,7 @@ const routes: Routes = [ { path: 'external-login/totp', component: FormLoginTotpComponent, canActivate: [AnonymousGuard] }, { path: 'password', component: PasswordComponent, canActivate: [AnonymousGuard] }, { path: 'password-reset', component: PasswordResetComponent, canActivate: [AnonymousGuard] }, - { path: 'apps', component: AppsComponent, canActivate: [AuthenticatedGuard] }, + { path: 'services', component: ServicesComponent, canActivate: [AuthenticatedGuard] }, { path: 'account', component: AccountComponent, canActivate: [AuthenticatedGuard], children: [ diff --git a/src/app/app.component.html b/src/app/app.component.html index b9cbf55..6011e29 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -30,8 +30,8 @@ account_circle {{'account' | i18n}} - - widgets {{'apps' | i18n}} + + widgets {{'services' | i18n}} card_giftcard {{'tokens.redeem' | i18n}} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index cf3c1b6..49b1f8d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -15,7 +15,7 @@ import {HomeGeneralComponent} from './pages/home/general/home-general.component' import {HomePrivacyComponent} from './pages/home/privacy/home-privacy.component'; import {HomeServicesComponent} from './pages/home/services/home-services.component'; import {AccountComponent} from './pages/account/account.component'; -import {AppsComponent} from './pages/apps/apps.component'; +import {ServicesComponent} from './pages/services/services.component'; import {AppComponent} from './app.component'; import {LoginComponent} from './pages/login/login.component'; import {LoginTotpComponent} from './pages/login-totp/login-totp.component'; @@ -72,7 +72,7 @@ export class XhrInterceptor implements HttpInterceptor { FormLoginComponent, FormLoginTotpComponent, TokensComponent, - AppsComponent, + ServicesComponent, PermissionsComponent, ProfileFieldsComponent, ProfileFieldDialog, ProfileFieldBlob, QuotasComponent, diff --git a/src/app/pages/apps/apps.component.html b/src/app/pages/apps/apps.component.html deleted file mode 100644 index bf0f83f..0000000 --- a/src/app/pages/apps/apps.component.html +++ /dev/null @@ -1,17 +0,0 @@ -

{{'apps' | i18n}}

- - - - {{'apps.' + app.name + '.icon' | i18n}} - {{'apps.' + app.name + '.title' | i18n}} - {{'apps.' + app.name + '.subtitle' | i18n}} - - -

- {{ 'apps.' + app.name + '.text' | i18n}} -

-
- -
{{'apps.goto' | i18n}} - - \ No newline at end of file diff --git a/src/app/pages/apps/apps.component.ts b/src/app/pages/apps/apps.component.ts deleted file mode 100644 index 97a9f73..0000000 --- a/src/app/pages/apps/apps.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { AppService } from './../../services/app.service'; - -@Component({ - selector: 'app-apps', - templateUrl: './apps.component.html', - styleUrls: ['./apps.component.scss'] -}) -export class AppsComponent implements OnInit { - - apps = []; - - constructor(private appService: AppService) { } - - ngOnInit(): void { - this.appService.apps().subscribe((data: any) => { - this.apps = data; - }) - } - -} diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index 559f787..e436b40 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -15,7 +15,7 @@ export class LoginComponent implements OnInit { form: FormGroup; public loginInvalid: boolean; public apiUrl = environment.apiUrl; - targetRoute = '/apps'; + targetRoute = '/services'; loginModel = {}; constructor(private formBuilder: FormBuilder, private authService: AuthService, private router: Router, private route: ActivatedRoute) { } diff --git a/src/app/pages/services/services.component.html b/src/app/pages/services/services.component.html new file mode 100644 index 0000000..f7024b0 --- /dev/null +++ b/src/app/pages/services/services.component.html @@ -0,0 +1,17 @@ +

{{'services' | i18n}}

+ + + + {{'services.' + service.name + '.icon' | i18n}} + {{'services.' + service.name + '.title' | i18n}} + {{'services.' + service.name + '.subtitle' | i18n}} + + +

+ {{ 'services.' + service.name + '.text' | i18n}} +

+
+ + {{'services.goto' | i18n}} + +
\ No newline at end of file diff --git a/src/app/pages/apps/apps.component.scss b/src/app/pages/services/services.component.scss similarity index 100% rename from src/app/pages/apps/apps.component.scss rename to src/app/pages/services/services.component.scss diff --git a/src/app/pages/apps/apps.component.spec.ts b/src/app/pages/services/services.component.spec.ts similarity index 55% rename from src/app/pages/apps/apps.component.spec.ts rename to src/app/pages/services/services.component.spec.ts index 1c301b0..1284c5f 100644 --- a/src/app/pages/apps/apps.component.spec.ts +++ b/src/app/pages/services/services.component.spec.ts @@ -1,20 +1,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { AppsComponent } from './apps.component'; +import { ServicesComponent } from './services.component'; -describe('AppsComponent', () => { - let component: AppsComponent; - let fixture: ComponentFixture; +describe('ServicesComponent', () => { + let component: ServicesComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AppsComponent ] + declarations: [ ServicesComponent ] }) .compileComponents(); }); beforeEach(() => { - fixture = TestBed.createComponent(AppsComponent); + fixture = TestBed.createComponent(ServicesComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/pages/services/services.component.ts b/src/app/pages/services/services.component.ts new file mode 100644 index 0000000..131f482 --- /dev/null +++ b/src/app/pages/services/services.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { ServiceService } from '../../services/service.service'; + +@Component({ + selector: 'app-services', + templateUrl: './services.component.html', + styleUrls: ['./services.component.scss'] +}) +export class ServicesComponent implements OnInit { + + services = []; + + constructor(private serviceService: ServiceService) { } + + ngOnInit(): void { + this.serviceService.services().subscribe((data: any) => { + this.services = data; + }) + } + +} diff --git a/src/app/services/app.service.ts b/src/app/services/service.service.ts similarity index 69% rename from src/app/services/app.service.ts rename to src/app/services/service.service.ts index bcef47f..105ba35 100644 --- a/src/app/services/app.service.ts +++ b/src/app/services/service.service.ts @@ -6,13 +6,13 @@ import { environment } from '../../environments/environment'; @Injectable({ providedIn: 'root', }) -export class AppService { +export class ServiceService { constructor(private http: HttpClient) { } - apps() { - return this.http.get(environment.apiUrl + "/apps"); + services() { + return this.http.get(environment.apiUrl + "/services"); } } \ No newline at end of file diff --git a/src/app/ui/permissions/permissions.component.html b/src/app/ui/permissions/permissions.component.html index 9183161..9463e4e 100644 --- a/src/app/ui/permissions/permissions.component.html +++ b/src/app/ui/permissions/permissions.component.html @@ -2,11 +2,11 @@ {{'permissions.name' | i18n}} - {{'apps.' + permission.name + '.icon' | i18n}} - {{'apps.' + permission.name + '.title' | i18n}} + {{'services.' + permission.name + '.icon' | i18n}} + {{'services.' + permission.name + '.title' | i18n}} add_circle
- {{'apps.' + permission.name + '.subtitle' | i18n}} + {{'services.' + permission.name + '.subtitle' | i18n}}
diff --git a/src/app/ui/permissions/permissions.component.ts b/src/app/ui/permissions/permissions.component.ts index ecb1788..e79b199 100644 --- a/src/app/ui/permissions/permissions.component.ts +++ b/src/app/ui/permissions/permissions.component.ts @@ -29,7 +29,7 @@ export class PermissionsComponent implements OnInit { this.permissions = data.sort((a, b) => { const isAsc = sort.direction === 'asc'; switch(sort.active) { - case 'name': return this.compare(this.i18n.get('apps.' + a.name + '.title', []), this.i18n.get('apps.' + b.name + '.title', []), isAsc); + case 'name': return this.compare(this.i18n.get('services.' + a.name + '.title', []), this.i18n.get('services.' + b.name + '.title', []), isAsc); case 'starts': return this.compare(a.starts, b.starts, isAsc); case 'expires': return this.compare(a.expires, b.expires, isAsc); default: return 0; diff --git a/src/app/ui/quotas/quotas.component.html b/src/app/ui/quotas/quotas.component.html index 8ac9328..5d9a214 100644 --- a/src/app/ui/quotas/quotas.component.html +++ b/src/app/ui/quotas/quotas.component.html @@ -3,8 +3,8 @@ {{'quotas.name' | i18n}} - {{'apps.' + quota.name + '.icon' | i18n}} - {{'apps.' + quota.name + '.title' | i18n}} + {{'services.' + quota.name + '.icon' | i18n}} + {{'services.' + quota.name + '.title' | i18n}} diff --git a/src/app/ui/quotas/quotas.component.ts b/src/app/ui/quotas/quotas.component.ts index 96ae487..60d75e5 100644 --- a/src/app/ui/quotas/quotas.component.ts +++ b/src/app/ui/quotas/quotas.component.ts @@ -28,7 +28,7 @@ export class QuotasComponent implements OnInit { this.quotas = data.sort((a, b) => { const isAsc = sort.direction === 'asc'; switch(sort.active) { - case 'name': return this.compare(this.i18n.get('apps.' + a.name + '.title', []), this.i18n.get('apps.' + b.name + '.title', []), isAsc); + case 'name': return this.compare(this.i18n.get('services.' + a.name + '.title', []), this.i18n.get('services.' + b.name + '.title', []), isAsc); case 'value': return this.compare(a.value, b.value, isAsc); default: return 0; } diff --git a/src/assets/i18n/de-informal.json b/src/assets/i18n/de-informal.json index c6cdafe..1ad2816 100644 --- a/src/assets/i18n/de-informal.json +++ b/src/assets/i18n/de-informal.json @@ -1,51 +1,5 @@ { "account": "Account", - "apps": { - ".": "Apps", - "gitea": { - "icon": "code", - "subtitle": "Git-Repositories", - "text": "Alternative zu Diensten wie GitHub, Source Code von bstly-Entwicklungen", - "title": "Gitea" - }, - "goto": "Gehe zur App", - "mail": { - "icon": "email", - "subtitle": "E-Mail Konto", - "text": "Catch-All an @{username}.we.bstly.de, lernender Spam-Filter und PGP Verschlüsselung.", - "title": "E-Mail Postfach" - }, - "matrix": { - "icon": "question_answer", - "subtitle": "Messenger Plattform", - "text": "mit anderen Austauschen, sich Informieren oder einfach quatschen.", - "title": "Matrix" - }, - "nextcloud": { - "icon": "cloud", - "subtitle": "Cloud Plattform", - "text": "Dateiverwaltung, Kalendar, Aufgabenmanagement, Kontaktmanagement, Abstimmungen und mehr.", - "title": "Nextcloud" - }, - "partey": { - "icon": "celebration", - "subtitle": "Virtuelles Vereinsheim", - "text": "Digitaler Treffpunkt für Veranstaltungen oder einfach zum Abhängen.", - "title": "Partey" - }, - "registration_vouchers": { - "icon": "card_giftcard", - "subtitle": "Gutschein Code für Registrierungs-Token", - "text": "Einladung um die Services des Bastelei e. V. zu nutzen", - "title": "Registrierungs-Gutscheincodes" - }, - "ROLE_MEMBER": { - "icon": "loyalty", - "subtitle": "Mitgliedschaft im Bastelei e. V.", - "text": "Reguläres Mitglied im Bastelei e. V.", - "title": "Vereinsmitgliedschaft" - } - }, "cancel": "Abbrechen", "close": "Schliessen", "date-time-format": "dd.MM.yyyy HH:mm:ss", @@ -252,7 +206,52 @@ ".": "Service nicht erreichbar", "text": "Zurzeit scheint der Service nicht erreichbar zu sein. Wenn diese Meldung länger besteht, melde dich bitte unter admin@bstly.de!" }, - "services": {}, + "services": { + ".": "Dienste", + "gitea": { + "icon": "code", + "subtitle": "Git-Repositories", + "text": "Alternative zu Diensten wie GitHub, Source Code von bstly-Entwicklungen", + "title": "Gitea" + }, + "goto": "Gehe zum Dienst", + "mail": { + "icon": "email", + "subtitle": "E-Mail Konto", + "text": "Catch-All an @{username}.we.bstly.de, lernender Spam-Filter und PGP Verschlüsselung.", + "title": "E-Mail Postfach" + }, + "matrix": { + "icon": "question_answer", + "subtitle": "Messenger Plattform", + "text": "mit anderen Austauschen, sich Informieren oder einfach quatschen.", + "title": "Matrix" + }, + "nextcloud": { + "icon": "cloud", + "subtitle": "Cloud Plattform", + "text": "Dateiverwaltung, Kalendar, Aufgabenmanagement, Kontaktmanagement, Abstimmungen und mehr.", + "title": "Nextcloud" + }, + "partey": { + "icon": "celebration", + "subtitle": "Virtuelles Vereinsheim", + "text": "Digitaler Treffpunkt für Veranstaltungen oder einfach zum Abhängen.", + "title": "Partey" + }, + "registration_vouchers": { + "icon": "card_giftcard", + "subtitle": "Gutschein Code für Registrierungs-Token", + "text": "Einladung um die Services des Bastelei e. V. zu nutzen", + "title": "Registrierungs-Gutscheincodes" + }, + "ROLE_MEMBER": { + "icon": "loyalty", + "subtitle": "Mitgliedschaft im Bastelei e. V.", + "text": "Reguläres Mitglied im Bastelei e. V.", + "title": "Vereinsmitgliedschaft" + } + }, "software": "Software", "sourcecode": "Quellcode", "token": "Token", diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json deleted file mode 100644 index 3b136b2..0000000 --- a/src/assets/i18n/en.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "i18n.test.replace": "yes no it's clear! {0} {1} {2}", - "date-time-format": "yyyy/dd/MM HH:mm:ss", - "greet": "Hello {0}", - "home": "Home", - "cancel" : "Cancel", - "login": { - ".": "Login", - "external": "Login", - "invalid": "The username and password were not recognised." - }, - "totp": { - ".": "2FA (TOTP)", - "hint": "For using TOTP (known as Google Authenticator) as second factor, please scan the QRCode with your TOTP App.", - "enable": "Enable 2FA (TOTP)", - "code": "TOTP code", - "login" : "Login", - "create": "Setup 2FA (TOTP)", - "remove": "Disable 2FA (TOTP)", - "external": "2FA (TOTP)", - "invalid": "TOTP code is invalid", - "missing": "TOTP code is missing" - }, - "not-found": { - ".": "Not Found", - "text": "What's Up!?" - }, - "service-unavailable": { - ".": "Service Unavailable", - "text": "Currently the service seems unavailable. If this message stays for long, please contact admin@bstly.de!" - }, - "logout": "Logout", - "account": "Account", - "token": "Token", - "ok": "Ok", - "tokens": { - ".": "Tokens", - "redeem": "Redeem Tokens", - "redeemed": "The provided token is already redeemed.", - "get": "Get Tokens", - "enter": "Enter Token", - "validate": "Validate", - "invalid": "The provided token is invalid.", - "provide-valid": "Please provide a valid token" - }, - "username": { - ".": "Username", - "missing": "Please provide a valid username.", - "error": "Please choose another username." - }, - "password": { - ".": "Password", - "forgot": "Forgot Password", - "request": "Request Password", - "reset": "Reset Password", - "change": "Change Password", - "changed": "Succeffuly changed Password!", - "current": "Current Password", - "confirm": "Confirm Password", - "not-match": "Password do not match.", - "invalid": { - "hint": "Please provide a valid password" - }, - "error": { - "ILLEGAL_WHITESPACE": "Please do not use any whitespace!", - "INSUFFICIENT_DIGIT": "Please provide at least one digit!", - "INSUFFICIENT_UPPERCASE": "Please provide at leaste one uppercase character!", - "INSUFFICIENT_LOWERCASE": "Please provide at leaste one lowercase character!", - "INSUFFICIENT_SPECIAL": "Please provide at leaste one special character!", - "TOO_SHORT": "Please choose a longer password!" - } - }, - "register": { - ".": "Register", - "token.missing": "Please provide a valid token first!" - }, - "email": { - ".": "E-Mail", - "primary": "Primary E-Mail", - "invalid": "invalid E-Mail" - }, - "apps": "Apps", - "app": { - "goto": "Go To App" - }, - "locale": { - "en": { - "short": "EN", - "long": "English" - }, - "de-informal": { - "short": "DE", - "long": "Deutsch" - } - }, - "info": { - ".": "Info" - }, - "permissions": { - ".": "Permissions", - "name": "Name", - "expires": "Expires" - }, - "quotas": { - ".": "Quotas", - "name": "Name", - "value": "Quota" - }, - "voucher": { - ".": "Voucher", - "type": "Type", - "code": "Code" - }, - "vouchers": { - ".": "Vouchers", - "info": "Add-On and Registration Vouchers", - "registration": "Registration", - "add-on": "Add-On", - "temp": { - ".": "Temporary Vouchers", - "info": "This list your currently requested vouchers! Please store them safely, the will not get stored for you!" - }, - "stored-safely": { - ".": "Because we do not store any relation from your account to voucher codes, please store this voucher safely. It will not be available on refresh!", - "confirm": "I have saved my voucher safely!" - } - }, - "security": { - ".": "Security" - }, - "software" : "Software", - "sourcecode": "Sourcecode", - "homepage": "Homepage", - "profile": "Profile", - "imprint": "Imprint", - "privacy-policy": "Privacy-Policy", - "profileField": { - ".": "Profilefield", - "name": { - ".": "Name" - }, - "type": { - ".": "Typ", - "TEXT": { - ".": "Textfield" - }, - "NUMBER": { - ".": "Numeric" - }, - "DATE": { - ".": "Date" - }, - "URL": { - ".": "URL" - }, - "EMAIL": { - ".": "Email" - }, - "BOOL": { - ".": "Boolean" - } - }, - "value": "Value", - "index": "Index", - "visibility": { - ".": "Visibility", - "PRIVATE": { - ".": "Private" - }, - "PROTECTED": { - ".": "Protected" - }, - "PUBLIC": { - ".": "Public" - } - } - } -} \ No newline at end of file