diff --git a/src/app/pages/chat/new-group/new-group.page.html b/src/app/pages/chat/new-group/new-group.page.html
index fe521a847..5dbfe0769 100644
--- a/src/app/pages/chat/new-group/new-group.page.html
+++ b/src/app/pages/chat/new-group/new-group.page.html
@@ -30,15 +30,7 @@
-
-
+
diff --git a/src/app/pages/chat/new-group/new-group.page.ts b/src/app/pages/chat/new-group/new-group.page.ts
index 1fbb15d22..4cd6e03be 100644
--- a/src/app/pages/chat/new-group/new-group.page.ts
+++ b/src/app/pages/chat/new-group/new-group.page.ts
@@ -1,5 +1,7 @@
+import { analyzeAndValidateNgModules } from '@angular/compiler';
import { Component, OnInit } from '@angular/core';
-import { ModalController } from '@ionic/angular';
+import { ModalController, PickerController, PopoverController } from '@ionic/angular';
+import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
import { ContactsPage } from './contacts/contacts.page';
@Component({
@@ -9,9 +11,13 @@ import { ContactsPage } from './contacts/contacts.page';
})
export class NewGroupPage implements OnInit {
showLoader: boolean;
+ displayDuration: any;
showDuration: boolean;
+ selectedDuration = ['','',''];
constructor(
+ private pickerController: PickerController,
+ private popoverController: PopoverController,
private modalController: ModalController,
) {
@@ -39,5 +45,130 @@ export class NewGroupPage implements OnInit {
modal.onDidDismiss();
}
+
+ async setDuration(ev: any) {
+ const popover = await this.popoverController.create({
+ component: GroupDurationPage,
+ cssClass: 'group-duration',
+ event: ev,
+ translucent: true
+ });
+ return await popover.present();
+ }
+
+ async showPicker(){
+ const picker = await this.pickerController.create({
+ cssClass: '',
+ buttons: [
+ {
+ text: 'Cancelar', role: 'cancel', cssClass: 'btn-cancel'
+ },
+ {
+ text: 'Ok',
+ cssClass: 'btn-cancel',
+ handler:(value:any)=>{
+ console.log('button done pressed');
+ this.selectedDuration = [
+ value.days.value,
+ value.hours.value,
+ value.minutes.value,
+ ]
+ console.log(this.selectedDuration);
+ if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
+ if(value.days.value > 0){
+ if(value.days.value == 1){
+ if(value.hours.value == 1){
+ this.displayDuration = value.days.value + " day " +
+ value.hours.value + " hora " +
+ value.minutes.value + " minutos";
+ }
+ else{
+ this.displayDuration = value.days.value + " days " +
+ value.hours.value + " horas " +
+ value.minutes.value + " minutos";
+ }
+ }
+ else{
+ if(value.hours.value == 1){
+ this.displayDuration = value.days.value + " days " +
+ value.hours.value + " hora " +
+ value.minutes.value + " minutos";
+ }
+ else{
+ this.displayDuration = value.days.value + " days " +
+ value.hours.value + " horas " +
+ value.minutes.value + " minutos";
+ }
+ }
+ }
+ else{
+ if(value.hours.value == 1){
+ this.displayDuration = value.hours.value + " hora " +
+ value.minutes.value + " minutos";
+ }
+ else{
+ this.displayDuration = value.hours.value + " horas " +
+ value.minutes.value + " minutos";
+ }
+ }
+ }
+ },
+ },
+ ],
+ columns: [
+ {
+ name: 'days',
+ prefix: 'Dias',
+ options: [
+ { text: '0', value: 0 },
+ { text: '1', value: 1 },
+ { text: '2', value: 2 },
+ { text: '3', value: 3 },
+ { text: '4', value: 4 },
+ ]
+ },
+ {
+ name: 'hours',
+ prefix: 'Horas',
+ options: [
+ { text: '0', value: 0 },
+ { text: '1', value: 1 },
+ { text: '2', value: 2 },
+ { text: '3', value: 3 },
+ { text: '4', value: 4 },
+ { text: '5', value: 5 },
+ { text: '6', value: 6 },
+ { text: '7', value: 7 },
+ { text: '8', value: 8 },
+ ]
+ },
+ {
+ name: 'minutes',
+ prefix: 'Minutos',
+ selectedIndex: 3,
+ options: [
+ { text: '0', value: 0 },
+ { text: '5', value: 5 },
+ { text: '10', value: 10 },
+ { text: '15', value: 15 },
+ { text: '20', value: 20 },
+ { text: '25', value: 25 },
+ { text: '30', value: 30 },
+ { text: '35', value: 35 },
+ { text: '45', value: 45 },
+ { text: '50', value: 50 },
+ { text: '55', value: 55 },
+ ]
+ }
+ ]
+ });
+ await picker.present();
+ picker.onDidDismiss().then(async data =>{
+ let day = await picker.getColumn('days');
+ let hour = await picker.getColumn('hours');
+ let minutes = await picker.getColumn('minutes');
+ });
+
+ }
}
diff --git a/src/app/shared/popover/group-duration/group-duration.page.html b/src/app/shared/popover/group-duration/group-duration.page.html
index 92faaf066..768a33230 100644
--- a/src/app/shared/popover/group-duration/group-duration.page.html
+++ b/src/app/shared/popover/group-duration/group-duration.page.html
@@ -1,9 +1,19 @@
-
-
- group-duration
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/shared/popover/group-duration/group-duration.page.ts b/src/app/shared/popover/group-duration/group-duration.page.ts
index bfa56204f..7e095ff05 100644
--- a/src/app/shared/popover/group-duration/group-duration.page.ts
+++ b/src/app/shared/popover/group-duration/group-duration.page.ts
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
+import { PopoverController } from '@ionic/angular';
@Component({
selector: 'app-group-duration',
@@ -7,9 +8,14 @@ import { Component, OnInit } from '@angular/core';
})
export class GroupDurationPage implements OnInit {
- constructor() { }
+ constructor(
+ public popoverController: PopoverController,
+ ) { }
ngOnInit() {
}
+ close(){
+ this.popoverController.dismiss();
+ }
}
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 640e53a5a..74da63bde 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -1,7 +1,7 @@
export const environment = {
production: true,
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/v1/api/',
- apiChatUrl: 'http://192.168.100.111:3000/api/v1/',
+ apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/',
domain: 'gabinetedigital.local',
defaultuser: '',
defaultuserpwd: ''
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 4b92544cb..8792937f1 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -5,7 +5,7 @@
export const environment = {
production: false,
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V3/api/',
- apiChatUrl: 'http://192.168.100.111:3000/api/v1/',
+ apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/',
domain: 'gabinetedigital.local',
defaultuser: 'paulo.pinto',
defaultuserpwd: 'tabteste@006'
diff --git a/src/theme/variables.scss b/src/theme/variables.scss
index ccde3299d..6e7fc3d46 100644
--- a/src/theme/variables.scss
+++ b/src/theme/variables.scss
@@ -299,6 +299,15 @@
max-height: 210px;
min-height: 210px;
}
+.group-duration .popover-content{
+ width: 100% !important;
+ left: 0 !important;
+ bottom: 0 !important;
+ right: 0 !important;
+ top: calc(100% - 500px) !important;
+ max-height: 500px;
+ min-height: 500px;
+}
/* .event-actions-popover ion-list{
} */