This commit is contained in:
Peter Maquiran
2023-09-19 10:21:23 +01:00
parent 527cc0f2a6
commit f51bd246fc
29 changed files with 754 additions and 261 deletions
+19 -23
View File
@@ -37,8 +37,8 @@ export class NewGroupPage implements OnInit{
@Input() groupName:string;
@Output() addGroupMessage:EventEmitter<any> = new EventEmitter<any>();
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
@Output() backToChat:EventEmitter<any> = new EventEmitter<any>();
@Output() backToChat:EventEmitter<any> = new EventEmitter<any>();
constructor(
private pickerController: PickerController,
@@ -57,23 +57,17 @@ export class NewGroupPage implements OnInit{
}
ngOnInit() {
console.log(this.dataService.get("task"))
this.task = this.dataService.get("task");
this.event = this.dataService.get("event");
console.log(this.task)
this
if(this.task) {
if(this.task && this.dataService.get("newGroup")) {
this.link = this.dataService.get("link");
this.groupName = this.task.Folio;
this.documents = this.dataService.get("documents");
this.dataService.set("newGroup", false);
this.dataService.set("link", false);
} else if (this.event) {
} else if (this.event && this.dataService.get("newGroup")) {
//
this.link = this.dataService.get("link");
this.groupName = this.event.Subject;
@@ -83,12 +77,14 @@ export class NewGroupPage implements OnInit{
this.dataService.set("newGroup", false);
this.dataService.set("link", false);
} else {
this.dataService.clear();
}
}
_ionChange(event) {
this.showDuration = event.detail.checked;
if(event.detail.checked) {
@@ -112,12 +108,12 @@ export class NewGroupPage implements OnInit{
this.viewContainerRef.clear();
this.closeAllDesktopComponents.emit();
}
}
}
async createGroup() {
let name = this.groupName.split(' ').join('-');
//Take out all special characters in string
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
@@ -132,12 +128,12 @@ export class NewGroupPage implements OnInit{
let customFields = {
"countDownDate":this.thedate
}
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
}
else {
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
}
loader.remove();
@@ -146,23 +142,23 @@ export class NewGroupPage implements OnInit{
if(res?.result?.rid) {
this.addGroupMessage.emit(res.result.rid);
this.ChatSystemService.getAllRooms(() => {
if(!this.ChatSystemService.getGroupRoom(res.result.rid)) {
this.createGroupWithAttachmentsCath(res)
} else {
setTimeout(()=> {
this.createGroupWithAttachments(res)
}, 500)
}
}, res.result.rid);
} else {
this.toastService._badRequest('Existe um grupo com este nome!');
}
@@ -224,7 +220,7 @@ export class NewGroupPage implements OnInit{
this.close();
let name = this.groupName.split(' ').join('-');
const modal = await this.modalController.create({
component: GroupContactsPage,
@@ -263,7 +259,7 @@ export class NewGroupPage implements OnInit{
text: 'Ok',
cssClass: 'btn-cancel',
handler:(value:any)=>{
let now = new Date();
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
@@ -272,7 +268,7 @@ export class NewGroupPage implements OnInit{
value.hours.value,
value.minutes.value,
]
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){
if(value.days.value == 1){
+3 -3
View File
@@ -62,7 +62,7 @@
<div *ngIf="profilePicture != ''" class="profile-image">
<img class="profile-image" src={{profilePicture}}>
<img class="profile-image image-prety" src={{profilePicture}}>
</div>
@@ -226,7 +226,7 @@
<div *ngIf="profilePicture != ''" class="profile-image">
<img class="profile-image font-45-em" src={{profilePicture}}>
<img class="profile-image font-45-em image-prety" src={{profilePicture}}>
</div>
<div class="profile-text">
@@ -242,4 +242,4 @@
</div>
<div [class.header-bottom-line]="ThemeService.currentTheme == 'gov'" style="height: 5px;"></div>
</div>
</div>
@@ -41,7 +41,7 @@ export class OptsExpedientePage implements OnInit {
SessionStore = SessionStore;
environment = environment
constructor(
private popoverController: PopoverController,
private modalController: ModalController,
@@ -58,7 +58,7 @@ export class OptsExpedientePage implements OnInit {
public TaskService: TaskService,
private dataService: DataService,
) {
}
ngOnInit() {
@@ -66,12 +66,12 @@ export class OptsExpedientePage implements OnInit {
}
async openNewGroupPage() {
this.dataService.set("newGroup", true);
this.dataService.set("task", this.task);
this.dataService.set("newGroupName", this.task.Folio);
this.dataService.set("documents", this.fulltask.Documents);
this.dataService.set("link", window.location.pathname);
// this.dataService.set("newGroup", true);
// this.dataService.set("task", this.task);
// this.dataService.set("newGroupName", this.task.Folio);
// this.dataService.set("documents", this.fulltask.Documents);
// this.dataService.set("link", window.location.pathname);
const modal = await this.modalController.create({
component: NewGroupPage,
@@ -180,7 +180,7 @@ export class OptsExpedientePage implements OnInit {
});
modal.onDidDismiss().then( async (res) => {
if(res.data){
const DocumentToSave = res.data.documents.map((e) => {
return {
@@ -232,7 +232,7 @@ export class OptsExpedientePage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
@@ -249,7 +249,7 @@ export class OptsExpedientePage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não encontrado')
}
});
@@ -266,7 +266,7 @@ export class OptsExpedientePage implements OnInit {
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
@@ -313,7 +313,7 @@ export class OptsExpedientePage implements OnInit {
async openExpedientActionsModal(taskAction: any, task: any) {
this.close();
let classs;
@@ -330,9 +330,9 @@ export class OptsExpedientePage implements OnInit {
},
cssClass: classs,
});
modal.onDidDismiss().then(async res=>{
let body = res['data'];
if(res['data']){
const loader = this.toastService.loading()
@@ -344,7 +344,7 @@ export class OptsExpedientePage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
@@ -352,7 +352,7 @@ export class OptsExpedientePage implements OnInit {
}
}
else{
}
}, (error) => {
console.log(error)
@@ -373,7 +373,7 @@ export class OptsExpedientePage implements OnInit {
modal.onDidDismiss().then( async (res) => {
if(body == 'descartar') {
if(res['data']== 'Yes') {
@@ -389,7 +389,7 @@ export class OptsExpedientePage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
@@ -415,7 +415,7 @@ export class OptsExpedientePage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
@@ -424,7 +424,7 @@ export class OptsExpedientePage implements OnInit {
this.goBack();
}
else if(res['data'] == 'No'){
const loader = this.toastService.loading()
try {
@@ -432,7 +432,7 @@ export class OptsExpedientePage implements OnInit {
this.TaskService.loadExpedientes()
this.toastService._successMessage();
this.goBack();
} catch (error) {
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
@@ -53,7 +53,8 @@
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepSecond]="stepSecond"
[touchUi]="touchUi">
[hideTime]="true"
>
</ngx-mat-datetime-picker>
</mat-form-field>
@@ -89,7 +90,9 @@
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepSecond]="stepSecond">
[stepSecond]="stepSecond"
[hideTime]="true"
>
</ngx-mat-datetime-picker>
</mat-form-field>
</div>
@@ -5,12 +5,29 @@ import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
dateInput: "YYYY-MMMM-DD HH:mm"
},
display: {
dateInput: "DD MMM YYYY",
monthYearLabel: "MMM YYYY",
dateA11yLabel: "LL",
monthYearA11yLabel: "MMMM YYYY"
}
}
@Component({
selector: 'app-new-action',
templateUrl: './new-action.page.html',
styleUrls: ['./new-action.page.scss'],
providers: [
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
]
})
export class NewActionPage implements OnInit {
@@ -42,7 +59,7 @@ export class NewActionPage implements OnInit {
) {
this.folder = new PublicationFolder();
this.setStartDate()
this.setEndDate()
}
@@ -53,7 +70,7 @@ export class NewActionPage implements OnInit {
}
segmentChanged(ev: any) {
}
get dateValid() {
@@ -103,10 +120,10 @@ export class NewActionPage implements OnInit {
if(this.Form.invalid) {
return false
} else {
}
this.folder = {
ProcessId: null,
@@ -116,7 +133,7 @@ export class NewActionPage implements OnInit {
DateEnd: this.folder.DateEnd,
ActionType: this.segment,
}
const loader = this.toastService.loading()
@@ -145,7 +162,7 @@ export class NewActionPage implements OnInit {
date.setSeconds(0);
if(minutes % 15 != 0) {
if (minutes > 45) {
date.setMinutes(60)
} else if (minutes > 30) {
@@ -156,18 +173,18 @@ export class NewActionPage implements OnInit {
date.setMinutes(15)
}
}
}
return date
}
roundTimeQuarterHour() {
let date = new Date();
const minutes = date.getMinutes();
date.setSeconds(0);
if(minutes % 15 != 0) {
if (minutes > 45) {
date.setMinutes(60)
} else if (minutes > 30) {
@@ -178,7 +195,7 @@ export class NewActionPage implements OnInit {
date.setMinutes(15)
}
}
}
return date
}
@@ -187,9 +204,9 @@ export class NewActionPage implements OnInit {
const _date = new Date(date);
const minutes = _date .getMinutes();
_date .setMinutes(minutes + 15)
return _date
return _date
}
setStartDate() {
this.folder.DateBegin = this.roundTimeQuarterHour()