Search solved, aprove envent and remove from home the serviceworker

This commit is contained in:
Eudes Inácio
2023-08-15 18:09:03 +01:00
parent ae2701cbcd
commit 61a2b78eec
6 changed files with 422 additions and 345 deletions
+2 -2
View File
@@ -124,12 +124,12 @@ export class HomePage implements OnInit {
} }
navigator.serviceWorker.ready.then((registration) => { /* navigator.serviceWorker.ready.then((registration) => {
console.log('yes please') console.log('yes please')
registration.active.postMessage( registration.active.postMessage(
"Test message sent immediately after creation", "Test message sent immediately after creation",
); );
}); }); */
} }
@@ -82,7 +82,7 @@
<div *ngIf="loadedEvent.workflowInstanceDataFields.Body"> <div *ngIf="loadedEvent.workflowInstanceDataFields.Body">
<h5 class="font-17-rem">Detalhes</h5> <h5 class="font-17-rem">Detalhes</h5>
<ion-item lines="none" class="ion-no-margin ion-no-padding"> <ion-item lines="none" class="ion-no-margin ion-no-padding">
<pre class="width-100 text">{{loadedEvent.workflowInstanceDataFields.Body }} </pre> <pre class="text scrollable-pre">{{loadedEvent.workflowInstanceDataFields.Body }} </pre>
</ion-item> </ion-item>
<div class="line"></div> <div class="line"></div>
</div> </div>
@@ -41,6 +41,7 @@ ion-menu{
/* overflow: auto; /* overflow: auto;
width: 100%; */ width: 100%; */
border-right: 1px solid #d8d8d8; border-right: 1px solid #d8d8d8;
background: white;
.upper-content{ .upper-content{
margin-left: 40px; margin-left: 40px;
@@ -220,6 +221,11 @@ ion-menu{
} }
} }
.scrollable-pre {
max-height: 300px;
overflow-y: auto; /* Add vertical scroll if content exceeds max height */
}
@media only screen and (min-width: 1140px){ @media only screen and (min-width: 1140px){
.content{ .content{
width: 75%; width: 75%;
+1
View File
@@ -230,6 +230,7 @@ ion-slide{
font-size: rem(20); font-size: rem(20);
text-align: center; text-align: center;
color: black; color: black;
margin-bottom: 25px;
} }
.most-searched-word-container{ .most-searched-word-container{
+181 -111
View File
@@ -62,7 +62,7 @@ export class SearchPage implements OnInit {
searchCategories: SearchCategory[] = []; searchCategories: SearchCategory[] = [];
showSearchDocuments: SearchList[] = []; showSearchDocuments: SearchList[] = [];
showCategory: string; showCategory: string;
searchDocuments: SearchList[] =[]; searchDocuments: SearchList[] = [];
showDocuments = false; showDocuments = false;
showAdvanceSearch = false; showAdvanceSearch = false;
@@ -74,18 +74,18 @@ export class SearchPage implements OnInit {
// See http://idangero.us/swiper/api/ for valid options. // See http://idangero.us/swiper/api/ for valid options.
slideOpts = { slideOpts = {
slidesPerView: parseInt(`${window.innerWidth/147}`, 10), slidesPerView: parseInt(`${window.innerWidth / 147}`, 10),
initialSlide: 0, initialSlide: 0,
speed: 400, speed: 400,
} }
loadedAttachments:any; loadedAttachments: any;
list = [] list = []
windowWidth: number; windowWidth: number;
type : "Agenda" | "Correspondencia" | "AccoesPresidenciais" | "ArquivoDespachoElect" | "AccoesPresidenciais & ArquivoDespachoElect" = "Agenda"; type: "Agenda" | "Correspondencia" | "AccoesPresidenciais" | "ArquivoDespachoElect" | "AccoesPresidenciais & ArquivoDespachoElect" = "Agenda";
select: boolean = false; select: boolean = false;
showSearchInput = false showSearchInput = false
@@ -99,10 +99,9 @@ export class SearchPage implements OnInit {
private navParams: NavParams, private navParams: NavParams,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private router: Router, private router: Router,
private httpErrorhandle: HttpErrorHandle) private httpErrorhandle: HttpErrorHandle) {
{
this.ordinance = "recent"; this.ordinance = "recent";
this.currentPath= window.location.pathname; this.currentPath = window.location.pathname;
this.type = this.navParams.get('type'); this.type = this.navParams.get('type');
@@ -111,9 +110,9 @@ export class SearchPage implements OnInit {
this.showSearchInput = this.navParams.get('showSearchInput'); this.showSearchInput = this.navParams.get('showSearchInput');
if(this.type == null || this.type == undefined) { if (this.type == null || this.type == undefined) {
if(this.currentPath.includes('/home/agenda')) { if (this.currentPath.includes('/home/agenda')) {
this.type = "Agenda" this.type = "Agenda"
} else if (this.currentPath.includes('/home/gabinete-digital')) { } else if (this.currentPath.includes('/home/gabinete-digital')) {
this.type = "AccoesPresidenciais & ArquivoDespachoElect" this.type = "AccoesPresidenciais & ArquivoDespachoElect"
@@ -127,7 +126,7 @@ export class SearchPage implements OnInit {
} }
selectItem(item: SearchList) { selectItem(item: SearchList) {
if(this.select){ if (this.select) {
this.modalController.dismiss({ this.modalController.dismiss({
selected: item selected: item
}); });
@@ -139,7 +138,7 @@ export class SearchPage implements OnInit {
const ApplicationType = item.ApplicationType.toString() const ApplicationType = item.ApplicationType.toString()
const Id = item.Id const Id = item.Id
if(ApplicationType == '8' ) { if (ApplicationType == '8') {
// this.viewDocumentDetail(Id, ApplicationType); // this.viewDocumentDetail(Id, ApplicationType);
@@ -191,7 +190,7 @@ export class SearchPage implements OnInit {
this.windowWidth = window.innerWidth this.windowWidth = window.innerWidth
window['dynamicSearch'] = (search:string) => { window['dynamicSearch'] = (search: string) => {
this.searchSubject = search; this.searchSubject = search;
} }
@@ -203,10 +202,10 @@ export class SearchPage implements OnInit {
wordCloud() { wordCloud() {
this.search.mostSeachWord("15").subscribe( res => { this.search.mostSeachWord("15").subscribe(res => {
const highest= res[0].Hits; const highest = res[0].Hits;
const lowest = res[res.length-1].Hits; const lowest = res[res.length - 1].Hits;
const range = highest - lowest; const range = highest - lowest;
const perPercent = range / 100; const perPercent = range / 100;
let list = []; let list = [];
@@ -221,7 +220,7 @@ export class SearchPage implements OnInit {
res.forEach(e => { res.forEach(e => {
const array: any = Object.values(e); const array: any = Object.values(e);
array[1] = (((array[1] - lowest) / perPercent) * (maximum - minimumSize)/ 100 ) + minimumSize; array[1] = (((array[1] - lowest) / perPercent) * (maximum - minimumSize) / 100) + minimumSize;
list.push(array) list.push(array)
}); });
@@ -250,7 +249,7 @@ export class SearchPage implements OnInit {
const minutes = date.getMinutes(); const minutes = date.getMinutes();
date.setSeconds(0); date.setSeconds(0);
if(minutes % 15 != 0) { if (minutes % 15 != 0) {
if (minutes > 45) { if (minutes > 45) {
date.setMinutes(60) date.setMinutes(60)
@@ -268,7 +267,7 @@ export class SearchPage implements OnInit {
} }
clickDate() { clickDate() {
if(!this.searchDocumentDate) { if (!this.searchDocumentDate) {
this.searchDocumentDate = this.roundTimeQuarterHour() this.searchDocumentDate = this.roundTimeQuarterHour()
} }
} }
@@ -304,7 +303,7 @@ export class SearchPage implements OnInit {
this.ordinance = orderBy; this.ordinance = orderBy;
if(this.ordinance == 'recent'){ if (this.ordinance == 'recent') {
this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments).reverse(); this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments).reverse();
} else { } else {
this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments) this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments)
@@ -312,7 +311,7 @@ export class SearchPage implements OnInit {
} }
sortArrayISODate(myArray: any) { sortArrayISODate(myArray: any) {
return myArray.sort(function(a, b) { return myArray.sort(function (a, b) {
return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0); return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0);
}); });
} }
@@ -330,18 +329,28 @@ export class SearchPage implements OnInit {
searchDocumentDate; searchDocumentDate;
if(this.searchSubject == undefined || this.searchSubject == null) { if (this.searchSubject == undefined || this.searchSubject == null) {
this.searchSubject = "" this.searchSubject = ""
} }
if(this.type == "Agenda" ) { if (this.type == "Agenda") {
if (this.searchSubject.trim() == "" && searchDocumentDate == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) {
this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa";
console.log('enter text');
} else {
this.showLoader = true; this.showLoader = true;
this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId
,this.searchOrganicEntiryCode, this.searchDocTypeId, '0').subscribe(res=>{ , this.searchOrganicEntiryCode, this.searchDocTypeId, '0').subscribe(res => {
res.Categories.forEach( e => { if (!res.Categories.length) {
this.searchResult = "Não encontramos o que procura";
}
res.Categories.forEach(e => {
e['Active'] = false; e['Active'] = false;
}); });
@@ -353,7 +362,7 @@ export class SearchPage implements OnInit {
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
// hide show document // hide show document
if(this.searchDocuments.length >= 1) { if (this.searchDocuments.length >= 1) {
this.showDocuments = true; this.showDocuments = true;
} else { } else {
this.showDocuments = false this.showDocuments = false
@@ -362,29 +371,37 @@ export class SearchPage implements OnInit {
this.showLoader = false; this.showLoader = false;
this.loadWordCloud(); this.loadWordCloud();
},error => { }, error => {
this.showLoader = false; this.showLoader = false;
// this.searchResult = "Registo não encontrado" // this.searchResult = "Registo não encontrado"
this.httpErrorhandle.httpStatusHandle(error) this.httpErrorhandle.httpStatusHandle(error)
// console.log(error) // console.log(error)
}); });
} }
else if ( this.type == "AccoesPresidenciais & ArquivoDespachoElect") { }
else if (this.type == "AccoesPresidenciais & ArquivoDespachoElect") {
this.showLoader = true;
this.searchCategories = []; this.searchCategories = [];
this.searchDocuments = []; this.searchDocuments = [];
this.showSearchDocuments = []; this.showSearchDocuments = [];
if(this.select) { if (this.select) {
let counter = 0; let counter = 0;
if (this.searchSubject.trim() == "" && searchDocumentDate == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) {
this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa";
console.log('enter text');
} else {
this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId
,this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => { , this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => {
this.showLoader = true;
if (!res.Categories.length) {
this.searchResult = "Não encontramos o que procura";
}
res.Categories.forEach( e => { res.Categories.forEach(e => {
e['Active'] = false; e['Active'] = false;
this.searchCategories.push(e) this.searchCategories.push(e)
}); });
@@ -399,31 +416,41 @@ export class SearchPage implements OnInit {
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
// hide show document // hide show document
if(this.searchDocuments.length >= 1){ if (this.searchDocuments.length >= 1) {
this.showDocuments = true; this.showDocuments = true;
} else { } else {
this.showDocuments = false this.showDocuments = false
} }
counter++; counter++;
if(counter ==2){ if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
this.loadWordCloud(); this.loadWordCloud();
},error => { }, error => {
this.searchResult = "Registo não encontrado" this.searchResult = "Registo não encontrado"
counter++; counter++;
console.log('application 8 failed', error) console.log('application 8 failed', error)
if(counter ==2) { if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
}); });
}
if (this.searchSubject.trim() == "" && searchDocumentDate == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) {
this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa";
console.log('enter text');
} else {
this.showLoader = true;
this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId
,this.searchOrganicEntiryCode, this.searchDocTypeId, '361').subscribe(res=>{ , this.searchOrganicEntiryCode, this.searchDocTypeId, '361').subscribe(res => {
if (!res.Categories.length) {
this.searchResult = "Não encontramos o que procura";
}
res.Categories.forEach( e => { res.Categories.forEach(e => {
e['Active'] = false; e['Active'] = false;
this.searchCategories.push(e) this.searchCategories.push(e)
}); });
@@ -437,7 +464,7 @@ export class SearchPage implements OnInit {
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
// hide show document // hide show document
if(this.searchDocuments.length >= 1){ if (this.searchDocuments.length >= 1) {
this.showDocuments = true; this.showDocuments = true;
} else { } else {
this.showDocuments = false this.showDocuments = false
@@ -446,26 +473,36 @@ export class SearchPage implements OnInit {
this.loadWordCloud(); this.loadWordCloud();
counter++; counter++;
if(counter ==2){ if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
},error => { }, error => {
counter++; counter++;
if(counter ==2) { if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
this.searchResult = "Registo não encontrado" this.searchResult = "Registo não encontrado"
console.log('application 361 failed', error); console.log('application 361 failed', error);
}); });
}
} else { } else {
let counter = 0; let counter = 0;
if (this.searchSubject.trim() == "" && searchDocumentDate == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) {
this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa";
console.log('enter text');
} else {
this.showLoader = true;
this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId
,this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => { , this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => {
res.Categories.forEach( e => { if (!res.Categories.length) {
this.searchResult = "Não encontramos o que procura";
}
res.Categories.forEach(e => {
e['Active'] = false; e['Active'] = false;
this.searchCategories.push(e) this.searchCategories.push(e)
}); });
@@ -480,7 +517,7 @@ export class SearchPage implements OnInit {
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
// hide show document // hide show document
if(this.searchDocuments.length >= 1){ if (this.searchDocuments.length >= 1) {
this.showDocuments = true; this.showDocuments = true;
} else { } else {
this.showDocuments = false this.showDocuments = false
@@ -488,25 +525,34 @@ export class SearchPage implements OnInit {
counter++; counter++;
if(counter ==2){ if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
this.loadWordCloud(); this.loadWordCloud();
},error => { }, error => {
console.log('application 8 failed', error) console.log('application 8 failed', error)
this.searchResult = "Registo não encontrado" this.searchResult = "Registo não encontrado"
counter++; counter++;
if(counter ==2){ if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
}); });
}
if (this.searchSubject.trim() == "" && searchDocumentDate == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) {
this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa";
console.log('enter text');
} else {
this.showLoader = true;
this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId
,this.searchOrganicEntiryCode, this.searchDocTypeId, '361').subscribe(res => { , this.searchOrganicEntiryCode, this.searchDocTypeId, '361').subscribe(res => {
if (!res.Categories.length) {
this.searchResult = "Não encontramos o que procura";
}
res.Categories.forEach( e => { res.Categories.forEach(e => {
e['Active'] = false; e['Active'] = false;
this.searchCategories.push(e) this.searchCategories.push(e)
}); });
@@ -520,7 +566,7 @@ export class SearchPage implements OnInit {
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
// hide show document // hide show document
if(this.searchDocuments.length >= 1) { if (this.searchDocuments.length >= 1) {
this.showDocuments = true; this.showDocuments = true;
} else { } else {
this.showDocuments = false this.showDocuments = false
@@ -529,39 +575,46 @@ export class SearchPage implements OnInit {
counter++; counter++;
if(counter ==2){ if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
this.loadWordCloud(); this.loadWordCloud();
},error => { }, error => {
this.searchResult = "Registo não encontrado" this.searchResult = "Registo não encontrado"
counter++; counter++;
console.log('application 361 faield', error); console.log('application 361 faield', error);
if(counter ==2){ if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
}); });
} }
} }
}
else if ( this.type == "Correspondencia"){ else if (this.type == "Correspondencia") {
this.showLoader = true;
this.searchCategories = []; this.searchCategories = [];
this.searchDocuments = []; this.searchDocuments = [];
this.showSearchDocuments = []; this.showSearchDocuments = [];
if(this.select) { if (this.select) {
let counter = 0; let counter = 0;
if (this.searchSubject.trim() == "" && searchDocumentDate == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) {
this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa";
console.log('enter text');
} else {
this.showLoader = true;
this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId this.search.searchForDoc(this.searchSubject, searchDocumentDate, this.searchSenderId
,this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res=>{ , this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => {
if (!res.Categories.length) {
this.searchResult = "Não encontramos o que procura";
}
res.Categories.forEach( e => { res.Categories.forEach(e => {
e['Active'] = false; e['Active'] = false;
this.searchCategories.push(e) this.searchCategories.push(e)
}); });
@@ -576,30 +629,39 @@ export class SearchPage implements OnInit {
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
// hide show document // hide show document
if(this.searchDocuments.length >= 1){ if (this.searchDocuments.length >= 1) {
this.showDocuments = true; this.showDocuments = true;
} else { } else {
this.showDocuments = false this.showDocuments = false
} }
counter++; counter++;
if(counter ==2){ if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
this.showLoader = false; this.showLoader = false;
this.loadWordCloud(); this.loadWordCloud();
},error => { }, error => {
this.searchResult = "Registo não encontrado" this.searchResult = "Registo não encontrado"
console.log(error) console.log(error)
}); });
}
} else { } else {
let counter = 0; let counter = 0;
if (this.searchSubject.trim() == "" && searchDocumentDate == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) {
this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa";
console.log('enter text');
} else {
this.showLoader = true;
this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId this.search.basicSearch(this.searchSubject, searchDocumentDate, this.searchSenderId
,this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res=>{ , this.searchOrganicEntiryCode, this.searchDocTypeId, '8').subscribe(res => {
if (!res.Categories.length) {
this.searchResult = "Não encontramos o que procura";
}
res.Categories.forEach( e => { res.Categories.forEach(e => {
e['Active'] = false; e['Active'] = false;
this.searchCategories.push(e) this.searchCategories.push(e)
}); });
@@ -614,7 +676,7 @@ export class SearchPage implements OnInit {
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
// hide show document // hide show document
if(this.searchDocuments.length >= 1){ if (this.searchDocuments.length >= 1) {
this.showDocuments = true; this.showDocuments = true;
} else { } else {
this.showDocuments = false this.showDocuments = false
@@ -622,15 +684,15 @@ export class SearchPage implements OnInit {
counter++; counter++;
if(counter ==2) { if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
this.loadWordCloud(); this.loadWordCloud();
},error => { }, error => {
counter++; counter++;
if(counter ==2) { if (counter == 2) {
this.showLoader = false; this.showLoader = false;
} }
this.searchResult = "Registo não encontrado" this.searchResult = "Registo não encontrado"
@@ -638,12 +700,11 @@ export class SearchPage implements OnInit {
}); });
} }
} }
}
else if (this.type == "AccoesPresidenciais") { else if (this.type == "AccoesPresidenciais") {
let counter = 0; let counter = 0;
this.showLoader = true;
this.searchCategories = [] this.searchCategories = []
this.searchDocuments = [] this.searchDocuments = []
@@ -693,26 +754,34 @@ export class SearchPage implements OnInit {
// }); // });
if (this.searchSubject.trim() == "" && searchDocumentDate == null && this.searchSenderId == null && this.searchOrganicEntiryCode == null && this.searchDocTypeId == null) {
this.searchResult = "Campo de pesquisa esta vazio, entre com assunto que deseja pesquisa";
console.log('enter text');
} else {
this.showLoader = true;
this.search.basicSearchPublication(this.searchSubject, searchDocumentDate, this.searchSenderId this.search.basicSearchPublication(this.searchSubject, searchDocumentDate, this.searchSenderId
,this.searchOrganicEntiryCode, this.searchDocTypeId, '386').subscribe(res => { , this.searchOrganicEntiryCode, this.searchDocTypeId, '386').subscribe(res => {
if (!res.Categories.length) {
this.searchResult = "Não encontramos o que procura";
}
res.Categories.forEach( e => { res.Categories.forEach(e => {
e['Active'] = false; e['Active'] = false;
e['Name'] = "Acções" e['Name'] = "Acções"
}); });
if(!environment.presidential) { if (!environment.presidential) {
// bind respose // bind respose
for ( const a of res.Categories) { for (const a of res.Categories) {
this.searchCategories.push(a); this.searchCategories.push(a);
} }
} }
for ( const a of this.sortArrayISODate(res.Documents)) { for (const a of this.sortArrayISODate(res.Documents)) {
a.DocTypeDesc = "Acções" a.DocTypeDesc = "Acções"
this.searchDocuments.push(a); this.searchDocuments.push(a);
} }
@@ -720,7 +789,7 @@ export class SearchPage implements OnInit {
this.reorderList(this.ordinance); this.reorderList(this.ordinance);
// hide show document // hide show document
if(this.searchDocuments.length >= 1) { if (this.searchDocuments.length >= 1) {
this.showDocuments = true; this.showDocuments = true;
} else { } else {
this.showDocuments = false this.showDocuments = false
@@ -738,6 +807,7 @@ export class SearchPage implements OnInit {
this.searchResult = "Registo não encontrado" this.searchResult = "Registo não encontrado"
console.log(error) console.log(error)
}); });
}
} }
@@ -761,20 +831,20 @@ export class SearchPage implements OnInit {
* @returns date in format dd/MM/yyyy * @returns date in format dd/MM/yyyy
* @description convert Iso date to dd/MM/yyyy * @description convert Iso date to dd/MM/yyyy
*/ */
formateIsoDate(isoDate:string): string{ formateIsoDate(isoDate: string): string {
const date = new Date(isoDate); const date = new Date(isoDate);
return formatDate(date, 'dd/MM/yyyy', 'pt'); return formatDate(date, 'dd/MM/yyyy', 'pt');
} }
activeCategoty(i){ activeCategoty(i) {
this.searchCategories.forEach((e, j) => { this.searchCategories.forEach((e, j) => {
if(i != j){ if (i != j) {
e['Active'] = false; e['Active'] = false;
} }
}) })
if (this.searchCategories[i]['Active']){ if (this.searchCategories[i]['Active']) {
this.searchCategories[i]['Active'] = false; this.searchCategories[i]['Active'] = false;
} else { } else {
this.searchCategories[i]['Active'] = true this.searchCategories[i]['Active'] = true
@@ -788,7 +858,7 @@ export class SearchPage implements OnInit {
clearInputOrganicEntity(){ clearInputOrganicEntity() {
this.searchOrganicEntiryDescription = ""; this.searchOrganicEntiryDescription = "";
this.searchOrganicEntiryCode = null; this.searchOrganicEntiryCode = null;
} }
@@ -796,14 +866,14 @@ export class SearchPage implements OnInit {
/** /**
* @description Clean inputs * @description Clean inputs
*/ */
showHideAdvanceSearch(show:boolean) { showHideAdvanceSearch(show: boolean) {
this.showAdvanceSearch = show; this.showAdvanceSearch = show;
} }
async openAdvanceSearchSelection() { async openAdvanceSearchSelection() {
let classs; let classs;
if( window.innerWidth <= 1024){ if (window.innerWidth <= 1024) {
classs = 'modal modal-desktop' classs = 'modal modal-desktop'
} else { } else {
classs = 'search-desktop-modal search-submodal' classs = 'search-desktop-modal search-submodal'
@@ -830,7 +900,7 @@ export class SearchPage implements OnInit {
async openOrganicEntitySelection() { async openOrganicEntitySelection() {
let classs; let classs;
if( window.innerWidth <= 1024){ if (window.innerWidth <= 1024) {
classs = 'modal modal-desktop' classs = 'modal modal-desktop'
} else { } else {
classs = 'search-desktop-modal search-submodal' classs = 'search-desktop-modal search-submodal'
@@ -845,7 +915,7 @@ export class SearchPage implements OnInit {
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
console.log('SerachEntity',data.data ) console.log('SerachEntity', data.data)
this.searchOrganicEntiryDescription = data.data.Description; this.searchOrganicEntiryDescription = data.data.Description;
this.searchOrganicEntiryCode = data.data.Code; this.searchOrganicEntiryCode = data.data.Code;
}); });
@@ -855,10 +925,10 @@ export class SearchPage implements OnInit {
} }
TodosCategory = true TodosCategory = true
async filterDocList(categoryName:string){ async filterDocList(categoryName: string) {
// show all category // show all category
if(this. showCategory == categoryName ){ if (this.showCategory == categoryName) {
this.showSearchDocuments = this.searchDocuments; this.showSearchDocuments = this.searchDocuments;
@@ -868,8 +938,8 @@ export class SearchPage implements OnInit {
this.showCategory = categoryName; this.showCategory = categoryName;
for(let category of this.searchCategories) { for (let category of this.searchCategories) {
if(category['Active']) { if (category['Active']) {
this.TodosCategory = false this.TodosCategory = false
return false return false
} }
@@ -883,7 +953,7 @@ export class SearchPage implements OnInit {
noFilter() { noFilter() {
this.TodosCategory = true this.TodosCategory = true
let n = 0 let n = 0
for(let category of this.searchCategories) { for (let category of this.searchCategories) {
this.searchCategories[n]['Active'] = false this.searchCategories[n]['Active'] = false
n++ n++
} }
@@ -891,12 +961,12 @@ export class SearchPage implements OnInit {
} }
itemIcons(): string{ itemIcons(): string {
return this.type return this.type
} }
viewDocument(){ viewDocument() {
const url: string = this.loadedAttachments.DocumentURL.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); const url: string = this.loadedAttachments.DocumentURL.replace("webTRIX.Viewer", "webTRIX.Viewer.Branch1");
// const browser = this.iab.create(url,"_blank"); // const browser = this.iab.create(url,"_blank");
// browser.show(); // browser.show();
} }
@@ -909,8 +979,8 @@ export class SearchPage implements OnInit {
const CalendarId = searchDocument.ApplicationName.split(':')[1] const CalendarId = searchDocument.ApplicationName.split(':')[1]
const DocTypeDesc = searchDocument.DocTypeDesc const DocTypeDesc = searchDocument.DocTypeDesc
if(this.select == false) { if (this.select == false) {
if(this.type == "Agenda") { if (this.type == "Agenda") {
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: ViewEventPage, component: ViewEventPage,
@@ -923,16 +993,16 @@ export class SearchPage implements OnInit {
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop',
}); });
modal.onDidDismiss().then((res)=>{}); modal.onDidDismiss().then((res) => { });
await modal.present(); await modal.present();
} else if(this.type == "AccoesPresidenciais") { } else if (this.type == "AccoesPresidenciais") {
this.viewPublicationDetail(Id, DocTypeDesc); this.viewPublicationDetail(Id, DocTypeDesc);
} }
else if(this.type == "AccoesPresidenciais & ArquivoDespachoElect") { else if (this.type == "AccoesPresidenciais & ArquivoDespachoElect") {
// 361 // 361
if(ApplicationType == '8') { if (ApplicationType == '8') {
this.viewDocumentDetail(Id, ApplicationType); this.viewDocumentDetail(Id, ApplicationType);
} else if (ApplicationType == '361') { } else if (ApplicationType == '361') {
this.viewDocumentModal(searchDocument) this.viewDocumentModal(searchDocument)
@@ -941,15 +1011,15 @@ export class SearchPage implements OnInit {
} }
} }
async viewPublicationDetail(publicationId:string, DocTypeDesc) { async viewPublicationDetail(publicationId: string, DocTypeDesc) {
// validation my friend // validation my friend
if(DocTypeDesc == 'Acções') { if (DocTypeDesc == 'Acções') {
this.router.navigate(['/home/publications', publicationId]); this.router.navigate(['/home/publications', publicationId]);
} else if( DocTypeDesc == 'Publicações') { } else if (DocTypeDesc == 'Publicações') {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: PublicationDetailPage, component: PublicationDetailPage,
componentProps:{ componentProps: {
publicationId: publicationId, publicationId: publicationId,
isModal: true isModal: true
}, },
@@ -958,7 +1028,7 @@ export class SearchPage implements OnInit {
}); });
modal.onDidDismiss().then(()=>{}); modal.onDidDismiss().then(() => { });
await modal.present(); await modal.present();
} }
@@ -966,10 +1036,10 @@ export class SearchPage implements OnInit {
} }
async viewDocumentDetail(docId:string, applicationId:string) { async viewDocumentDetail(docId: string, applicationId: string) {
let classs; let classs;
if( window.innerWidth < 701) { if (window.innerWidth < 701) {
classs = 'modal modal-desktop' classs = 'modal modal-desktop'
} else { } else {
classs = 'modal modal-desktop showAsideOptions' classs = 'modal modal-desktop showAsideOptions'
@@ -977,14 +1047,14 @@ export class SearchPage implements OnInit {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: DocumentDetailPage, component: DocumentDetailPage,
componentProps:{ componentProps: {
docId: docId, docId: docId,
applicationId: applicationId, applicationId: applicationId,
}, },
cssClass: classs, cssClass: classs,
}); });
modal.onDidDismiss().then((res)=>{}); modal.onDidDismiss().then((res) => { });
await modal.present(); await modal.present();
@@ -1018,7 +1088,7 @@ export class SearchPage implements OnInit {
}, },
Document: LoadedDocument, Document: LoadedDocument,
applicationId: task.workflowInstanceDataFields.SourceSecFsID, applicationId: task.workflowInstanceDataFields.SourceSecFsID,
docId: task.workflowInstanceDataFields.SourceID , docId: task.workflowInstanceDataFields.SourceID,
folderId: '', folderId: '',
task: task task: task
}, },
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "833a4df72", "shortSHA": "ae2701cbc",
"SHA": "833a4df72f624fbaa3368bf89a05351eb1859a70", "SHA": "ae2701cbcd02b0d0331f13927bc26d36d0752167",
"branch": "developer", "branch": "developer",
"lastCommitAuthor": "'Eudes Inácio'", "lastCommitAuthor": "'Eudes Inácio'",
"lastCommitTime": "'Tue Aug 15 12:42:40 2023 +0100'", "lastCommitTime": "'Tue Aug 15 12:44:53 2023 +0100'",
"lastCommitMessage": "date format solved and intevinets text correted", "lastCommitMessage": "pull made",
"lastCommitNumber": "5157", "lastCommitNumber": "5160",
"change": "", "change": "",
"changeStatus": "On branch developer\nYour branch and 'origin/developer' have diverged,\nand have 2 and 2 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/pages/agenda/agenda.page.html\n\tmodified: src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts\n\tmodified: src/app/pages/chat/messages/contacts/contacts.page.html\n\tmodified: src/app/pages/chat/messages/contacts/contacts.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.html\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.ts\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.html", "changeStatus": "On branch developer\nYour branch is ahead of 'origin/developer' by 3 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: src/app/home/home.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.scss\n\tmodified: src/app/pages/search/search.page.scss\n\tmodified: src/app/pages/search/search.page.ts\n\tmodified: version/git-version.ts",
"changeAuthor": "eudes.inacio" "changeAuthor": "eudes.inacio"
} }