mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Update publication page
This commit is contained in:
@@ -53,7 +53,8 @@ export class NewPublicationPage implements OnInit {
|
||||
private publications: PublicationsService,
|
||||
private camera: Camera,
|
||||
) {
|
||||
|
||||
|
||||
alert('!!!!!')
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
this.folderId = this.navParams.get('folderId');
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { PublicationsPage } from './publications.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
import { ViewPublicationsPage } from 'src/app/shared/publication/view-publications/view-publications.page';
|
||||
import { NewPublicationPage } from 'src/app/shared/publication/new-publication/new-publication.page';
|
||||
import { PublicationDetailPage } from 'src/app/shared/publication/publication-detail/publication-detail.page';
|
||||
import { PublicationDetailPage } from 'src/app/shared/publication/view-publications/publication-detail/publication-detail.page';
|
||||
import { NewActionPage } from 'src/app/shared/publication/new-action/new-action.page';
|
||||
|
||||
|
||||
|
||||
@@ -63,34 +63,45 @@
|
||||
<!-- Right -->
|
||||
<div class="d-none d-md-flex flex-grow-1 flex-column max-width-60"
|
||||
style="border-left: 1px solid #d8d8d8;">
|
||||
|
||||
<div class="width-100 height-100 d-flex align-center justify-center"
|
||||
*ngIf="(
|
||||
desktopComponent.showViewPublication == false &&
|
||||
desktopComponent.showAddNewPublication == false &&
|
||||
desktopComponent.showPublicationDetail == false &&
|
||||
desktopComponent.showAddActions == false
|
||||
)"><div>Nenhuma publicação delecionado</div></div>
|
||||
|
||||
<!-- View Publication -->
|
||||
<app-view-publications
|
||||
*ngIf="desktopComponent.showViewPublication"
|
||||
[folderId]="folderId"
|
||||
class="height-100 d-flex flex-column overflow-hidden"
|
||||
class="height-100 d-flex flex-column overflow-hidden flex-grow-1"
|
||||
(addNewPublication)="addNewPublication($event)"
|
||||
(openPublicationDetails)="openPublicationDetails($event)"
|
||||
>
|
||||
</app-view-publications>
|
||||
|
||||
<app-new-publication *ngIf="desktopComponent.showAddNewPublication"
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white"
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||
[folderId]="folderId"
|
||||
[publicationType]="publicationType"
|
||||
[publication]="publication"
|
||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||
>
|
||||
</app-new-publication>
|
||||
|
||||
<app-publication-detail-shared
|
||||
*ngIf="desktopComponent.showPublicationDetail"
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white"
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||
[publicationId]="publicationId"
|
||||
(addNewPublication)="addNewPublication($event)"
|
||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||
></app-publication-detail-shared>
|
||||
|
||||
<app-new-action
|
||||
*ngIf="desktopComponent.showAddActions"
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white"
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||
></app-new-action>
|
||||
|
||||
|
||||
@@ -40,9 +40,13 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
folderId: string;
|
||||
// data set from child component
|
||||
publicationType: any;
|
||||
publicationId: string;
|
||||
|
||||
// from publication details
|
||||
publication: object;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
@@ -178,13 +182,14 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async addNewPublication({publicationType, folderId}){
|
||||
async addNewPublication({publicationType, folderId, publication}){
|
||||
|
||||
this.closeDesktopComponent();
|
||||
|
||||
// propr to add new publication
|
||||
this.publicationType = publicationType;
|
||||
this.folderId = folderId;
|
||||
this.publication = publication;
|
||||
|
||||
this.desktopComponent.showAddNewPublication = true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import { LoadingService } from 'src/app/services/loading.service';
|
||||
})
|
||||
export class NewPublicationPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
publication: Publication;
|
||||
pub: Publication = new Publication();
|
||||
image: Image = new Image();
|
||||
|
||||
@@ -36,6 +35,7 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
photo: SafeResourceUrl;
|
||||
|
||||
@Input() publication: Publication;
|
||||
@Input() publicationType: string;
|
||||
@Input() folderId: string;
|
||||
@Output() closeDesktopComponent = new EventEmitter<any>();
|
||||
@@ -46,7 +46,6 @@ export class NewPublicationPage implements OnInit {
|
||||
capturedImage:any;
|
||||
capturedImageTitle:any;
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
public photoService: PhotoService,
|
||||
@@ -121,7 +120,7 @@ export class NewPublicationPage implements OnInit {
|
||||
console.log('Edit change image');
|
||||
console.log(this.publication);
|
||||
this.publications.UpdatePublication(this.publication.ProcessId, this.publication);
|
||||
this.close();
|
||||
this.closeDesktopComponent.emit();
|
||||
}
|
||||
else{
|
||||
this.publication = {
|
||||
@@ -138,7 +137,7 @@ export class NewPublicationPage implements OnInit {
|
||||
console.log('Edit - keep image');
|
||||
console.log(this.publication);
|
||||
this.publications.UpdatePublication(this.publication.ProcessId, this.publication);
|
||||
this.close();
|
||||
this.closeDesktopComponent.emit();
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -178,6 +177,7 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
else if(this.publicationType == '3'){
|
||||
this.publicationTitle = 'Editar Publicação';
|
||||
this.pub = this.publication;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+25
-14
@@ -16,7 +16,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
publication: Publication;
|
||||
|
||||
@Input() publicationId: string;
|
||||
|
||||
@Output() addNewPublication = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private publications:PublicationsService,
|
||||
@@ -85,21 +86,31 @@ export class PublicationDetailPage implements OnInit {
|
||||
|
||||
async editPost(publicationType:any) {
|
||||
console.log(this.publication);
|
||||
const modal = await this.modalController.create({
|
||||
component: NewPublicationPage,
|
||||
componentProps:{
|
||||
|
||||
if(window.innerHeight >= 1024){
|
||||
const modal = await this.modalController.create({
|
||||
component: NewPublicationPage,
|
||||
componentProps:{
|
||||
publicationType: publicationType,
|
||||
publication: this.publication,
|
||||
},
|
||||
cssClass: 'new-publication',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
setTimeout(() => {
|
||||
this.getPublicationDetail();
|
||||
}, 5000);
|
||||
});
|
||||
} else {
|
||||
this.addNewPublication.emit({
|
||||
publicationType: publicationType,
|
||||
folderId: this.folderId,
|
||||
publication: this.publication,
|
||||
},
|
||||
cssClass: 'new-publication',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
setTimeout(() => {
|
||||
this.getPublicationDetail();
|
||||
}, 5000);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
openPreview(imageUrl:string){
|
||||
Reference in New Issue
Block a user