From 0f0f773c0d295d0101d9e74bc8a227a262135d08 Mon Sep 17 00:00:00 2001 From: brivil1 Date: Fri, 24 May 2019 00:25:39 +0300 Subject: [PATCH 01/22] *Organization list and settings* Organizations in list are now shown only when they have their info is filled, styled list as in main page Worked on organization settings page, looked in Ignas project for image change url, added required fields, and caution message about displaying info --- ionic-ui/package-lock.json | 42 ++++---------- ionic-ui/src/app/constants/En.ts | 7 ++- ionic-ui/src/app/constants/Lt.ts | 9 ++- ionic-ui/src/app/models/Lang.ts | 7 ++- ionic-ui/src/app/pages/login/login.page.ts | 5 +- .../organizations-settings.page.html | 46 ++++++++++++---- .../organizations-settings.page.scss | 22 ++++++++ .../organizations-settings.page.ts | 54 ++++++++++++------ .../organizations/organizations.page.html | 19 +++++-- .../organizations/organizations.page.scss | 55 +------------------ .../pages/organizations/organizations.page.ts | 24 ++++---- 11 files changed, 155 insertions(+), 135 deletions(-) diff --git a/ionic-ui/package-lock.json b/ionic-ui/package-lock.json index 4229dfe..741193d 100644 --- a/ionic-ui/package-lock.json +++ b/ionic-ui/package-lock.json @@ -4443,8 +4443,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -4462,13 +4461,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4481,18 +4478,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -4595,8 +4589,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -4606,7 +4599,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4619,20 +4611,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.3.5", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -4649,7 +4638,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -4722,8 +4710,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -4733,7 +4720,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -4809,8 +4795,7 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -4840,7 +4825,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4858,7 +4842,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4897,13 +4880,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.3", - "bundled": true, - "optional": true + "bundled": true } } }, @@ -4911,7 +4892,6 @@ "version": "1.0.12", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "optional": true, "requires": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", diff --git a/ionic-ui/src/app/constants/En.ts b/ionic-ui/src/app/constants/En.ts index 55603c7..533604e 100644 --- a/ionic-ui/src/app/constants/En.ts +++ b/ionic-ui/src/app/constants/En.ts @@ -65,6 +65,7 @@ export class En { loginUnSuccessfulEmail: 'Email has not sent.', loginWrongHeader: 'Something went wrong', loginWrongMessage: 'Invalid username or password!', + loginSuccessLogin:'Successfuly signed in', //Registration page registrationTitle: 'Register to our page', registrationInformation: 'Your information', @@ -247,7 +248,11 @@ export class En { orgSettingsDeleteCancel: 'Cancel', orgSettingsDeleted: 'Account deleted', orgSettingsCannotGetOrganization: 'Cannot get volunteer from database', - + orgRequiredField3: 'This field is required and must contain at least 3 letters', + orgRequiredEmail: 'This field is required and valid email must be provided', + orgCaution: 'Title, imageUrl and yours organization email is required in order to show your organization in organizations list', + orgSuccessUpdate: 'Information updated successfully', + orgFailUpdate: 'Information update failed', // Organization page orgHeader: 'Organization page', orgGoToProject: 'Go to project page', diff --git a/ionic-ui/src/app/constants/Lt.ts b/ionic-ui/src/app/constants/Lt.ts index a4b9122..1e8875e 100644 --- a/ionic-ui/src/app/constants/Lt.ts +++ b/ionic-ui/src/app/constants/Lt.ts @@ -65,6 +65,7 @@ export class Lt { loginUnSuccessfulEmail: 'Laiško nepavyko išsiųsti', loginWrongHeader: 'Prisijungti nepavyko', loginWrongMessage: 'Neteisingi prisijungimo vardas ir slaptažodis!', + loginSuccessLogin:'Sėkmingai prisijungėte svetainėje', //Registration page registrationTitle: 'Susikurkite vartotojo paskyrą', registrationInformation: 'Jūsų informacija', @@ -144,7 +145,7 @@ export class Lt { changeLocation: 'Keisti vietovę', editSave: 'Išsaugoti pakeitimus', editSucesfull: 'Sėkmingai išsaugota', - editConfirmDelete: 'Ar tikrai norite ištrynti šį projektą?', + editConfirmDelete: 'Ar tikrai norite ištrinti šį projektą?', yes: 'Taip', no: 'Ne', //registrationSuccess: 'Vartotojas sėkmingai priregistruotas', @@ -248,7 +249,11 @@ export class Lt { orgSettingsDeleteCancel: 'Grįžti', orgSettingsDeleted: 'Paskyra ištrinta', orgSettingsCannotGetOrganization: 'Negalime užkrauti Jūsų duomenų iš duomenų bazės', - + orgRequiredField3: 'Šis laukas yra privalomas ir turi būti sudarytas bent iš trijų simbolių', + orgRequiredEmail: 'Šis laukas yra privalomas ir validus el-pašto adresas turi būti pateiktas', + orgCaution: 'Pavadinimo, nuotraukos ir jūsų organizacijos el-paštas yra privalomi norint, kad jūsų organizacija būtų matoma organizacijų sąraše', + orgSuccessUpdate: 'Informacija sėkmingai atnaujinta', + orgFailUpdate: 'Informacijos atnaujinimas nepavyko', // Organization page orgHeader: 'Organizacijos puslapis', orgGoToProject: 'Eiti į projekto puslapį', diff --git a/ionic-ui/src/app/models/Lang.ts b/ionic-ui/src/app/models/Lang.ts index 17ec118..cf5519c 100644 --- a/ionic-ui/src/app/models/Lang.ts +++ b/ionic-ui/src/app/models/Lang.ts @@ -61,6 +61,7 @@ export class Lang { public loginUnSuccessfulEmail: string; public loginWrongHeader: string; public loginWrongMessage: string; + public loginSuccessLogin: string; //Registration page public registrationTitle: string; public registrationInformation: string; @@ -243,7 +244,11 @@ export class Lang { public orgSettingsAlertConfirm: string; public orgSettingsDeleted: string; public orgSettingsCannotGetOrganization: string; - + public orgRequiredField3: string; + public orgRequiredEmail: string; + public orgCaution: string; + public orgSuccessUpdate: string; + public orgFailUpdate: string; //Organization page public orgHeader: string; public orgGoToProject: string; diff --git a/ionic-ui/src/app/pages/login/login.page.ts b/ionic-ui/src/app/pages/login/login.page.ts index 4016f91..5e34ac2 100644 --- a/ionic-ui/src/app/pages/login/login.page.ts +++ b/ionic-ui/src/app/pages/login/login.page.ts @@ -30,7 +30,8 @@ export class LoginPage implements OnInit { loginUnSuccessfulEmail: string = Language.Lang.loginUnSuccessfulEmail; loginWrongHeader: string = Language.Lang.loginWrongHeader; loginWrongMessage: string = Language.Lang.loginWrongMessage; - + loginSuccessLogin: string = Language.Lang.loginSuccessLogin; + public onLoginForm: FormGroup; private user: User; can: boolean = true; @@ -67,7 +68,7 @@ export class LoginPage implements OnInit { this.user = user; if (this.user != null && this.user.token != null) { this.usersService.setUser(user); - this.toastService.presentToast('Successfuly signed in', Strings.Color_Success); + this.toastService.presentToast(this.loginSuccessLogin, Strings.Color_Success); this.navCtrl.navigateRoot('main').catch(reason => console.log('Error while signing in')); } else { this.toastService.presentToast(this.loginWrongMessage, Strings.Color_Danger); diff --git a/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.html b/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.html index 7f8698c..7ee7dc0 100644 --- a/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.html +++ b/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.html @@ -6,16 +6,22 @@ - - +   +
- {{orgSettingsImage}} - + - +
+ + {{orgSettingsImage}} + + +
+
+
@@ -26,6 +32,11 @@ +

