Skip to content

Commit

Permalink
Merge pull request #428 from origami-team/v1.0.2
Browse files Browse the repository at this point in the history
V1.0.2
  • Loading branch information
YouQam authored Sep 25, 2022
2 parents 29f709a + 52dcf31 commit 0043f94
Show file tree
Hide file tree
Showing 28 changed files with 782 additions and 451 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.ifgi.geogami"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion 30
versionCode 9
versionName "1.0.1"
versionCode 12
versionName "1.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,12 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = WCD6SFKYC5;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.ifgi.geogami;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -387,12 +387,12 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = WCD6SFKYC5;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = com.ifgi.geogami;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"jetifier": "^1.6.5",
"keycloak-js": "^11.0.3",
"lodash": "^4.17.19",
"lottie-web": "^5.6.8",
"lottie-web": "^5.9.6",
"mapbox-gl": "^1.13.0",
"mapbox-gl-compare": "^0.4.0",
"mapbox-gl-style-switcher": "^1.0.3",
Expand Down
4 changes: 4 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ const routes: Routes = [
path: 'create-game-virtual-menu',
loadChildren: () => import('./pages/create-game/create-game-virtual-menu/create-game-virtual-menu.module').then( m => m.CreateGameVirtualMenuPageModule)
},
{
path: 'user/user-management',
loadChildren: () => import('./pages/user/user-management/user-management.module').then( m => m.UserManagementPageModule)
},
];
@NgModule({
imports: [
Expand Down
2 changes: 1 addition & 1 deletion src/app/interfaces/iUser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface IUser {
export interface IUser { //--- ToDo
username: {
type: string;
value: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class AnalyzeGameListPage implements OnInit {
console.error('Unable to read dir', e);
}
}

//--- ToDo
async upload(track) {
const contents = await Plugins.Filesystem.readFile({
path: `origami/tracks/${track}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class PlayGameListPage implements OnInit {
}).finally(() => event.target.complete());

} else if (this.selectedSegment == "all") { // if all is selected
//--- ToDo
this.gamesService.getGames(true).then(res => res.content).then(games => {
// Get either real or VE agmes based on selected environment
gamesListTemp = games.filter(game => game.isVRWorld == this.isVirtualWorld || (!this.isVirtualWorld && game.isVRWorld == undefined));
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/play-game/playing-game/playing-game.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class PlayingGamePage implements OnInit, OnDestroy {
DrawControl: any;

// share data approval
shareData_cbox = false;
shareData_cbox = true;

// Draw control all enabled
DrawControl_all = new MapboxDraw({
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/user/forgot-password/forgot-password.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
<ion-buttons slot="start">
<ion-back-button color="dark" defaultHref="/" text="{{ 'General.back_button' | translate }}"></ion-back-button>
</ion-buttons>
<ion-title>Profil</ion-title>
<ion-title>{{ "User.forgotpw" | translate }}</ion-title>
</ion-toolbar>
</ion-header>

<ion-content class="ion-padding">
<div>
<h1>{{ "User.forgotpw" | translate }}</h1>

<ion-card color="danger" *ngIf="error">
<ion-card-content> {{error}} </ion-card-content>
</ion-card>

<br />

<form (ngSubmit)="resetPassword()" [formGroup]="loginForm">
<ion-text>{{ "User.enterEmail" | translate }}</ion-text>

<ion-input
placeholder="E-Mail"
[id]="'email'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ ion-content {
ion-input {
padding-top: 0.5rem !important;
padding-bottom: 0.5rem !important;
margin-top: 5%;
}
2 changes: 2 additions & 0 deletions src/app/pages/user/forgot-password/forgot-password.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export class ForgotPasswordPage implements OnInit {
}

resetPassword() {
// Remove extra spaces before and after email string
this.loginForm.setValue({email: (this.loginForm.getRawValue().email).trim()})
this.authService.requestResetPassword(this.loginForm.getRawValue());
}
}
3 changes: 2 additions & 1 deletion src/app/pages/user/login/login.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export class LoginPage implements OnInit {
}

login() {
console.log(this.loginForm.getRawValue());
// Remove extra spaces before and after username string
this.loginForm.setValue({username: (this.loginForm.getRawValue().username).trim(), password:this.loginForm.getRawValue().password})
this.authService.login(this.loginForm.getRawValue());
}

Expand Down
36 changes: 25 additions & 11 deletions src/app/pages/user/reset-password/reset-password.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,32 @@

<ion-content class="ion-padding">
<div>
<h1>{{ "User.resetpw" | translate }}</h1>
<ion-card color="danger" *ngIf="error">
<ion-card-content> {{error}} </ion-card-content>
</ion-card>

<form (ngSubmit)="resetPassword()" [formGroup]="loginForm">
<ion-input
type="password"
placeholder="{{ 'User.pl_newPassword' | translate }}"
[id]="'password'"
formControlName="password"
></ion-input>
<ion-text> <p [innerHTML]="'User.enterVirCode' | translate:{email: '<b>' + userEmail + '</b>'}"></p> </ion-text>

<ion-item lines="none" class="ion-no-padding">
<ion-input #Field1 [(ngModel)]="codeInput[0]" (keyup)="gotoNextField(Field2)" maxlength="1" required
[id]="'Input1'" formControlName="Input1" clear-on-edit="true" inputmode="numeric"></ion-input>
<ion-input #Field2 [(ngModel)]="codeInput[1]" (keyup)="gotoNextField(Field3)" maxlength="1" required
[id]="'Input2'" formControlName="Input2" clear-on-edit="true" inputmode="numeric"></ion-input>
<ion-input #Field3 [(ngModel)]="codeInput[2]" (keyup)="gotoNextField(Field4)" maxlength="1" required
[id]="'Input3'" formControlName="Input3" clear-on-edit="true" inputmode="numeric"></ion-input>
<ion-input #Field4 [(ngModel)]="codeInput[3]" (keyup)="gotoNextField(Field5)" maxlength="1" required
[id]="'Input4'" formControlName="Input4" clear-on-edit="true" inputmode="numeric"></ion-input>
<ion-input #Field5 [(ngModel)]="codeInput[4]" (keyup)="gotoNextField(Field6)" maxlength="1" required
[id]="'Input5'" formControlName="Input5" clear-on-edit="true" inputmode="numeric"></ion-input>
</ion-item>

<ion-input #Field6 type="password" placeholder="{{ 'User.pl_newPassword' | translate }}" [id]="'password'"
formControlName="password"></ion-input>
<br />
<ion-button expand="block" type="submit" [disabled]="loginForm.invalid"
>{{ "User.resetpw" | translate }}</ion-button
>
<ion-button expand="block" type="submit" [disabled]="loginForm.invalid">{{ "User.resetpw" | translate }}
</ion-button>
</form>

</div>
</ion-content>
</ion-content>
17 changes: 17 additions & 0 deletions src/app/pages/user/reset-password/reset-password.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ion-content {
> form {
width: 100%;
max-width: 500px;
margin-top: 4%;
}
}
}
Expand All @@ -17,3 +18,19 @@ ion-input {
padding-top: 0.5rem !important;
padding-bottom: 0.5rem !important;
}

/* //-- ToDo: update margin right of ion-item */
ion-item{
margin-top: 10%;
margin-bottom: 7%;

> ion-input {
border: solid 1px;
border-radius: 1px;
min-width: 17.5%;
padding: 0rem !important;
margin-right: 3%;
font-size: xx-large;
text-align: center;
}
}
36 changes: 29 additions & 7 deletions src/app/pages/user/reset-password/reset-password.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { AuthService } from 'src/app/services/auth-service.service';
import { Validators, FormBuilder } from '@angular/forms';
import { NavController } from '@ionic/angular';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';

@Component({
selector: 'app-reset-password',
Expand All @@ -13,24 +13,46 @@ export class ResetPasswordPage implements OnInit {
loginForm;
error: string;
register;
codeInput = [];
userEmail;


constructor(
private fb: FormBuilder,
private authService: AuthService,
public navCtrl: NavController,
private route: ActivatedRoute
) {}
private route: ActivatedRoute,
private router: Router
) {
// Get user email address sent from forgot password page
if(this.router.getCurrentNavigation().extras.state){
this.userEmail = this.router.getCurrentNavigation().extras.state.email;
}
}

ngOnInit(): void {
this.loginForm = this.fb.group({
password: ['', Validators.required],
Input1: ['', Validators.required],
Input2: ['', Validators.required],
Input3: ['', Validators.required],
Input4: ['', Validators.required],
Input5: ['', Validators.required],
});

this.authService.setLoginPageOpen(false); // To hide error message from other pages

this.authService.getErrorMessage().subscribe((e) => {
this.error = e;
});
}

resetPassword() {
this.route.queryParams.subscribe((qp) => {
if (qp.token)
this.authService.resetPassword(this.loginForm.getRawValue(), qp.token);
});
this.authService.resetPassword(this.loginForm.getRawValue().password, this.userEmail ,this.codeInput.join(''));
}

gotoNextField(nextElement) {
nextElement.setFocus();
}

}
31 changes: 31 additions & 0 deletions src/app/pages/user/user-management/user-management.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';

import { FormsModule } from '@angular/forms';

import { IonicModule } from '@ionic/angular';


import { UserManagementPage } from './user-management.page';
import { TranslateModule } from '@ngx-translate/core';


const routes: Routes = [
{
path: '',
component: UserManagementPage
}
];

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes),
TranslateModule
],
declarations: [UserManagementPage]
})
export class UserManagementPageModule {}
56 changes: 56 additions & 0 deletions src/app/pages/user/user-management/user-management.page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button color="dark" defaultHref="/" text="{{ 'General.back_button' | translate }}"></ion-back-button>
</ion-buttons>
<ion-title> User Management</ion-title>
</ion-toolbar>
</ion-header>

<ion-content class="ion-padding">

<h3>Users list</h3>

<ion-grid>
<ion-row class="ion-justify-content-start" style="background-color: #d0def8">
<ion-col size="1"> # </ion-col>
<ion-col size="1.5"> Name </ion-col>
<ion-col size="3"> Email </ion-col>
<ion-col size="2"> Created date </ion-col>
<ion-col size="2"> Role </ion-col>
<ion-col size="2"> Action </ion-col>
</ion-row>

<ion-row *ngFor=" let user of users; index as i" class="ion-justify-content-start"
style="border-bottom: 1px solid grey;" [ngStyle]="{ 'background-color' : i%2 ? '#ecebeb' : ''}">
<ion-col size="1"> {{ i+1 }} </ion-col>
<ion-col size="1.5"> {{ user.username }} </ion-col>
<ion-col size="3"> {{ user.email }} </ion-col>
<ion-col size="2"> {{ user.createdAt.slice(0, 19) }} </ion-col>
<ion-col size="2">
<!-- <ion-item> -->
<ion-list>
<!-- <ion-select interface="popover" placeholder="{{ user.roles[0] }}" ngmodel="{{ user.roles[0]}}"> -->
<ion-select interface="popover" value="{{ user.roles[0]}}" (ionChange)="changeRole(i, $event.detail.value)" [ngStyle]="{ 'background-color' : i%2 ? '#ecebeb' : ''}">
<ion-select-option value="admin">admin</ion-select-option>
<ion-select-option value="scholar">scholar</ion-select-option>
<ion-select-option value="user">user</ion-select-option>
</ion-select>
</ion-list>
<!-- </ion-item> -->
</ion-col>
<ion-col size="2">
<ion-buttons>
<ion-button (click)="saveRoleUpdate(i)" disabled = "{{!user.roleIsUpdated}}">
<ion-icon name="save-sharp" color="{{ user.roleIsUpdated?'primary':'dark'}}"></ion-icon>
</ion-button>

<ion-button (click)="dismissModal(null)">
<ion-icon name="trash-outline"></ion-icon>
</ion-button>
</ion-buttons>
</ion-col>
</ion-row>
</ion-grid>

</ion-content>
12 changes: 12 additions & 0 deletions src/app/pages/user/user-management/user-management.page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ion-col {
text-align: start;

> ion-buttons ,ion-button, ion-icon{
padding: 0rem;
margin: 0rem;
}
}

ion-list, ion-select{
padding: 0rem;
}
Loading

0 comments on commit 0043f94

Please sign in to comment.