mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
1 line
34 KiB
JSON
1 line
34 KiB
JSON
|
|
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./new-group.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./new-group.page.scss?ngResource\";\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { ModalController, PickerController, PopoverController } from '@ionic/angular';\nimport { AuthService } from 'src/app/services/auth.service';\nimport { ChatSystemService } from 'src/app/services/chat/chat-system.service';\nimport { DataService } from 'src/app/services/data.service';\nimport { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';\nimport { SessionStore } from 'src/app/store/session.service';\nimport { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { RouteService } from 'src/app/services/route.service';\nimport { Router } from '@angular/router';\nlet NewGroupPage = class NewGroupPage {\n constructor(pickerController, popoverController, modalController, dataService, router, ChatSystemService, authService, toastService, ThemeService, RouteService) {\n this.pickerController = pickerController;\n this.popoverController = popoverController;\n this.modalController = modalController;\n this.dataService = dataService;\n this.router = router;\n this.ChatSystemService = ChatSystemService;\n this.authService = authService;\n this.toastService = toastService;\n this.ThemeService = ThemeService;\n this.RouteService = RouteService;\n this.selectedDuration = ['', '', ''];\n this.link = '';\n this.addGroupMessage = new EventEmitter();\n this.closeAllDesktopComponents = new EventEmitter();\n this.backToChat = new EventEmitter();\n this.loggedUserChat = SessionStore.user.ChatData['data'];\n this.isGroupCreated = false;\n }\n ngOnInit() {\n this.task = this.dataService.get(\"task\");\n if (this.task) {\n this.link = this.dataService.get(\"link\");\n this.groupName = this.task.Folio;\n this.documents = this.dataService.get(\"documents\");\n this.dataService.set(\"newGroup\", false);\n this.dataService.set(\"link\", false);\n }\n }\n _ionChange(event) {\n this.showDuration = event.detail.checked;\n if (event.detail.checked) {\n this.thedate = new Date();\n } else {\n this.thedate = '';\n }\n }\n close() {\n if (this.link) {\n this.RouteService.goBack();\n this.dataService.set(\"link\", false);\n } else {\n if (this.roomId) {\n this.backToChat.emit({\n roomId: this.roomId\n });\n } else {\n this.closeAllDesktopComponents.emit();\n }\n }\n }\n createGroup() {\n var _this = this;\n return _asyncToGenerator(function* () {\n let name = _this.groupName.split(' ').join('-');\n //Take out all special characters in string\n name = name.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\");\n let customFields = {};\n let res;\n const loader = _this.toastService.loading();\n if (_this.thedate) {\n let customFields = {\n \"countDownDate\": _this.thedate\n };\n res = yield _this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);\n } else {\n res = yield _this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);\n }\n loader.remove();\n // FsId\n // DocId\n if (res?.result?.rid) {\n _this.addGroupMessage.emit(res.result.rid);\n yield _this.ChatSystemService.getAllRooms();\n if (!_this.ChatSystemService.getGroupRoom(res.result.rid)) {\n _this.createGroupWithAttachmentsCath(res);\n } else {\n setTimeout(() => {\n
|