+ + {{orgRequiredField3}} + +

@@ -46,6 +57,10 @@ +

+ + {{orgRequiredEmail}} +

@@ -68,8 +83,15 @@

{{orgSettingsDescription}}:

- - +

+ + {{orgCaution}} + +

+ {{orgSettingsSaveChanges}} @@ -79,10 +101,10 @@

{{orgSettingsDescription}}:

+ (click)="onDelete()"> {{orgSettingsDeleteAcc}} - + \ No newline at end of file diff --git a/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.scss b/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.scss index 1784218..8473afc 100644 --- a/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.scss +++ b/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.scss @@ -104,3 +104,25 @@ ion-button { text-transform: uppercase; } +.error-message +{ + color: red; + font-size: 14px; + margin-left: 10px; + margin-top: 10px; +} + +.caution-message{ + font-family: "Georgia", serif; + color: rgb(8, 8, 8); + font-size: 18px; + text-align: center; + border-bottom: 5px solid #791e1e; + background: #c512455b !important; + padding: 10px !important; + border-radius: 10px !important; + position: relative; + display: inline-block !important; + box-shadow: 1px 1px 1px #aaaaaa; + margin-top: 10px; +} \ No newline at end of file diff --git a/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.ts b/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.ts index 1579ff2..dac9563 100644 --- a/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.ts +++ b/ionic-ui/src/app/pages/organizations-settings/organizations-settings.page.ts @@ -36,11 +36,19 @@ export class OrganizationsSettingsPage implements OnInit { orgSettingsCannotGetOrganization: string = Language.Lang.orgSettingsCannotGetOrganization; volSettingsAlertSuccess: string = Language.Lang.volSettingsAlertSuccess; volSettingsAlertFail: string = Language.Lang.volSettingsAlertFail; + orgRequiredField3: string = Language.Lang.orgRequiredField3; + orgRequiredEmail: string = Language.Lang.orgRequiredEmail; + orgCaution: string = Language.Lang.orgCaution; + orgSuccessUpdate: string = Language.Lang.orgSuccessUpdate; + orgFailUpdate: string = Language.Lang.orgFailUpdate; + + caution: string="Pavadinimo, nuotraukos ir jūsų organizacijos el-paštas yra privalomi norint, kad jūsų organizacija būtų matoma organizacijų sąraše"; user: number; public onSaveForm: FormGroup; organization: Organization = new Organization(); - defaulUrl: string = Strings.Default_Image_Url3; + defaulUrl: string = 'https://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg'; + backupImageUrl: string = this.defaulUrl; role: number = 4; constructor( @@ -55,17 +63,6 @@ export class OrganizationsSettingsPage implements OnInit { } ngOnInit() { - this.onSaveForm = this.formBuilder.group({ - 'imageUrl': [null, Validators.nullValidator], - 'title': [null, Validators.nullValidator], - 'address': [null, Validators.nullValidator], - 'phone': [null, Validators.nullValidator], - 'website': [null, Validators.nullValidator], - 'description': [null, Validators.nullValidator], - 'userId': this.usersService.getTokenId(), - 'email': [null, Validators.nullValidator], - }); - this.getRole(); if (this.role != 3) { this.navCtrl.navigateRoot('not-found').catch(error => console.error(error)); @@ -75,10 +72,26 @@ export class OrganizationsSettingsPage implements OnInit { if (this.user === null) { this.navCtrl.navigateRoot('main').catch(e => console.log(e)); } - + this.onSaveForm = this.formBuilder.group({ + 'imageUrl': [null, Validators.nullValidator],// gal reik det required, dar + 'title': [null, Validators.compose([ + Validators.minLength(3), + Validators.required, + Validators.maxLength(64)])], + 'address': [null, Validators.nullValidator], + 'phone': [null, Validators.nullValidator], + 'website': [null, Validators.compose([ + Validators.pattern('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?') + ])], + 'description': [null, Validators.nullValidator], + 'userId': this.usersService.getTokenId(), + 'email': [null, Validators.compose([ + Validators.required, + Validators.pattern('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$')])] + }); this.loadOrganization(); } - + loadOrganization() { this.organizationService.getByUserId(this.user).subscribe(value => { this.organization = value; @@ -99,12 +112,17 @@ export class OrganizationsSettingsPage implements OnInit { this.updateIMG(searchValue); } - updateIMG(searchValue: string) { - this.organization.imageUrl = searchValue; + updateUrl() { + this.backupImageUrl = this.defaulUrl; + } + + updateUrl2() { + this.backupImageUrl = this.organization.imageUrl; } - updateUrl(event) { - this.organization.imageUrl = this.defaulUrl; + updateIMG(searchValue: string) { + this.organization.imageUrl = searchValue; + this.backupImageUrl = searchValue; } onChangePass() { diff --git a/ionic-ui/src/app/pages/organizations/organizations.page.html b/ionic-ui/src/app/pages/organizations/organizations.page.html index f2d93d6..ebc525a 100644 --- a/ionic-ui/src/app/pages/organizations/organizations.page.html +++ b/ionic-ui/src/app/pages/organizations/organizations.page.html @@ -11,14 +11,21 @@ - - - - - {{organizations.title}} - + +
+ +
+ + + {{organization.email}} + + + + {{organization.title}} + +
diff --git a/ionic-ui/src/app/pages/organizations/organizations.page.scss b/ionic-ui/src/app/pages/organizations/organizations.page.scss index 30549cb..6925c3f 100644 --- a/ionic-ui/src/app/pages/organizations/organizations.page.scss +++ b/ionic-ui/src/app/pages/organizations/organizations.page.scss @@ -11,7 +11,10 @@ ion-card { font-family: "Georgia", serif; font-weight: 250%; cursor: pointer; + background: rgba(118, 231, 118, 0.726); } + + ion-content { display: inline-block; --background: none; @@ -19,9 +22,6 @@ ion-content { background-position: center top; background-repeat: no-repeat; background-size: cover; - ion-card { - --background: linear-gradient(0deg, rgb(202, 255, 142) 0%, rgb(177, 243, 255) 100%); - } } ion-searchbar { @@ -47,55 +47,6 @@ ion-grid, ion-col, ion-row { transform: scale(6, 6); } -//

Projects

-h1 { - font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif; - font-size: 50px; - margin-top: 10px; - margin-bottom: 10px; - padding-bottom: 30px;// 30px; - text-align: center; - text-transform: uppercase; - text-rendering: optimizeLegibility; - - &.elegantshadow { - color: #131313; - // background-color: #e7e5e4; - letter-spacing: .15em; - text-shadow: - 1px -1px 0 #767676, - -1px 2px 1px #737272, - -2px 4px 1px #767474, - -3px 6px 1px #787777, - -4px 8px 1px #7b7a7a, - -5px 10px 1px #7f7d7d, - -6px 12px 1px #828181, - -7px 14px 1px #868585, - -8px 16px 1px #8b8a89, - -9px 18px 1px #8f8e8d, - -10px 20px 1px #949392, - -11px 22px 1px #999897, - -12px 24px 1px #9e9c9c, - -13px 26px 1px #a3a1a1, - -14px 28px 1px #a8a6a6, - -15px 30px 1px #adabab, - -16px 32px 1px #b2b1b0, - -17px 34px 1px #b7b6b5, - -18px 36px 1px #bcbbba, - -19px 38px 1px #c1bfbf, - -20px 40px 1px #c6c4c4, - -21px 42px 1px #cbc9c8, - -22px 44px 1px #cfcdcd, - // -23px 46px 1px #d4d2d1, - // -24px 48px 1px #d8d6d5, - // -25px 50px 1px #dbdad9, - // -26px 52px 1px #dfdddc, - // -27px 54px 1px #e2e0df, - // -28px 56px 1px #e4e3e2; - } - -} - .bodis { text-align: center; } diff --git a/ionic-ui/src/app/pages/organizations/organizations.page.ts b/ionic-ui/src/app/pages/organizations/organizations.page.ts index 4b67511..1a4ec7e 100644 --- a/ionic-ui/src/app/pages/organizations/organizations.page.ts +++ b/ionic-ui/src/app/pages/organizations/organizations.page.ts @@ -1,11 +1,11 @@ -import {Component, OnInit} from '@angular/core'; -import {Organization} from '../../models/Organization'; -import {OrganizationsService} from '../../services/organizations.service'; -import {NavController} from '@ionic/angular'; +import { Component, OnInit, SkipSelf } from '@angular/core'; +import { Organization } from '../../models/Organization'; +import { OrganizationsService } from '../../services/organizations.service'; +import { NavController } from '@ionic/angular'; -import {Strings} from '../../constants/Strings'; -import {ReviewsService} from '../../services/reviews.service'; -import {Language} from '../../utilities/Language'; +import { Strings } from '../../constants/Strings'; +import { ReviewsService } from '../../services/reviews.service'; +import { Language } from '../../utilities/Language'; @Component({ selector: 'app-organizations', @@ -14,7 +14,7 @@ import {Language} from '../../utilities/Language'; }) export class OrganizationsPage implements OnInit { orgsHeader: string = Language.Lang.orgsHeader; - defaulUrl: string = 'https://cdn.80000hours.org/wp-content/uploads/2012/11/AAEAAQAAAAAAAAUbAAAAJDZiMjcxZmViLTNkMzItNDhlNi1hZDg4LWM5NzI3MzA4NjMxYg.jpg'; + defaulUrl: string = 'https://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg'; public spin = true; organizations: Organization[]; @@ -23,9 +23,13 @@ export class OrganizationsPage implements OnInit { ngOnInit() { this.organizationsService.get().subscribe(items => { - this.organizations = items; + this.organizations = items.filter(function (value) { + if (value.imageUrl != null && value.imageUrl != '' && value.email != null && value.title != null) { + return true; + } else false; + }).map(function (value) { return value }); this.spin = false; - }, + }, error1 => { console.log(error1); }); From 7dd4a36afa3754d6b8dbffbf51d4f4f607c8a16c Mon Sep 17 00:00:00 2001 From: brivil1 Date: Fri, 24 May 2019 10:11:24 +0300 Subject: [PATCH 02/22] *Fixed new-project data validation* When end date is now earlier than start, you cannot create a project Translated some text Added additional toast with close button --- ionic-ui/src/app/constants/En.ts | 3 ++- ionic-ui/src/app/constants/Lt.ts | 1 + ionic-ui/src/app/models/Lang.ts | 1 + ionic-ui/src/app/pages/login/login.page.ts | 9 +++++---- .../src/app/pages/new-project/date.validator.ts | 16 ++++++++++++++++ .../app/pages/new-project/new-project.page.html | 8 +++++++- .../app/pages/new-project/new-project.page.ts | 13 +++++++++---- .../app/pages/registration/registration.page.ts | 9 +++++---- ionic-ui/src/app/shared/toast.service.ts | 10 ++++++++++ 9 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 ionic-ui/src/app/pages/new-project/date.validator.ts diff --git a/ionic-ui/src/app/constants/En.ts b/ionic-ui/src/app/constants/En.ts index 533604e..639d51b 100644 --- a/ionic-ui/src/app/constants/En.ts +++ b/ionic-ui/src/app/constants/En.ts @@ -132,7 +132,8 @@ export class En { newPojectCreate: 'Create', newPojectAlertNotHeader: 'Project was not created', newPojectAlertNotMessage: 'Please, fill in empty gaps', - newPojectAlertOk: 'OK', + newPojectAlertOk: 'Project created successfully', + newProjectFailedDates: 'Your end date is earlier than your start date', //Edit project editProjectDelete: 'DELETE', editProjectAlertEditHeader: 'Update failed', diff --git a/ionic-ui/src/app/constants/Lt.ts b/ionic-ui/src/app/constants/Lt.ts index 1e8875e..dac2f70 100644 --- a/ionic-ui/src/app/constants/Lt.ts +++ b/ionic-ui/src/app/constants/Lt.ts @@ -133,6 +133,7 @@ export class Lt { newPojectAlertNotHeader: 'Projektas nebuvo sukurtas', newPojectAlertNotMessage: 'Prašome užpildykite tuščius laukus', newPojectAlertOk: 'Gerai', + newProjectFailedDates: 'Jūsų projekto pabaigos data yra ankstesnė nei pradžios', //Edit project editProjectDelete: 'Ištrinti', editProjectAlertEditHeader: 'Atnaujinimas nepavyko', diff --git a/ionic-ui/src/app/models/Lang.ts b/ionic-ui/src/app/models/Lang.ts index cf5519c..9ee0afe 100644 --- a/ionic-ui/src/app/models/Lang.ts +++ b/ionic-ui/src/app/models/Lang.ts @@ -129,6 +129,7 @@ export class Lang { public newPojectAlertNotHeader: string; public newPojectAlertNotMessage: string; public newPojectAlertOk: string; + public newProjectFailedDates: string; //Edit project public editProjectDelete: string; public editProjectAlertEditHeader: string; diff --git a/ionic-ui/src/app/pages/login/login.page.ts b/ionic-ui/src/app/pages/login/login.page.ts index 5e34ac2..ebc7f5e 100644 --- a/ionic-ui/src/app/pages/login/login.page.ts +++ b/ionic-ui/src/app/pages/login/login.page.ts @@ -31,7 +31,8 @@ export class LoginPage implements OnInit { loginWrongHeader: string = Language.Lang.loginWrongHeader; loginWrongMessage: string = Language.Lang.loginWrongMessage; loginSuccessLogin: string = Language.Lang.loginSuccessLogin; - + toastClose: string = Language.Lang.toastClose; + public onLoginForm: FormGroup; private user: User; can: boolean = true; @@ -68,13 +69,13 @@ export class LoginPage implements OnInit { this.user = user; if (this.user != null && this.user.token != null) { this.usersService.setUser(user); - this.toastService.presentToast(this.loginSuccessLogin, Strings.Color_Success); + this.toastService.presentToastClose(this.loginSuccessLogin, Strings.Color_Success, this.toastClose); this.navCtrl.navigateRoot('main').catch(reason => console.log('Error while signing in')); } else { - this.toastService.presentToast(this.loginWrongMessage, Strings.Color_Danger); + this.toastService.presentToastClose(this.loginWrongMessage, Strings.Color_Danger,this.toastClose); } }, error1 => { - this.toastService.presentToast(this.loginWrongMessage, Strings.Color_Danger); + this.toastService.presentToastClose(this.loginWrongMessage, Strings.Color_Danger,this.toastClose); }); } diff --git a/ionic-ui/src/app/pages/new-project/date.validator.ts b/ionic-ui/src/app/pages/new-project/date.validator.ts new file mode 100644 index 0000000..4001711 --- /dev/null +++ b/ionic-ui/src/app/pages/new-project/date.validator.ts @@ -0,0 +1,16 @@ +import {AbstractControl} from '@angular/forms'; + +export class DateValidator { + + static CheckDates(control: AbstractControl) { + let start = control.get('start').value; + + let end = control.get('end').value; + + if(start > end) { + control.get('end').setErrors( {EndDatesMissmatch: true} ); + } else { + return null + } + } +} diff --git a/ionic-ui/src/app/pages/new-project/new-project.page.html b/ionic-ui/src/app/pages/new-project/new-project.page.html index c9500e8..a755f7b 100644 --- a/ionic-ui/src/app/pages/new-project/new-project.page.html +++ b/ionic-ui/src/app/pages/new-project/new-project.page.html @@ -45,9 +45,15 @@ {{newPojectEnd}}: - +

+ + {{newProjectFailedDates}} + +

+ {{newPojectLocation}}: diff --git a/ionic-ui/src/app/pages/new-project/new-project.page.ts b/ionic-ui/src/app/pages/new-project/new-project.page.ts index fc68007..a3cd1d5 100644 --- a/ionic-ui/src/app/pages/new-project/new-project.page.ts +++ b/ionic-ui/src/app/pages/new-project/new-project.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, AbstractControl } from '@angular/forms'; import { Project } from 'src/app/models/Project'; import { ProjectsService } from '../../services/projects.service'; import { AlertController, NavController } from '@ionic/angular'; @@ -7,6 +7,7 @@ import { UsersService } from 'src/app/services/users.service'; import { Language } from 'src/app/utilities/Language'; import { ToastService } from 'src/app/shared/toast.service'; import { Strings } from 'src/app/constants/Strings'; +import { DateValidator } from './date.validator'; @Component({ selector: 'app-new-project', @@ -29,6 +30,8 @@ export class NewProjectPage implements OnInit { newPojectAlertNotHeader: string = Language.Lang.newPojectAlertNotHeader; newPojectAlertNotMessage: string = Language.Lang.newPojectAlertNotMessage; newPojectAlertOk: string = Language.Lang.newPojectAlertOk; + newProjectFailedDates: string = Language.Lang.newProjectFailedDates; + toastClose: string= Language.Lang.toastClose; id: number; public onCreateForm: FormGroup; @@ -78,16 +81,18 @@ export class NewProjectPage implements OnInit { Validators.required, Validators.pattern('^[+0-9. ()-]*$') ])], + },{ + validator: DateValidator.CheckDates }); } - + async onCreate() { this.projectsService.create(this.onCreateForm.value).subscribe(value => { this.createProject = value; - this.toastService.presentToast(this.newPojectAlertOk, Strings.Color_Success); + this.toastService.presentToastClose(this.newPojectAlertOk, Strings.Color_Success, this.toastClose); this.navCtrl.navigateRoot('projects/type/created').catch(reason => console.log(reason)); }, error1 => { - this.toastService.presentToast(this.newPojectAlertNotMessage, Strings.Color_Danger); + this.toastService.presentToastClose(this.newPojectAlertNotMessage, Strings.Color_Danger, this.toastClose); }); } diff --git a/ionic-ui/src/app/pages/registration/registration.page.ts b/ionic-ui/src/app/pages/registration/registration.page.ts index b480e3b..0688e53 100644 --- a/ionic-ui/src/app/pages/registration/registration.page.ts +++ b/ionic-ui/src/app/pages/registration/registration.page.ts @@ -35,7 +35,8 @@ export class RegistrationPage implements OnInit { registrationFailed: string = Language.Lang.registrationNotRegisteredMessage; registrationUsernameTaken: string = Language.Lang.registrationUsernameTaken; registrationEmailTaken: string = Language.Lang.registrationEmailTaken; - + toastClose: string = Language.Lang.toastClose; + public user: User = new User(); public roleSelector = '2'; public onRegisterForm: FormGroup; @@ -97,14 +98,14 @@ export class RegistrationPage implements OnInit { this.usersService.register(this.onRegisterForm.value).subscribe(user => { this.user = user; if (this.user != null) { - this.toastService.presentToast(this.registrationSuccess, Strings.Color_Success); + this.toastService.presentToastClose(this.registrationSuccess, Strings.Color_Success,this.toastClose); this.navCtrl.navigateForward('login').catch(reason => console.log('Failed to move to login page')); } else { - this.toastService.presentToast(this.registrationFailed, Strings.Color_Danger); + this.toastService.presentToastClose(this.registrationFailed, Strings.Color_Danger,this.toastClose); } }, error1 => { const reason = this.getReason(error1.error); - this.toastService.presentToast(this.registrationFailed + '. ' + reason, Strings.Color_Danger); + this.toastService.presentToastClose(this.registrationFailed + '. ' + reason, Strings.Color_Danger,this.toastClose); }); }); } diff --git a/ionic-ui/src/app/shared/toast.service.ts b/ionic-ui/src/app/shared/toast.service.ts index 7e8455f..7660ec6 100644 --- a/ionic-ui/src/app/shared/toast.service.ts +++ b/ionic-ui/src/app/shared/toast.service.ts @@ -15,4 +15,14 @@ export class ToastService { }); toast.present(); } + + public async presentToastClose(message: string, color: string, buttonText: string) { + const toast = await this.toastController.create({ + message: message, + duration: 3000, + color: color, + closeButtonText: buttonText + }); + toast.present(); + } } From c97105a2701a0189c87bc81dbb5e23f02b99b5c9 Mon Sep 17 00:00:00 2001 From: brivil1 Date: Fri, 24 May 2019 10:46:10 +0300 Subject: [PATCH 03/22] Tried to navigate to "page not-found" when volunteer want to created, same with organizations --- .../src/app/pages/projects/projects.page.ts | 33 ++++++++++++++++++- ionic-ui/src/app/shared/toast.service.ts | 9 ++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/ionic-ui/src/app/pages/projects/projects.page.ts b/ionic-ui/src/app/pages/projects/projects.page.ts index e051068..05be090 100644 --- a/ionic-ui/src/app/pages/projects/projects.page.ts +++ b/ionic-ui/src/app/pages/projects/projects.page.ts @@ -6,6 +6,7 @@ import { Strings } from '../../constants/Strings'; import { ActivatedRoute } from '@angular/router'; import { Observable, Subscription } from 'rxjs'; import { Language } from 'src/app/utilities/Language'; +import { UsersService } from 'src/app/services/users.service'; @Component({ selector: 'app-projects', @@ -28,16 +29,19 @@ export class ProjectsPage implements OnInit, OnDestroy { private dateNow = new Date(Date.now()); private type: String; private subscription: Subscription; + private role: number = 4; constructor( + private usersService: UsersService, private events: Events, private projectsService: ProjectsService, private navCtrl: NavController, private route: ActivatedRoute - ) { + ) { } ngOnInit() { + this.getRole(); this.type = this.route.snapshot.params['type']; this.loadItemsByType(); } @@ -50,12 +54,24 @@ export class ProjectsPage implements OnInit, OnDestroy { let observable: Observable; switch (this.type) { case 'saved': + if (this.role != 2) { + this.navCtrl.navigateRoot('not-found').catch(error => console.error(error)); + break; + } observable = this.projectsService.getSavedItems(); break; case 'selected': + if (this.role != 2) { + this.navCtrl.navigateRoot('not-found').catch(error => console.error(error)); + break; + } observable = this.projectsService.getSelectedItems(); break; case 'created': + if (this.role != 3) { + this.navCtrl.navigateRoot('not-found').catch(error => console.error(error)); + break; + } observable = this.projectsService.getCreatedItems(); break; default: @@ -149,4 +165,19 @@ export class ProjectsPage implements OnInit, OnDestroy { getDateStyle(project: Project) { return project != null && new Date(project.start) < this.dateNow && new Date(project.end) > this.dateNow; } + + getRole() { + const role = this.usersService.getTokenRole(); + if (role == 'Volunteer') { + this.role = 2; + } else if (role == 'Organization') { + this.role = 3; + } else if (role == 'Moderator') { + this.role = 1; + } else if (role == 'Admin') { + this.role = 0; + } else { + this.role = 4; + } + } } diff --git a/ionic-ui/src/app/shared/toast.service.ts b/ionic-ui/src/app/shared/toast.service.ts index 7660ec6..9a8e35a 100644 --- a/ionic-ui/src/app/shared/toast.service.ts +++ b/ionic-ui/src/app/shared/toast.service.ts @@ -21,7 +21,14 @@ export class ToastService { message: message, duration: 3000, color: color, - closeButtonText: buttonText + translucent: true, + buttons: [ + { + text: buttonText, + role: 'cancel', + handler: () => {} + } + ] }); toast.present(); } From 2a3b1472a2e3d30e8edf5038c9f30efea315f37e Mon Sep 17 00:00:00 2001 From: brivil1 Date: Fri, 24 May 2019 11:38:06 +0300 Subject: [PATCH 04/22] *Translated pages, fixed navigation* Translated not found page, change some translation in others, fixed navigation to not-found page in projects page --- ionic-ui/src/app/constants/En.ts | 16 ++++++++++------ ionic-ui/src/app/constants/Lt.ts | 14 +++++++++----- ionic-ui/src/app/models/Lang.ts | 10 +++++++--- .../app/pages/new-project/new-project.page.scss | 10 +++++++++- .../src/app/pages/not-found/not-found.page.html | 15 +++------------ .../src/app/pages/not-found/not-found.page.ts | 4 ++++ ionic-ui/src/app/pages/privacy/privacy.page.html | 4 ++-- ionic-ui/src/app/pages/privacy/privacy.page.ts | 4 +++- ionic-ui/src/app/pages/projects/projects.page.ts | 3 --- 9 files changed, 47 insertions(+), 33 deletions(-) diff --git a/ionic-ui/src/app/constants/En.ts b/ionic-ui/src/app/constants/En.ts index 639d51b..be13d50 100644 --- a/ionic-ui/src/app/constants/En.ts +++ b/ionic-ui/src/app/constants/En.ts @@ -65,7 +65,7 @@ export class En { loginUnSuccessfulEmail: 'Email has not sent.', loginWrongHeader: 'Something went wrong', loginWrongMessage: 'Invalid username or password!', - loginSuccessLogin:'Successfuly signed in', + loginSuccessLogin: 'Successfuly signed in', //Registration page registrationTitle: 'Register to our page', registrationInformation: 'Your information', @@ -175,8 +175,8 @@ export class En { cr22: 'You have the right to request a copy of the information we hold about you. If you would like a copy of some or all your personal information, please follow the instructions at the end of this policy.', cr23: 'volunteering.ga user account information can be retrived by following these steps:', cr24: '1.Visit https://login.volunteering.ga/, and enter your username and password.', - cr25: '2.Go to account settings.', - cr26: '3.Click “Send me my data”', + cr25: '2. Go to account settings.', + cr26: '3. Click “Send me my data”', cr27: 'Retention of personal information', cr28: 'We will retain your personal information on our systems only for as long as we need to, for the success of the TeamPlatypus project and the programs that support volunteering.ga. We keep contact information (such as mailing list information) until a user unsubscribes or requests that we delete that information from our live systems. If you choose to unsubscribe from a mailing list, we may keep certain limited information about you so that we may honor your request.', cr29: 'volunteering.ga will not delete personal data from logs or records necessary to the operation, development, or archives of the TeamPlatypus project.', @@ -184,7 +184,7 @@ export class En { cr31: 'When deletion is requested or otherwise required, we will anonymise the data of data subjects and/or remove their information from publicly accessible sites if the deletion of data would break essential systems or damage the logs or records necessary to the operation, development, or archival records of the TeamPlatypus project.', cr32: 'If you would like to request deletion of your account and associated data, please follow these steps:', cr33: '1.Visit https://volunteering.ga/.', - cr34: '2.Login and go to settings.', + cr34: '2. Login and go to settings.', cr35: '3.Click “Request Permanent Account Deletion”.', cr36: 'Rights in relation to your information', cr37: 'You may have certain rights under data protection law in relation to the personal information we hold about you. In particular, you may have a right to:', @@ -200,6 +200,8 @@ export class En { cr47: 'Although most changes are likely to be minor, volunteering.ga may change its Privacy Policy from time to time, and at volunteering.ga’s sole discretion. volunteering.ga encourages visitors to frequently check this page for any changes to its Privacy Policy. Your continued use of this site after any change in this Privacy Policy will constitute your acceptance of such change.', cr48: 'Contact', cr49: 'Please contact us if you have any questions about our privacy policy or information we hold about you by emailing teamPlatypus@volunteering.ga.', + crVisit: '1. Visit', + crEnter: ', and enter your username and password.', // Volunteers settings page volSettingsHeader: 'Volunteer Settings', volSettingsImage: 'Your image url', @@ -265,9 +267,11 @@ export class En { orgProjects: 'Projects', orgNoComments: ' No comments yet', orgNoProjects: 'No projects yet', - // OrganizationS page orgsHeader: 'Organizations', - + //Not found page + notFoundh2: ' Page not found', + notFoundpar: 'The page you are looking for might have been removed, had its name changed or is temporarily unavailable', + notFoundGoMain: 'Go To Main Page', // Toast messages toastDeletedSuccessfuly: 'Project deleted successfuly!', diff --git a/ionic-ui/src/app/constants/Lt.ts b/ionic-ui/src/app/constants/Lt.ts index dac2f70..eb558c6 100644 --- a/ionic-ui/src/app/constants/Lt.ts +++ b/ionic-ui/src/app/constants/Lt.ts @@ -184,8 +184,8 @@ export class Lt { cr31: 'Jei ištrinti prašoma ar kitaip reikalaujama, mes anonimizuosime duomenų subjektų duomenis ir / arba pašalinsime jų informaciją iš viešai prieinamų svetainių, jei duomenų ištrynimas nutrauktų esmines sistemas arba pažeistų žurnalus ar įrašus, reikalingus veiklai, plėtrai ar archyvavimui „TeamPlatypus“ projekto įrašai.', cr32: 'Jei norite prašyti ištrinti paskyrą ir susijusius duomenis, atlikite šiuos veiksmus:', cr33: '1.Apsilankykite https://volunteering.ga/.', - cr34: '2.Prisijunkite ir eikite į nustatymus.', - cr35: '3.Paspauskite „Prašyti paskyros ištrynimo“.', + cr34: '2. Prisijunkite ir eikite į nustatymus.', + cr35: '3. Paspauskite „Prašyti paskyros ištrynimo“.', cr36: 'Su jūsų informacija susijusios teisės', cr37: 'Jūs galite turėti tam tikras teises pagal duomenų apsaugos įstatymus dėl asmeninės informacijos, kurią mes laikome apie jus. Visų pirma, jūs galite turėti teisę:', cr38: 'prašyti asmeninės informacijos, kurią mes laikome, kopiją;', @@ -200,6 +200,8 @@ export class Lt { cr47: 'Nors dauguma pakeitimų gali būti nedideli, volunteering.ga kartais gali keisti savo privatumo politiką ir volunteering.ga skatina lankytojus dažnai patikrinti šį puslapį dėl bet kokių jo privatumo politikos pakeitimų. Jūsų tęstinis šio tinklalapio naudojimas po bet kokių šios privatumo politikos pakeitimų bus jūsų pritarimas tokiems pakeitimams.', cr48: 'Kontaktai', cr49: 'Prašome susisiekti su mumis, jei turite kokių nors klausimų apie mūsų privatumo politiką ar informaciją, kurią mes laikome apie jus elektroniniu paštu teamPlatypus@volunteering.ga.', + crVisit: '1. Apsilankykite', + crEnter: ' ir įveskite savo vartotojo vardą ir slaptažodį', // Volunteers settings page volSettingsHeader: 'Savanario parametrų keitimas', volSettingsImage: 'Jūsų nuotraukos nuoroda', @@ -218,7 +220,7 @@ export class Lt { changePassHeader: 'PASIKEISKITE SLAPTAŽODĮ', changePassFieldSet: 'Reikalinga informacija ', changePassEnterUserEmail: 'Įveskite vartotojo el-paštą', - changePassOldPassword: 'Senas password', + changePassOldPassword: 'Senas slaptažodis', changePassNewPassword: 'Naujas slaptažodis', changePassConfirmPassword: 'Patvirtinkite slaptažodį', changePassButton: 'Keisti slaptažodį', @@ -266,9 +268,11 @@ export class Lt { orgProjects: 'Projektai', orgNoComments: ' Komentarų nėra', orgNoProjects: 'Projektų nėra', - // OrganizationS page orgsHeader: 'Organizacijos', - + //Not found page + notFoundh2: ' Puslapis nerastas', + notFoundpar: 'Puslapis, kurio ieškote, nerastas. Galbūt jis buvo ištrintas, pasikeitė jo pavadinimas arba jis tapo laikinai neprieinamas', + notFoundGoMain: 'Grįžkite į pagrindinį puslapį', // Toast messages toastDeletedSuccessfuly: 'Projektas sėkmingai pašalintas!', diff --git a/ionic-ui/src/app/models/Lang.ts b/ionic-ui/src/app/models/Lang.ts index 9ee0afe..bb204c9 100644 --- a/ionic-ui/src/app/models/Lang.ts +++ b/ionic-ui/src/app/models/Lang.ts @@ -195,6 +195,8 @@ export class Lang { public cr47: string; public cr48: string; public cr49: string; + public crVisit: string; + public crEnter: string; // Volunteers settings page public volSettingsHeader: string; public volSettingsImage: string; @@ -261,10 +263,12 @@ export class Lang { public orgProjects: string; public orgNoComments: string; public orgNoProjects: string; - // OrganizationS page public orgsHeader: string; - - + //Not found page + public notFoundh2: string; + public notFoundpar: string; + public notFoundGoMain: string; + // Toast messages public toastDeletedSuccessfuly: string; public toastFailedToDelete: string; diff --git a/ionic-ui/src/app/pages/new-project/new-project.page.scss b/ionic-ui/src/app/pages/new-project/new-project.page.scss index 0f0b276..2c2a2aa 100644 --- a/ionic-ui/src/app/pages/new-project/new-project.page.scss +++ b/ionic-ui/src/app/pages/new-project/new-project.page.scss @@ -161,4 +161,12 @@ ion-card2 { /* Show the tooltip text when you mouse over the tooltip container */ .tooltip:hover .tooltiptext { visibility: visible; - } \ No newline at end of file + } + + .error-message +{ + color: red; + font-size: 14px; + margin-left: 10px; + margin-top: 10px; +} \ No newline at end of file diff --git a/ionic-ui/src/app/pages/not-found/not-found.page.html b/ionic-ui/src/app/pages/not-found/not-found.page.html index ff89ab1..704fccc 100644 --- a/ionic-ui/src/app/pages/not-found/not-found.page.html +++ b/ionic-ui/src/app/pages/not-found/not-found.page.html @@ -1,21 +1,12 @@ - - - - - - not-found - - -

Oops!

-

404 - Page not found

-

The page you are looking for might have been removed had its name changed or is temporarily unavailable.

- Go To Main Page +

404 - {{notFoundh2}}

+

{{notFoundpar}}.

+ {{notFoundGoMain}}
\ No newline at end of file diff --git a/ionic-ui/src/app/pages/not-found/not-found.page.ts b/ionic-ui/src/app/pages/not-found/not-found.page.ts index ef37000..3a83439 100644 --- a/ionic-ui/src/app/pages/not-found/not-found.page.ts +++ b/ionic-ui/src/app/pages/not-found/not-found.page.ts @@ -1,4 +1,5 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Language } from 'src/app/utilities/Language'; @Component({ selector: 'app-not-found', @@ -8,6 +9,9 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; }) export class NotFoundPage implements OnInit, OnDestroy { + notFoundh2: string = Language.Lang.notFoundh2; + notFoundpar: string = Language.Lang.notFoundpar; + notFoundGoMain: string = Language.Lang.notFoundGoMain; constructor() { } ngOnInit() { diff --git a/ionic-ui/src/app/pages/privacy/privacy.page.html b/ionic-ui/src/app/pages/privacy/privacy.page.html index 159fc1d..070a8ce 100644 --- a/ionic-ui/src/app/pages/privacy/privacy.page.html +++ b/ionic-ui/src/app/pages/privacy/privacy.page.html @@ -1,4 +1,4 @@ -Privacy Policy +{{title}} @@ -27,7 +27,7 @@

{{cr21}}

{{cr22}}

{{cr23}}

-

1.Visit https://login.volunteering.ga/, and enter your username and password.

+

{{crVisit}} https://login.volunteering.ga/{{crEnter}}.

{{cr25}}

{{cr26}}

{{cr27}}

diff --git a/ionic-ui/src/app/pages/privacy/privacy.page.ts b/ionic-ui/src/app/pages/privacy/privacy.page.ts index 9b89f09..565099b 100644 --- a/ionic-ui/src/app/pages/privacy/privacy.page.ts +++ b/ionic-ui/src/app/pages/privacy/privacy.page.ts @@ -57,7 +57,9 @@ export class PrivacyPage implements OnInit { cr47: string=Language.Lang.cr47; cr48: string=Language.Lang.cr48; cr49: string=Language.Lang.cr49; - + crVisit: string =Language.Lang.crVisit; + crEnter: string = Language.Lang.crEnter; + title: string = Language.Lang.menuPrivacyPolicy; constructor() { } ngOnInit() { diff --git a/ionic-ui/src/app/pages/projects/projects.page.ts b/ionic-ui/src/app/pages/projects/projects.page.ts index 05be090..25dbac2 100644 --- a/ionic-ui/src/app/pages/projects/projects.page.ts +++ b/ionic-ui/src/app/pages/projects/projects.page.ts @@ -56,21 +56,18 @@ export class ProjectsPage implements OnInit, OnDestroy { case 'saved': if (this.role != 2) { this.navCtrl.navigateRoot('not-found').catch(error => console.error(error)); - break; } observable = this.projectsService.getSavedItems(); break; case 'selected': if (this.role != 2) { this.navCtrl.navigateRoot('not-found').catch(error => console.error(error)); - break; } observable = this.projectsService.getSelectedItems(); break; case 'created': if (this.role != 3) { this.navCtrl.navigateRoot('not-found').catch(error => console.error(error)); - break; } observable = this.projectsService.getCreatedItems(); break; From cea16a7628de9932370716b5c8cd5a17043a1e62 Mon Sep 17 00:00:00 2001 From: ignnar Date: Sun, 26 May 2019 09:36:47 +0300 Subject: [PATCH 05/22] Language changes --- ionic-ui/src/app/constants/En.ts | 9 ++++++++- ionic-ui/src/app/constants/Lt.ts | 9 ++++++++- ionic-ui/src/app/models/Lang.ts | 10 +++++++++- ionic-ui/src/app/pages/calendar/calendar.page.html | 2 +- ionic-ui/src/app/pages/calendar/calendar.page.ts | 13 +++++++++---- ionic-ui/src/app/pages/project/project.page.html | 8 ++++---- ionic-ui/src/app/pages/project/project.page.ts | 4 +++- 7 files changed, 42 insertions(+), 13 deletions(-) diff --git a/ionic-ui/src/app/constants/En.ts b/ionic-ui/src/app/constants/En.ts index be13d50..dfb4905 100644 --- a/ionic-ui/src/app/constants/En.ts +++ b/ionic-ui/src/app/constants/En.ts @@ -104,6 +104,8 @@ export class En { projectEnd: 'Project ends', projectGoBack: 'Go back', projectHeader: 'Project page', + projectOpenInNewTab: 'Open in new tab', + projectClipBoard: 'Copy to clipboard', //Volunteers page volunteersHeader: 'Volunteers page', volunteersYourVolunteers: 'Your project volunteers', @@ -279,6 +281,11 @@ export class En { toastUpdatedSuccessfuly: 'Project updated successfuly!', toastFailedToUpdate: 'Failed to update project!', toastEmailWasNotSent: 'Email was not sent!', - toastEmailWasSent: 'Email was sent!' + toastEmailWasSent: 'Email was sent!', + + // Calendar page + calFrom: 'From', + calTo: 'To', + calToday: 'Today' } } diff --git a/ionic-ui/src/app/constants/Lt.ts b/ionic-ui/src/app/constants/Lt.ts index eb558c6..3f86038 100644 --- a/ionic-ui/src/app/constants/Lt.ts +++ b/ionic-ui/src/app/constants/Lt.ts @@ -104,6 +104,8 @@ export class Lt { projectEnd: 'Projektas baigsis', projectGoBack: 'Grįžti', projectHeader: 'Projekto puslapis', + projectOpenInNewTab: 'Atidaryti naujame lange', + projectClipBoard: 'Nukopijuoti į iškarpinę', //Volunteers page volunteersHeader: 'Savanorių puslpapis', volunteersYourVolunteers: 'Jūsų projekto savanoriai', @@ -280,6 +282,11 @@ export class Lt { toastUpdatedSuccessfuly: 'Projektas sėkmingai atnaujintas!', toastFailedToUpdate: 'Projekto atnaujinti nepavyko!', toastEmailWasNotSent: 'Elektroninis laiškas nebuvo išsiųstas!', - toastEmailWasSent: 'Elektroninis laiškas sėkmingai išsiųstas!' + toastEmailWasSent: 'Elektroninis laiškas sėkmingai išsiųstas!', + + // Calendar page + calFrom: 'Nuo', + calTo: 'Iki', + calToday: 'Šiandien' } } diff --git a/ionic-ui/src/app/models/Lang.ts b/ionic-ui/src/app/models/Lang.ts index bb204c9..2d02490 100644 --- a/ionic-ui/src/app/models/Lang.ts +++ b/ionic-ui/src/app/models/Lang.ts @@ -100,6 +100,9 @@ export class Lang { public projectEnd: string; public projectGoBack: string; public projectHeader: string; + public projectClipBoard: string; + public projectOpenInNewTab: string; + //Volunteers page public volunteersHeader: string; public volunteersYourVolunteers: string; @@ -268,7 +271,7 @@ export class Lang { public notFoundh2: string; public notFoundpar: string; public notFoundGoMain: string; - + // Toast messages public toastDeletedSuccessfuly: string; public toastFailedToDelete: string; @@ -276,4 +279,9 @@ export class Lang { public toastFailedToUpdate: string; public toastEmailWasNotSent: string; public toastEmailWasSent: string; + + // Calendar page + public calFrom: string; + public calTo: string; + public calToday: string; } diff --git a/ionic-ui/src/app/pages/calendar/calendar.page.html b/ionic-ui/src/app/pages/calendar/calendar.page.html index 4bbf3f4..aab4c92 100644 --- a/ionic-ui/src/app/pages/calendar/calendar.page.html +++ b/ionic-ui/src/app/pages/calendar/calendar.page.html @@ -11,7 +11,7 @@

- Today + {{calToday}}

diff --git a/ionic-ui/src/app/pages/calendar/calendar.page.ts b/ionic-ui/src/app/pages/calendar/calendar.page.ts index 88ab243..a2d20cc 100644 --- a/ionic-ui/src/app/pages/calendar/calendar.page.ts +++ b/ionic-ui/src/app/pages/calendar/calendar.page.ts @@ -7,6 +7,7 @@ import { Subscription } from 'rxjs'; import { Project } from '../../models/Project'; import { ProjectsService } from '../../services/projects.service'; import { ActivatedRoute } from '@angular/router'; +import { Language } from 'src/app/utilities/Language'; @Component({ selector: 'app-calendar', @@ -14,13 +15,16 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./calendar.page.scss'], }) export class CalendarPage implements OnInit { + calfrom: string = Language.Lang.calFrom; + calto: string = Language.Lang.calTo; + calToday: string = Language.Lang.calToday; projects: Project[]; events3: Project[]; private subscription: Subscription; private type: String; @ViewChild(CalendarComponent) myCal: CalendarComponent; - eventSource: { title: string, startTime: Date, endTime: Date, id: number }[] = []; + eventSource: { title: string, startTime: Date, endTime: Date, endTime2: Date, id: number }[] = []; constructor(public navCtrl: NavController, private projectsService: ProjectsService, private alertCtrl: AlertController, @Inject(LOCALE_ID) private locale: string, private route: ActivatedRoute) { } ngOnInit() { this.type = this.route.snapshot.params['type']; @@ -39,11 +43,11 @@ export class CalendarPage implements OnInit { async onEventSelected(event) { // Use Angular date pipe for conversion let start = formatDate(event.startTime, 'medium', this.locale); - let end = formatDate(event.endTime, 'medium', this.locale); + let end = formatDate(event.endTime2, 'medium', this.locale); const alert = await this.alertCtrl.create({ header: event.title, subHeader: event.desc, - message: 'Nuo: ' + start + '

Iki: ' + end, + message: this.calfrom + ': ' + start + '

' + this.calto + ': ' + end, buttons: [{ text: "Details", handler: () => { @@ -90,7 +94,8 @@ export class CalendarPage implements OnInit { title: value.title, startTime: new Date(value.start), endTime: new Date(value.start), // #EDITED TO START BECAUSE THERE IS TOO MUCH OF SPAM IN CALENDAR - id: value.id + id: value.id, + endTime2: new Date(value.end) }); }); this.myCal.loadEvents(); diff --git a/ionic-ui/src/app/pages/project/project.page.html b/ionic-ui/src/app/pages/project/project.page.html index 2278c22..3b967b7 100644 --- a/ionic-ui/src/app/pages/project/project.page.html +++ b/ionic-ui/src/app/pages/project/project.page.html @@ -57,7 +57,7 @@

{{project.title}}

- Open in new page + {{NewTab}} {{project.website}} @@ -67,7 +67,7 @@

{{project.title}}

- Copy to clipboard + {{ClipBoard}} {{project.phone}} @@ -77,7 +77,7 @@

{{project.title}}

- Copy to clipboard + {{ClipBoard}} {{project.location}} @@ -87,7 +87,7 @@

{{project.title}}