draft document are been listed and open on tiny

This commit is contained in:
Eudes Inácio
2023-07-06 12:20:57 +01:00
parent 01324ad022
commit e227f0d683
17 changed files with 288 additions and 56 deletions
+1
View File
@@ -63,6 +63,7 @@ export class fullTask {
UserName: string,
WorkflowID: string,
wxUserID: number,
DraftIds: string
}
Documents: any[]
workflowInstanceFolio: string
+1
View File
@@ -3,6 +3,7 @@ export interface Environment {
apiURL: string;
apiChatUrl: string;
apiWsChatUrl: string;
apiPCURL: string;
logoLabel: string;
production: boolean;
domain: string;
@@ -63,8 +63,8 @@
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents">
<ion-label class="d-block" (click)="viewDocument(Document.DocId, Document)">
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of mergedArray">
<ion-label class="d-block" (click)="viewDocument(Document.DocId, Document,Document.content)">
<p class="attach-title-item">{{ Document.Assunto || "Sem assunto" }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
</ion-label>
@@ -21,6 +21,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service'
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
@Component({
@@ -39,6 +40,7 @@ export class DespachoPage implements OnInit {
attachments: any;
fulltask: any;
mergedArray: any = [];
eventsList: Event[] = [];
serialnumber: string;
caller: string;
@@ -47,6 +49,7 @@ export class DespachoPage implements OnInit {
cc: any = [];
executadoText: string = "Executado";
gerarText: string = "Gerar"
draftDocumentIds;
constructor(private activateRoute: ActivatedRoute,
@@ -106,6 +109,35 @@ export class DespachoPage implements OnInit {
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe((res: fullTask) => {
this.TaskService.loadDiplomas();
let stringDraft = res.workflowInstanceDataFields.DraftIds;
console.log('sring to array', stringDraft)
let split_stringDraft = stringDraft.split(",");
let listDrafts = []
split_stringDraft.forEach(element => {
console.log('List of ids', element)
this.processes.GetDraftByID(element).subscribe((resd) => {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"DocDate": "",
"DocId": resd.data.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
}
this.mergedArray.push(object)
console.log('List of draff', resd)
})
});
this.task = {
"SerialNumber": res.serialNumber,
@@ -129,6 +161,30 @@ export class DespachoPage implements OnInit {
// this.updateProcessOnDB(res);
this.fulltask = res;
console.log('Anexos', this.fulltask.Documents)
const mergedArray1 = [];
const mergedArray2 = [];
// Merge array1 with tag
this.fulltask.Documents.forEach(element => {
let docObject = {
"ApplicationId": element.ApplicationId,
"Assunto": element.Assunto,
"DocDate": element.DocDate,
"DocId": element.DocId,
"DocNumber": element.DocNumber,
"FolderId": element.FolderId,
"Sender": element.Sender,
"SourceDocId": element.SourceDocId,
"content": "",
}
this.mergedArray.push(docObject);
});
console.log('All',this.mergedArray)
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
@@ -177,8 +233,9 @@ export class DespachoPage implements OnInit {
// }
async viewDocument(docId: string, Document) {
async viewDocument(docId: string, Document, content) {
if(Document.content == "") {
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
@@ -197,6 +254,19 @@ export class DespachoPage implements OnInit {
cssClass: 'modal modal-desktop'
});
await modal.present();
} else {
const modal = await this.modalController.create({
component: TinyMCEPage,
componentProps: {
Document,
content
},
cssClass: 'modal modal-desktop'
});
await modal.present();
}
}
@@ -503,3 +573,9 @@ export class DespachoPage implements OnInit {
}
function mergeArraysAndTag(array1, array2) {
console.log('second', array2)
}
+2
View File
@@ -118,6 +118,8 @@ export class LoginPage implements OnInit {
const loader = this.toastService.loading()
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
await this.authService.loginContenteProduction(this.userattempt, {saveSession: false})
loader.remove()
+29
View File
@@ -100,6 +100,35 @@ export class AuthService {
}
async loginContenteProduction(user: UserForm, {saveSession = true}): Promise<LoginUserRespose> {
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ));
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
this.opts = {
headers: this.headers,
}
let response: any;
try {
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/LoginJwt", '', this.opts).toPromise();
if(saveSession) {
/* this.SetSession(response, user) */
this.storageService.store('userContentProduction',response)
this.storageService.get('userContentProduction').then((value) =>{
console.log('JWW', value.AuthorizationJwt);
})
}
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
} finally {
return response
}
}
// async UpdateLogin() {}
SetSession(response: LoginUserRespose, user:UserForm) {
+25 -1
View File
@@ -10,6 +10,7 @@ import { GetTasksListType } from '../models/GetTasksListType';
import { fullTaskList } from '../models/dailyworktask.model';
import { ChangeProfileService } from './change-profile.service';
import { SessionStore } from '../store/session.service';
import { StorageService } from './storage.service';
@Injectable({
providedIn: 'root'
})
@@ -18,10 +19,13 @@ export class ProcessesService {
authheader = {};
loggeduser: LoginUserRespose;
headers: HttpHeaders;
headers2: HttpHeaders;
constructor(
private http: HttpClient,
private changeProfileService: ChangeProfileService
private changeProfileService: ChangeProfileService,
private storageSevice: StorageService
) {
this.loggeduser = SessionStore.user;
@@ -32,6 +36,8 @@ export class ProcessesService {
this.setHeader()
})
}
@@ -39,6 +45,11 @@ export class ProcessesService {
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
this.headers2 = new HttpHeaders();
this.headers2 = this.headers2.set('Authorization',"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIyNjIiLCJ1bmlxdWVfbmFtZSI6IkdpbHNvbiBNYW51ZWwiLCJlbWFpbCI6ImdpbHNvbi5tYW51ZWxAZ2FiaW5ldGVkaWdpdGFsLmxvY2FsIiwicm9sZSI6IlNlY3JldMOhcmlvIEdlcmFsIiwiZ3JvdXBzaWQiOiJHYWJpbmV0ZSBkZSBUZWNub2xvZ2lhcyBkZSBJbmZvcm1hw6fDo28iLCJvcmdhbmljZW50aXR5aWREIjoiMTA2IiwibmJmIjoxNjg4NTg0NTYzLCJleHAiOjE3MjAxMjA1NjMsImlhdCI6MTY4ODU4NDU2MywiaXNzIjoiOGIxMzBhN2YwLWM3YjctNDdzMjMtOWE4ZC1kNTlhMDE5YWY3NDkiLCJhdWQiOiJkMjh3dzE0NTMtM2M2OC00MWFkLThiNmMtYTUzNDUzODNlMGMyIn0.QDCrQsCH59GQMoudZTHyCMwwHYVwz1mZkLTzvzAwh64"
);
}
uploadFile(formData:any){
@@ -107,6 +118,7 @@ export class ProcessesService {
}
GetTask(serialnumber:string): Observable<any> {
const geturl = environment.apiURL + 'Tasks/FindTask';
let params = new HttpParams();
@@ -119,6 +131,18 @@ export class ProcessesService {
return this.http.get<any>(`${geturl}`, options);
}
GetDraftByID(id:string): Observable<any> {
const geturl = environment.apiPCURL + `Documents/${id}`;
let params = new HttpParams();
/* params = params.set("serialNumber", serialnumber); */
let options = {
headers: this.headers2,
/* params: params */
};
return this.http.get<any>(`${geturl}`, options);
}
SetTaskToPending(serialNumber:string): Observable<any>{
const geturl = environment.apiURL + 'Tasks/SetTaskPending';
+1 -1
View File
@@ -180,7 +180,7 @@ export class HeaderPage implements OnInit {
if(!this.showProfileModal) {
this.showProfileModal = true
const modal = await this.modalController.create({
component: TinyMCEPage,
component: ProfilePage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
}
+3 -1
View File
@@ -9,6 +9,7 @@ import { TinyMCEPageRoutingModule } from './tiny-mce-routing.module';
import { TinyMCEPage } from './tiny-mce.page';
import {Editor} from 'tinymce';
import { EditorModule } from '@tinymce/tinymce-angular';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
imports: [
@@ -16,7 +17,8 @@ import { EditorModule } from '@tinymce/tinymce-angular';
FormsModule,
IonicModule,
TinyMCEPageRoutingModule,
EditorModule
EditorModule,
FontAwesomeModule
],
declarations: [TinyMCEPage]
})
+25 -2
View File
@@ -1,5 +1,25 @@
<ion-header class="ion-no-border">
<ion-toolbar class="d-flex">
<div class="d-flex align-items-center px-20 pt-20 font-25">
<div class="left cursor-pointer" (click)="close()">
<fa-icon icon="chevron-left" class="menu-icon font-awesome-1"></fa-icon>
</div>
<div class="middle add-ellipsis">
{{Document.Assunto}}
</div>
<div class="right cursor-pointer" (click)="openOptions()">
<fa-icon icon="ellipsis-v" class="menu-icon font-awesome-1"></fa-icon>
</div>
</div>
</ion-toolbar>
</ion-header>
<editor
apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p"
[(ngModel)]="editorContent"
[init]="{
height: 500,
menubar: false,
@@ -11,6 +31,9 @@ apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p"
toolbar:
'undo redo | formatselect | bold italic backcolor | \
alignleft aligncenter alignright alignjustify | \
bullist numlist outdent indent | removeformat | print | help'
}"
bullist numlist outdent indent | removeformat | print | help' }"
initialValue='{{content}}'
[(ngModel)]="editorContent"
(onSaveContent)="somefunction()"
></editor>
<button (click)="somefunction()">Save Content</button>
+27
View File
@@ -0,0 +1,27 @@
.left{
float: left;
}
.middle{
float: left;
padding-left: 5px !important;
}
.right{
float: right;
margin-left: auto;
}
.container-img {
background-image: url(/assets/gif/theme/gov/Blocks-loader.svg);
background-repeat: no-repeat;
background-position-x: center;
background-position-y: center;
}
@media only screen and (max-width: 650px) {
.container-img {
background-size: 25%;
}
}
+44 -3
View File
@@ -1,5 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { NavParams } from '@ionic/angular';
import { EventDetailsDocumentsOptionsPage } from '../shared/popover/event-details-documents-options/event-details-documents-options.page';
import { AlertController, ModalController } from '@ionic/angular';
@Component({
selector: 'app-tiny-mce',
templateUrl: './tiny-mce.page.html',
@@ -7,12 +9,51 @@ import { Component, OnInit } from '@angular/core';
})
export class TinyMCEPage implements OnInit {
initialContent = '<h1>Hello, World!</h1><p>This is my HTML document.</p>';
constructor() { }
title = '<h1>Hello, World!</h1><p>This is my HTML document.</p>';
Document: any
content: any
editorContent: string;
constructor(
private navParams: NavParams,
private modalController: ModalController,
) {
this.Document = this.navParams.get('Document')
this.content = this.navParams.get('content')
}
ngOnInit() {
}
close() {
throw new Error('Method not implemented.');
}
somefunction() {
console.log(this.title)
}
async openOptions() {
const modal = await this.modalController.create({
component: EventDetailsDocumentsOptionsPage,
cssClass: 'model aside-modal search-submodal',
componentProps: {
/* fulltask: this.task,
task: this.task */
}
});
await modal.present();
modal.onDidDismiss().then((res)=>{
})
}
}
+1 -1
View File
@@ -4,4 +4,4 @@ import { doneITDev } from './suport/doneIt'
import { DevDev } from './suport/dev'
export const environment: Environment = oaprDev
export const environment: Environment = DevDev
+2
View File
@@ -6,6 +6,7 @@ export const DevProd: Environment = {
apiURL: 'https://gdapi-dev.dyndns.info/api/',
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
apiPCURL: 'http://192.168.0.21:9099/api/',
production: true,
domain: 'gabinetedigital.local',
defaultuser: '',
@@ -30,6 +31,7 @@ export const DevDev: Environment = {
apiURL: 'https://gdapi-dev.dyndns.info/api/',
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
apiPCURL: 'http://192.168.0.21:9099/api/',
production: true,
domain: 'gabinetedigital.local',
defaultuser: 'paulo.pinto@gabinetedigital.local',
+2
View File
@@ -6,6 +6,7 @@ export const doneITProd: Environment = {
apiURL: 'https://API.DONEIT.CO.AO/api/',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
apiPCURL: 'http://192.168.0.21:9099/api/',
production: true,
domain: 'equilibrium.co.ao',
defaultuser: '',
@@ -29,6 +30,7 @@ export const doneITDev: Environment = {
apiURL: 'https://API.DONEIT.CO.AO/api/',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
apiPCURL: 'http://192.168.0.21:9099/api/',
production: true,
domain: 'equilibrium.co.ao',
defaultuser: 'peter.maquiran@equilibrium.co.ao',
+2
View File
@@ -7,6 +7,7 @@ export const oaprProd: Environment = {
apiURL: 'https://gd-api.oapr.gov.ao/api/',
apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket',
apiPCURL: 'http://192.168.0.21:9099/api/',
logoLabel: 'Presidente da República',
despachoLabel: 'Presidenciais',
despachoLabel2: 'Despachos Presidênciais',
@@ -30,6 +31,7 @@ export const oaprDev: Environment = {
apiURL: 'https://gd-api.oapr.gov.ao/api/',
apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket',
apiPCURL: 'http://192.168.0.21:9099/api/',
logoLabel: 'Presidente da República',
despachoLabel: 'Presidencial',
despachoLabel2: 'Despachos Presidênciais',
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "4c15001cd",
"SHA": "4c15001cd399799e32e71c212ae81133deb0347b",
"shortSHA": "01324ad02",
"SHA": "01324ad0221fce2124cd975c8d1325c8c4687593",
"branch": "feature/gabinete-search",
"lastCommitAuthor": "'Eudes Inácio'",
"lastCommitTime": "'Fri Jun 30 15:35:11 2023 +0100'",
"lastCommitMessage": "adding tiny",
"lastCommitNumber": "5025",
"lastCommitTime": "'Mon Jul 3 12:04:52 2023 +0100'",
"lastCommitMessage": "tinymce added and working",
"lastCommitNumber": "5026",
"change": "",
"changeStatus": "On branch feature/gabinete-search\nYour branch is ahead of 'origin/feature/gabinete-search' by 12 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: config.xml\n\tmodified: src/app/app.module.ts\n\tmodified: src/app/tiny-mce/tiny-mce.page.html\n\tmodified: src/app/tiny-mce/tiny-mce.page.ts\n\tmodified: src/assets/tinyMCE/editor.html\n\tdeleted: src/assets/tinyMCE/src/assets/tinyMCE/tinymce.min.js\n\tmodified: src/environments/environment.ts\n\tmodified: src/environments/suport/oapr.ts",
"changeStatus": "On branch feature/gabinete-search\nYour branch is up to date with 'origin/feature/gabinete-search'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/models/dailyworktask.model.ts\n\tmodified: src/app/models/envarioment.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html\n\tmodified: src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts\n\tmodified: src/app/pages/login/login.page.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: src/app/shared/header/header.page.ts\n\tmodified: src/app/tiny-mce/tiny-mce.module.ts\n\tmodified: src/app/tiny-mce/tiny-mce.page.html\n\tmodified: src/app/tiny-mce/tiny-mce.page.scss\n\tmodified: src/app/tiny-mce/tiny-mce.page.ts\n\tmodified: src/environments/environment.ts\n\tmodified: src/environments/suport/dev.ts\n\tmodified: src/environments/suport/doneIt.ts\n\tmodified: src/environments/suport/oapr.ts",
"changeAuthor": "eudes.inacio"
}