mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
fix
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<!-- Toolbar -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<div>
|
||||
<div [class]="weeksToShow" >
|
||||
<!-- Calendar is here -->
|
||||
|
||||
<div class="calendar-segment-{{profile}}" [class.calendar-segment-pr-force]="SessionStore.user.Profile =='PR'">
|
||||
|
||||
@@ -1009,29 +1009,60 @@ $font-size: rem(15);
|
||||
|
||||
@media only screen and (min-width: 100px) {
|
||||
|
||||
.calendar-title-container {
|
||||
font-size: 14px;
|
||||
.week-5 {
|
||||
.calendar-title-container {
|
||||
font-size: 14px;
|
||||
}
|
||||
.height-75 {
|
||||
height: 75px;
|
||||
}
|
||||
|
||||
.height-356 {
|
||||
height: 324px;
|
||||
}
|
||||
}
|
||||
.height-75 {
|
||||
height: 75px;
|
||||
}
|
||||
|
||||
.height-356 {
|
||||
height: 324px;
|
||||
|
||||
.week-6 {
|
||||
.calendar-title-container {
|
||||
font-size: 14px;
|
||||
}
|
||||
.height-75 {
|
||||
height: 75px;
|
||||
}
|
||||
|
||||
.height-356 {
|
||||
height: 360px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 500px) {
|
||||
|
||||
.calendar-title-container {
|
||||
font-size: 16px;
|
||||
.week-5 {
|
||||
.calendar-title-container {
|
||||
font-size: 16px;
|
||||
}
|
||||
.height-75 {
|
||||
height: 75px;
|
||||
}
|
||||
|
||||
.height-356 {
|
||||
height: 356px;
|
||||
}
|
||||
}
|
||||
.height-75 {
|
||||
height: 75px;
|
||||
|
||||
.week-6 {
|
||||
.calendar-title-container {
|
||||
font-size: 16px;
|
||||
}
|
||||
.height-75 {
|
||||
height: 75px;
|
||||
}
|
||||
|
||||
.height-356 {
|
||||
height: 395px;
|
||||
}
|
||||
}
|
||||
|
||||
.height-356 {
|
||||
height: 356px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -287,6 +287,34 @@ export class AgendaPage implements OnInit {
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
weeksToShow = []
|
||||
|
||||
weekToShow() {
|
||||
let num = 0;
|
||||
|
||||
function Week(a) {
|
||||
for(let b of a.querySelectorAll('td')) {
|
||||
if(!b.className.includes('text-muted')) {
|
||||
num++;
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let a of document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr') as any ){
|
||||
Week(a)
|
||||
}
|
||||
|
||||
if(num <= 5) {
|
||||
|
||||
this.weeksToShow = ["week-5"]
|
||||
} else {
|
||||
|
||||
this.weeksToShow = ["week-6"]
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
setCalendarByDefault() {
|
||||
if(!this.CalendarName) {
|
||||
@@ -514,6 +542,8 @@ export class AgendaPage implements OnInit {
|
||||
loadRequestHistory: any = {}
|
||||
|
||||
loadRangeEvents(startTime: Date, endTime: Date) {
|
||||
this.weekToShow()
|
||||
|
||||
if(!this.eventService.hasAnyCalendar) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
<!-- Aside left -->
|
||||
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
||||
{{ TaskService.showLoaderNum }}
|
||||
<ion-progress-bar type="indeterminate" *ngIf="TaskService.showLoaderNum != 0"></ion-progress-bar>
|
||||
<div class="title-container">
|
||||
<div class="title d-flex justify-center">
|
||||
|
||||
@@ -17,6 +17,7 @@ import { Storage } from '@ionic/storage';
|
||||
// import { ActionModel } from 'src/app/models/beast-orm';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-publications',
|
||||
templateUrl: './publications.page.html',
|
||||
|
||||
+15
-2
@@ -10,6 +10,9 @@ import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-publication-detail',
|
||||
@@ -31,7 +34,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService,
|
||||
public p:PermissionService,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
public publicationFolderService: PublicationFolderService
|
||||
) {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
@@ -90,8 +94,13 @@ export class PublicationDetailPage implements OnInit {
|
||||
}
|
||||
this.showLoader = false;
|
||||
}, (error) => {
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
|
||||
if(error.status == 404) {
|
||||
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
|
||||
}
|
||||
|
||||
this.goBack();
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -120,8 +129,12 @@ export class PublicationDetailPage implements OnInit {
|
||||
window['app-view-publications-page-doRefresh']()
|
||||
}
|
||||
|
||||
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
if(error.status == 404) {
|
||||
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
<ion-icon class="font-35-em" *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon class="font-35-em" *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div *ngIf="publicationItem[folderId]?.DateBegin != null" class="div-title flex-grow-1">
|
||||
<p class="title font-25-em mb-10-em">{{publicationItem[folderId].Description}}</p>
|
||||
<p class="item-content-detail font-14-em">{{publicationItem[folderId].Detail}}</p>
|
||||
<p class="item-content-date font-13-em" >{{publicationItem[folderId].DateBegin | date: 'dd-MM-yy HH:mm'}}</p>
|
||||
<div *ngIf="publicationFolderService.FolderDetails[folderId]?.DateBegin != null" class="div-title flex-grow-1">
|
||||
<p class="title font-25-em mb-10-em">{{publicationFolderService.FolderDetails[folderId].Description}}</p>
|
||||
<p class="item-content-detail font-14-em">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
|
||||
<p class="item-content-date font-13-em" >{{publicationFolderService.FolderDetails[folderId].DateBegin | date: 'dd-MM-yy HH:mm'}}</p>
|
||||
</div>
|
||||
<div *ngIf="p.userPermission([p.permissionList.Actions.createPost]) && publicationItem[folderId]" class="cursor-pointer font-35-em" (click)="AddPublication('2',publicationItem[folderId].ProcessId)">
|
||||
<div *ngIf="p.userPermission([p.permissionList.Actions.createPost]) && publicationFolderService.FolderDetails[folderId]" class="cursor-pointer font-35-em" (click)="AddPublication('2',publicationFolderService.FolderDetails[folderId].ProcessId)">
|
||||
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
|
||||
@@ -29,8 +29,8 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-container background-white height-100 overflow-y-auto viewport-font-size">
|
||||
<ion-content *ngIf="publicationItem[folderId]">
|
||||
<ion-card *ngFor="let publication of publicationList[folderId] let i = index"
|
||||
<ion-content *ngIf="publicationFolderService.FolderDetails[folderId]">
|
||||
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index"
|
||||
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||
>
|
||||
<ion-card-content>
|
||||
|
||||
@@ -7,14 +7,15 @@ import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||
import { PublicationDetailPage } from './publication-detail/publication-detail.page';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { forkJoin } from 'rxjs';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
templateUrl: './view-publications.page.html',
|
||||
@@ -24,8 +25,6 @@ export class ViewPublicationsPage implements OnInit {
|
||||
showLoader = true;
|
||||
loading: any;
|
||||
|
||||
publicationList: {[key: string]: Publication[] } = {};
|
||||
publicationItem: {[key: string]: PublicationFolder } = {};
|
||||
|
||||
defaultImage = "/assets/icon/icon-no-image.svg";
|
||||
folderId: string;
|
||||
@@ -47,7 +46,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
public p: PermissionService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
private storage: Storage,) {
|
||||
private storage: Storage,
|
||||
public publicationFolderService: PublicationFolderService,) {
|
||||
|
||||
this.createPublicationList()
|
||||
|
||||
@@ -100,11 +100,11 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
|
||||
createPublicationList(folderId = this.folderId) {
|
||||
if(!this.publicationList[folderId]) {
|
||||
this.publicationList[folderId] = []
|
||||
if(!this.publicationFolderService.publicationList[folderId]) {
|
||||
this.publicationFolderService.publicationList[folderId] = []
|
||||
}
|
||||
if(!this.publicationItem[folderId]) {
|
||||
this.publicationItem[folderId] = new PublicationFolder();
|
||||
if(!this.publicationFolderService.FolderDetails[folderId]) {
|
||||
this.publicationFolderService.FolderDetails[folderId] = new PublicationFolder();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
const folderId = this.folderId
|
||||
this.publications.GetPresidentialAction(folderId).subscribe(res =>{
|
||||
|
||||
this.publicationItem[folderId] = res
|
||||
this.publicationFolderService.FolderDetails[folderId] = res
|
||||
this.storage.set(folderId+"name", res)
|
||||
}, (error) => {
|
||||
this.showLoader = false;
|
||||
@@ -143,12 +143,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
getFromDB() {
|
||||
const folderId = this.folderId
|
||||
this.storage.get(folderId).then((viewPublications) => {
|
||||
this.publicationList[folderId] = viewPublications
|
||||
})
|
||||
this.storage.get(folderId+"name").then((viewPublications) => {
|
||||
this.publicationItem[folderId] = viewPublications
|
||||
})
|
||||
this.publicationFolderService.getFromDB(folderId)
|
||||
}
|
||||
|
||||
async getPublicationsIds() {
|
||||
@@ -177,8 +172,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
this.storage.set(folderId, this.publicationList[folderId]);
|
||||
this.getpublication = this.publicationList[folderId];
|
||||
this.storage.set(folderId, this.publicationFolderService.publicationList[folderId]);
|
||||
this.getpublication = this.publicationFolderService.publicationList[folderId];
|
||||
} catch(error) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
@@ -186,13 +181,13 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
publicationIsPresent(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
return this.publicationFolderService.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
}
|
||||
publicationFind(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
return this.publicationFolderService.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
}
|
||||
publicationFindIndex(publicationId, folderId) {
|
||||
return this.publicationList[folderId].findIndex( e => e.DocumentId == publicationId )
|
||||
return this.publicationFolderService.publicationList[folderId].findIndex( e => e.DocumentId == publicationId )
|
||||
}
|
||||
|
||||
async loadPublication(publicationId, folderId) {
|
||||
@@ -202,9 +197,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
this.publicationFolderService.publicationList[folderId].push(publicationDetails)
|
||||
} else {
|
||||
this.publicationList[folderId][findIndex] = publicationDetails
|
||||
this.publicationFolderService.publicationList[folderId][findIndex] = publicationDetails
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user