fix go back

This commit is contained in:
Peter Maquiran
2024-04-11 09:13:30 +01:00
parent fe29ee3bc5
commit 91a5a8796f
10 changed files with 87 additions and 25 deletions
+9
View File
@@ -0,0 +1,9 @@
export const Cy = {
p: {
login: {
b: {
enter: 'loginbutton'
}
}
}
}
+2 -1
View File
@@ -34,7 +34,7 @@ import { environment } from 'src/environments/environment';
import { RoleIdService } from 'src/app/services/role-id.service' import { RoleIdService } from 'src/app/services/role-id.service'
import { EventListStore } from 'src/app/models/agenda/AgendaEventList'; import { EventListStore } from 'src/app/models/agenda/AgendaEventList';
import { ContactsService } from 'src/app/services/contacts.service'; import { ContactsService } from 'src/app/services/contacts.service';
import { Cy } from 'cypress/enum'
@Component({ @Component({
selector: 'app-agenda', selector: 'app-agenda',
templateUrl: './agenda.page.html', templateUrl: './agenda.page.html',
@@ -63,6 +63,7 @@ export class AgendaPage implements OnInit {
contacts: EventPerson[] contacts: EventPerson[]
todayDateFormated: string; todayDateFormated: string;
Cy = Cy
setView(view: CalendarView) { setView(view: CalendarView) {
this.view = view; this.view = view;
+1 -1
View File
@@ -31,7 +31,7 @@
</div> </div>
</ion-item> </ion-item>
<div class="d-flex pt-25"> <div class="d-flex pt-25">
<button class="btn-ok btn-login" fill="clear" expand="block" shape="round" (click)="Login()">Iniciar a sessão</button> <button class="btn-ok btn-login {{ Cy.p.login.b.enter }}" fill="clear" expand="block" shape="round" (click)="Login()">Iniciar a sessão</button>
</div> </div>
</form> </form>
<div class="msg-bottom d-flex"> <div class="msg-bottom d-flex">
+2
View File
@@ -22,6 +22,7 @@ import { Storage } from '@ionic/storage';
import { CPSession } from 'src/app/store/documentManagement'; import { CPSession } from 'src/app/store/documentManagement';
import { StorageService } from 'src/app/services/storage.service'; import { StorageService } from 'src/app/services/storage.service';
import { DeviceService } from 'src/app/services/device.service' import { DeviceService } from 'src/app/services/device.service'
import { Cy } from 'cypress/enum'
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
templateUrl: './login.page.html', templateUrl: './login.page.html',
@@ -41,6 +42,7 @@ export class LoginPage implements OnInit {
sessionStore = SessionStore; sessionStore = SessionStore;
showPassword = false; showPassword = false;
passwordIcon = "eye"; passwordIcon = "eye";
Cy = Cy
constructor( constructor(
private notificatinsservice: NotificationsService, private notificatinsservice: NotificationsService,
@@ -39,6 +39,7 @@ import { PublicationFromMvService } from "src/app/shared/publication/upload/publ
import { File } from '../../../models/chatMethod'; import { File } from '../../../models/chatMethod';
import { CropImagePage } from 'src/app/modals/crop-image/crop-image.page'; import { CropImagePage } from 'src/app/modals/crop-image/crop-image.page';
const config = { const config = {
quality: 0.5, quality: 0.5,
maxWidth: 800, maxWidth: 800,
@@ -142,6 +143,8 @@ export class NewPublicationPage implements OnInit {
private router: Router, private router: Router,
private videoconvertService: VideoconvertService, private videoconvertService: VideoconvertService,
public PublicationFromMvService: PublicationFromMvService, public PublicationFromMvService: PublicationFromMvService,
public publicationFolderService: PublicationFolderService,
) { ) {
this.PublicationFromMvService.clear() this.PublicationFromMvService.clear()
@@ -407,9 +410,37 @@ export class NewPublicationPage implements OnInit {
close() { close() {
this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { if (window["sharedContent"]) {
this.showLoader = true;
}); if (this.platform.is('android')) {
window["sharedContent"] = null;
this.publicationFolderService.gotoAction = this.folderId;
this.modalController.dismiss({}).then(() => {
if(this.platform.is('tablet')) {
this.router.navigate(['/home/publications'])
} else {
this.router.navigate(['/home/publications', this.folderId])
}
});
} else {
window["sharedContent"] = null;
this.publicationFolderService.gotoAction = this.folderId;
this.modalController.dismiss({}).then(() => {
if(this.platform.is('tablet')) {
this.router.navigate(['/home/publications'])
} else {
this.router.navigate(['/home/publications', this.folderId])
}
});
}
} else {
this.modalController.dismiss({}).then(() => {});
}
} }
cancel() { cancel() {
@@ -694,6 +725,8 @@ export class NewPublicationPage implements OnInit {
} }
) )
newAttachment.needUpload()
this.PublicationFromMvService.form.Files.push(newAttachment) this.PublicationFromMvService.form.Files.push(newAttachment)
const deleteSecretFile = async () => { const deleteSecretFile = async () => {
@@ -741,6 +774,8 @@ export class NewPublicationPage implements OnInit {
OriginalFileName: 'load video' OriginalFileName: 'load video'
} }
) )
newAttachment.needUpload()
this.PublicationFromMvService.form.Files.push(newAttachment) this.PublicationFromMvService.form.Files.push(newAttachment)
@@ -18,6 +18,7 @@ import { NewPublicationPage } from './new-publication/new-publication.page';
import { ChunkService } from 'src/app/services/stream/chunk.service' import { ChunkService } from 'src/app/services/stream/chunk.service'
import { StreamService } from 'src/app/services/stream/stream.service' import { StreamService } from 'src/app/services/stream/stream.service'
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
// import { ActionModel } from 'src/app/models/beast-orm'; // import { ActionModel } from 'src/app/models/beast-orm';
@@ -77,6 +78,7 @@ export class PublicationsPage implements OnInit {
private ChunkService: ChunkService, private ChunkService: ChunkService,
private StreamService:StreamService, private StreamService:StreamService,
private http: HttpClient, private http: HttpClient,
public publicationFolderService: PublicationFolderService,
) { ) {
@@ -86,19 +88,21 @@ export class PublicationsPage implements OnInit {
console.log('shared recived', this.intent) console.log('shared recived', this.intent)
window['goToPublicationsList'] = this.goToPublicationsList
} }
checkQueryParameter() { checkQueryParameter() {
var urlSearchParams = new URLSearchParams(window.location.search); // var urlSearchParams = new URLSearchParams(window.location.search);
var folderId = urlSearchParams.get('folderId');
if (folderId !== null && window["openFolder"]) { // var folderId = urlSearchParams.get('folderId');
window["openFolder"] = false if (this.publicationFolderService.gotoAction) {
const folderId = this.publicationFolderService.gotoAction
this.goToPublicationsList(folderId) this.goToPublicationsList(folderId)
this.publicationFolderService.gotoAction = false
} else { } else {
console.log('Folder ID::', folderId);
} }
} }
@@ -110,6 +114,7 @@ export class PublicationsPage implements OnInit {
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url == pathname) { if (event instanceof NavigationEnd && event.url == pathname) {
console.log('=================', this.publicationFolderService.gotoAction)
this.getActions(); this.getActions();
this.checkQueryParameter() this.checkQueryParameter()
} }
@@ -377,11 +382,13 @@ export class PublicationsPage implements OnInit {
modal.onDidDismiss().then(() => { modal.onDidDismiss().then(() => {
this.doRefresh(event); this.doRefresh(event);
this.checkQueryParameter();
}); });
await modal.present(); await modal.present();
} }
goToPublicationsList(folderId: string) { goToPublicationsList = (folderId: string) => {
console.log('nice', folderId)
if(window["sharedContent"]){ if(window["sharedContent"]){
this.AddPublication('2',folderId,window["sharedContent"]) this.AddPublication('2',folderId,window["sharedContent"])
return return
+5 -2
View File
@@ -10,13 +10,15 @@ import { DeplomasStore } from '../store/deplomas.service';
import { CalendarStore } from 'src/app/store/calendar.service'; import { CalendarStore } from 'src/app/store/calendar.service';
import { ToDayEventStorage } from '../store/to-day-event-storage.service'; import { ToDayEventStorage } from '../store/to-day-event-storage.service';
import { TotalDocumentStore } from 'src/app/store/total-document.service'; import { TotalDocumentStore } from 'src/app/store/total-document.service';
import { PublicationFolderService } from 'src/app/store/publication-folder.service'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class ClearStoreService { export class ClearStoreService {
constructor() { } constructor(
private PublicationFolderService: PublicationFolderService
) { }
clear() { clear() {
@@ -37,6 +39,7 @@ export class ClearStoreService {
CalendarStore.ResetList([]) CalendarStore.ResetList([])
ToDayEventStorage.reset([]) ToDayEventStorage.reset([])
TotalDocumentStore.resetCount(0) TotalDocumentStore.resetCount(0)
this.PublicationFolderService.clear()
} }
} }
@@ -246,19 +246,10 @@ export class PublicationFromMvService {
if (window["sharedContent"]) { if (window["sharedContent"]) {
if (this.platform.is('android')) { if (this.platform.is('android')) {
window["sharedContent"] = null window["sharedContent"] = null;
this.modalController.dismiss(this.form).then(() => {
this.router.navigate(['/home/publications', this.folderId])
});
} else { } else {
window["sharedContent"] = null window["sharedContent"] = null;
this.modalController.dismiss(this.form).then(() => {
this.router.navigate(['/home/publications', this.folderId])
});
} }
} else {
this.modalController.dismiss(this.form).then(() => {});
} }
} }
@@ -21,12 +21,26 @@ export class PublicationFolderService {
publicationPipe = new PublicationPipe() publicationPipe = new PublicationPipe()
getpublication = []; getpublication = [];
gotoAction: string | false
constructor( constructor(
private storage: Storage, private storage: Storage,
private publications: PublicationsService, private publications: PublicationsService,
) { } ) { }
clear() {
this.publicationList = {};
this.FolderDetails = {};
this.restoreFolder = {}
this.showLoader = true
this.publicationPipe = new PublicationPipe()
this.getpublication = [];
}
createPublicationList(folderId) { createPublicationList(folderId) {
if (!this.publicationList[folderId]) { if (!this.publicationList[folderId]) {
+1 -1
View File
@@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr'
import { DevDev } from './suport/dev' import { DevDev } from './suport/dev'
export const environment: Environment = oaprProd; export const environment: Environment = DevDev;