mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
bugs before presantation
This commit is contained in:
@@ -1,72 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gpr.gabinetedigital">
|
||||
|
||||
<!-- Required permissions -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:requestLegacyExternalStorage="true">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
||||
android:exported="true"
|
||||
android:label="@string/title_activity_main"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/AppTheme.NoActionBarLaunch">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
<!-- Add new One Activity for handle Intent here -->
|
||||
<activity
|
||||
android:name="de.mindlib.sendIntent.SendIntentActivity"
|
||||
android:label="@string/app_name"
|
||||
android:exported="true"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
|
||||
<!-- Depending on your project, you can add here the type of data you wish to receive -->
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<manifest package="com.gpr.gabinetedigital" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:requestLegacyExternalStorage="true" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
|
||||
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:exported="true" android:label="@string/title_activity_main" android:launchMode="singleTop" android:name=".MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:exported="true" android:label="@string/app_name" android:name="de.mindlib.sendIntent.SendIntentActivity" android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="image/*" />
|
||||
<data android:mimeType="video/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<provider android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
|
||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
|
||||
controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline">
|
||||
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.FileBase64">
|
||||
<source type="video/mp4" [src]="seleted.FileBase64">
|
||||
</video>
|
||||
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ export class NewPublicationPage implements OnInit {
|
||||
.then(async (content) => {
|
||||
this.filecontent = true;
|
||||
let fileObject = {
|
||||
FileBase64: 'data:video/mp4;base64,'+content.data,
|
||||
FileBase64: 'data:video/mp4;base64,' + content.data,
|
||||
FileExtension: 'mp4',
|
||||
OriginalFileName: 'video'
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
this.hideRefreshButton();
|
||||
this.intent = window["sharedContent"]
|
||||
window["refreshPublication"] = this.refreshing
|
||||
|
||||
}
|
||||
|
||||
@@ -124,7 +125,7 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
refreshing() {
|
||||
refreshing = () => {
|
||||
setTimeout(() => {
|
||||
this.getActions();
|
||||
}, 1500);
|
||||
@@ -300,6 +301,9 @@ export class PublicationsPage implements OnInit {
|
||||
const loader = this.toastService.loading();
|
||||
try {
|
||||
await this.publications.DeletePresidentialAction(id).toPromise();
|
||||
if(window["refreshPublication"]) {
|
||||
window["refreshPublication"]();
|
||||
}
|
||||
this.toastService._successMessage()
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
|
||||
@@ -270,6 +270,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
if (!found) {
|
||||
this.publicationFolderService.publicationList[folderId].push(publicationDetails)
|
||||
this.publicationFolderService.revertPublicationOrder(folderId)
|
||||
} else {
|
||||
|
||||
|
||||
@@ -348,4 +349,25 @@ export class ViewPublicationsPage implements OnInit {
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
|
||||
getSortedPublications(): Publication[] {
|
||||
const unsortedPublications = this.publicationFolderService.publicationList[this.folderId];
|
||||
|
||||
if (unsortedPublications) {
|
||||
// Copiar a lista original para evitar alterações indesejadas
|
||||
const publicationsCopy = [...unsortedPublications];
|
||||
|
||||
// Ordenar as publicações pelo DatePublication
|
||||
publicationsCopy.sort((a, b) => {
|
||||
const dateA = new Date(a.DatePublication).getTime();
|
||||
const dateB = new Date(b.DatePublication).getTime();
|
||||
return dateA - dateB;
|
||||
});
|
||||
|
||||
return publicationsCopy;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && checkTableDivice() == true" width="70" height="70"
|
||||
preload="metadata" webkit-playsinline="webkit-playsinline">
|
||||
<source type="video/mp4" [src]="'data:video/mp4;base64,' +seleted.FileBase64">
|
||||
<source type="video/mp4" [src]="seleted.FileBase64">
|
||||
</video>
|
||||
|
||||
|
||||
|
||||
@@ -258,26 +258,26 @@ export class NewPublicationPage implements OnInit {
|
||||
multiple: true,
|
||||
});
|
||||
|
||||
console.log(result)
|
||||
console.log(result)
|
||||
|
||||
result.files.forEach(async blobFile => {
|
||||
console.log(blobFile)
|
||||
if (this.checkFileType.checkFileType(blobFile.mimeType) == 'image' || this.checkFileType.checkFileType(blobFile.mimeType) == 'video') {
|
||||
/* console.log('converte new way',this.getBase64(blobFile)) */
|
||||
/* console.log('converte new way',this.getBase64(blobFile)) */
|
||||
|
||||
/* const blob = await fetch(
|
||||
Capacitor.convertFileSrc(blobFile.path)
|
||||
).then(r => r.blob()); */
|
||||
/* const blob = await fetch(
|
||||
Capacitor.convertFileSrc(blobFile.path)
|
||||
).then(r => r.blob()); */
|
||||
|
||||
/* console.log(await blob.arrayBuffer());
|
||||
/* console.log(await blob.arrayBuffer());
|
||||
|
||||
|
||||
|
||||
console.log("base64 :data:video/mp4;base64,",this.arrayBufferToBase64(await blob.arrayBuffer())) */
|
||||
console.log("base64 :data:video/mp4;base64,",this.arrayBufferToBase64(await blob.arrayBuffer())) */
|
||||
|
||||
this.convertBlobToBase64(blobFile.blob).then((value) => {
|
||||
|
||||
console.log(value)
|
||||
console.log(this.removeTextBeforeSlash(value, ','))
|
||||
|
||||
this.filesSizeSum = this.filesSizeSum + blobFile.size
|
||||
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
|
||||
@@ -288,7 +288,7 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
const newAttachment = new PublicationAttachmentEntity(
|
||||
{
|
||||
base64: value,
|
||||
base64: this.removeTextBeforeSlash(value, ','),
|
||||
extension: FileExtension,
|
||||
blobFile: file,
|
||||
FileType: this.checkFileType.checkFileType(FileExtension)
|
||||
@@ -347,7 +347,7 @@ export class NewPublicationPage implements OnInit {
|
||||
({
|
||||
multiple: true,
|
||||
});
|
||||
console.log(result.files)
|
||||
console.log(result.files)
|
||||
result.files.forEach(element => {
|
||||
|
||||
this.filesSizeSum = this.filesSizeSum + element.size
|
||||
@@ -359,15 +359,16 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
.then(async (content) => {
|
||||
console.log(result)
|
||||
console.log('load video tablet base64',content)
|
||||
console.log('load video tablet base64', content)
|
||||
this.filecontent = true;
|
||||
let fileObject = new PublicationAttachmentEntity ({
|
||||
let fileObject = new PublicationAttachmentEntity({
|
||||
base64: content.data,
|
||||
extension: this.removeTextBeforeSlash(element.mimeType, '/'),
|
||||
OriginalFileName: 'video',
|
||||
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/'))
|
||||
FileType: this.checkFileType.checkFileType(this.removeTextBeforeSlash(element.mimeType, '/'))
|
||||
})
|
||||
this.seletedContent.push(fileObject)
|
||||
console.log('Files array',this.seletedContent)
|
||||
})
|
||||
.catch((err) => console.error(err));
|
||||
} catch (error) {
|
||||
@@ -607,17 +608,59 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
convertBlobToBase64(blob: Blob) {
|
||||
console.log('Convert blob ',blob)
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader;
|
||||
reader.onerror = reject;
|
||||
reader.onload = () => {
|
||||
resolve(reader.result)
|
||||
}
|
||||
reader.readAsDataURL(blob)
|
||||
},)
|
||||
try {
|
||||
return new Promise((resolve, reject) => {
|
||||
const chunkSize = 5000000; // 5 MB
|
||||
const fileSize = blob.size;
|
||||
const chunks = Math.ceil(fileSize / chunkSize);
|
||||
let currentChunk = 0;
|
||||
const base64Chunks = [];
|
||||
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = function () {
|
||||
base64Chunks.push(reader.result);
|
||||
currentChunk++;
|
||||
|
||||
if (currentChunk < chunks) {
|
||||
loadNextChunk();
|
||||
} else {
|
||||
const base64Data = base64Chunks.join("");
|
||||
resolve(base64Data);
|
||||
}
|
||||
};
|
||||
|
||||
reader.onerror = function (error) {
|
||||
reject(error);
|
||||
};
|
||||
|
||||
function loadNextChunk() {
|
||||
const start = currentChunk * chunkSize;
|
||||
const end = Math.min(start + chunkSize, fileSize);
|
||||
const chunk = blob.slice(start, end);
|
||||
reader.readAsDataURL(chunk);
|
||||
}
|
||||
|
||||
loadNextChunk();
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* convertBlobToBase64(blob: Blob) {
|
||||
console.log('Convert blob ',blob)
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader;
|
||||
reader.onerror = reject;
|
||||
reader.onload = () => {
|
||||
resolve(reader.result)
|
||||
}
|
||||
reader.readAsDataURL(blob)
|
||||
},)
|
||||
} */
|
||||
|
||||
getBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
@@ -625,7 +668,7 @@ export class NewPublicationPage implements OnInit {
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
removeTextBeforeSlash(inputString, mark) {
|
||||
if (inputString.includes(mark)) {
|
||||
@@ -1002,7 +1045,7 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
.then(async (content) => {
|
||||
this.filecontent = true;
|
||||
console.log('',content)
|
||||
console.log('', content)
|
||||
let fileObject = new PublicationAttachmentEntity({
|
||||
base64: content.data,
|
||||
extension: 'mp4',
|
||||
@@ -1028,7 +1071,7 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
checkTableDivice() {
|
||||
if (!this.platform.is('desktop'))
|
||||
if (this.platform.is('tablet'))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
if (!found) {
|
||||
this.publicationFolderService.publicationList[folderId].push(publicationDetails)
|
||||
this.publicationFolderService.revertPublicationOrder(folderId)
|
||||
} else {
|
||||
|
||||
let a: any = Object.assign({},this.publicationFolderService.publicationList[folderId][findIndex])
|
||||
|
||||
@@ -10,8 +10,8 @@ import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||
})
|
||||
export class PublicationFolderService {
|
||||
|
||||
publicationList: {[key: string]: Publication[] } = {};
|
||||
FolderDetails: {[key: string]: PublicationFolder } = {};
|
||||
publicationList: { [key: string]: Publication[] } = {};
|
||||
FolderDetails: { [key: string]: PublicationFolder } = {};
|
||||
|
||||
restoreFolder: {} = {}
|
||||
|
||||
@@ -25,14 +25,14 @@ export class PublicationFolderService {
|
||||
constructor(
|
||||
private storage: Storage,
|
||||
private publications: PublicationsService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
|
||||
createPublicationList(folderId) {
|
||||
if(!this.publicationList[folderId]) {
|
||||
if (!this.publicationList[folderId]) {
|
||||
this.publicationList[folderId] = []
|
||||
}
|
||||
if(!this.FolderDetails[folderId]) {
|
||||
if (!this.FolderDetails[folderId]) {
|
||||
this.FolderDetails[folderId] = new PublicationFolder();
|
||||
}
|
||||
}
|
||||
@@ -40,13 +40,13 @@ export class PublicationFolderService {
|
||||
getFromDB(folderId: any) {
|
||||
|
||||
|
||||
if(!this.restoreFolder[folderId]) {
|
||||
if (!this.restoreFolder[folderId]) {
|
||||
|
||||
this.storage.get(folderId).then((viewPublications) => {
|
||||
this.publicationList[folderId] = viewPublications
|
||||
})
|
||||
|
||||
this.storage.get(folderId+"name").then((viewPublications) => {
|
||||
this.storage.get(folderId + "name").then((viewPublications) => {
|
||||
this.FolderDetails[folderId] = viewPublications
|
||||
})
|
||||
}
|
||||
@@ -56,29 +56,30 @@ export class PublicationFolderService {
|
||||
|
||||
updateFolderDetails(folderId, res) {
|
||||
this.FolderDetails[folderId] = res
|
||||
this.storage.set(folderId+"name", res)
|
||||
this.storage.set(folderId + "name", res)
|
||||
}
|
||||
|
||||
save(folderId) {
|
||||
this.storage.set(folderId+"name", this.FolderDetails)
|
||||
this.storage.set(folderId + "name", this.FolderDetails)
|
||||
this.storage.set(folderId, this.publicationList[folderId]);
|
||||
}
|
||||
|
||||
publicationIsPresent(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
return this.publicationList[folderId].find(e => e.DocumentId == publicationId)
|
||||
}
|
||||
publicationFind(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
return this.publicationList[folderId].find(e => e.DocumentId == publicationId)
|
||||
}
|
||||
publicationFindIndex(publicationId, folderId) {
|
||||
return this.publicationList[folderId].findIndex( e => e.DocumentId == publicationId )
|
||||
return this.publicationList[folderId].findIndex(e => e.DocumentId == publicationId)
|
||||
}
|
||||
|
||||
PublicationAddOrUpdate(folderId, publicationId, Publication: Publication) {
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
if (!found) {
|
||||
this.publicationList[folderId].push(Publication)
|
||||
this.revertPublicationOrder(folderId);
|
||||
} else {
|
||||
this.publicationList[folderId][findIndex] = Publication
|
||||
}
|
||||
@@ -86,9 +87,9 @@ export class PublicationFolderService {
|
||||
|
||||
deletePost(folderId: any, DocumentId: any) {
|
||||
|
||||
if(this.publicationList[folderId]) {
|
||||
if (this.publicationList[folderId]) {
|
||||
|
||||
this.publicationList[folderId] = this.publicationList[folderId].filter( e => e.DocumentId != DocumentId)
|
||||
this.publicationList[folderId] = this.publicationList[folderId].filter(e => e.DocumentId != DocumentId)
|
||||
|
||||
this.save(folderId)
|
||||
}
|
||||
@@ -99,7 +100,7 @@ export class PublicationFolderService {
|
||||
|
||||
this.publications.GetPresidentialAction(folderId).subscribe(res => {
|
||||
this.FolderDetails[folderId] = res
|
||||
this.storage.set(folderId+"name", res)
|
||||
this.storage.set(folderId + "name", res)
|
||||
}, (error) => {
|
||||
this.showLoader = false;
|
||||
// this.httpErroHandle.httpStatusHandle(error)
|
||||
@@ -118,7 +119,7 @@ export class PublicationFolderService {
|
||||
let loadLater = []
|
||||
for (let publicationId of publicationIds) {
|
||||
|
||||
if(!this.publicationIsPresent(publicationId, folderId)) {
|
||||
if (!this.publicationIsPresent(publicationId, folderId)) {
|
||||
await this.loadPublication(publicationId, folderId)
|
||||
|
||||
} else {
|
||||
@@ -126,7 +127,7 @@ export class PublicationFolderService {
|
||||
}
|
||||
}
|
||||
|
||||
for( let publicationId of loadLater) {
|
||||
for (let publicationId of loadLater) {
|
||||
await this.loadPublication(publicationId, folderId)
|
||||
}
|
||||
|
||||
@@ -134,7 +135,7 @@ export class PublicationFolderService {
|
||||
|
||||
this.storage.set(folderId, this.publicationList[folderId]);
|
||||
this.getpublication = this.publicationList[folderId];
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
@@ -147,17 +148,18 @@ export class PublicationFolderService {
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
if (!found) {
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
this.revertPublicationOrder(folderId);
|
||||
} else {
|
||||
|
||||
let a: any = Object.assign({},this.publicationList[folderId][findIndex])
|
||||
let a: any = Object.assign({}, this.publicationList[folderId][findIndex])
|
||||
let b: any = Object.assign({}, publicationDetails)
|
||||
|
||||
a.Files = a.Files.length
|
||||
b.Files = b.Files.length
|
||||
|
||||
if(JSON.stringify(a) != JSON.stringify(b)) {
|
||||
if (JSON.stringify(a) != JSON.stringify(b)) {
|
||||
|
||||
// console.log({a, b})
|
||||
this.publicationList[folderId][findIndex] = publicationDetails
|
||||
@@ -171,9 +173,10 @@ export class PublicationFolderService {
|
||||
|
||||
|
||||
async CreatePublication(folderId, publication: Publication) {
|
||||
const response = await this.publications.CreatePublication(folderId, publication).toPromise()
|
||||
const response = await this.publications.CreatePublication(folderId, publication).toPromise()
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(response)
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
this.revertPublicationOrder(folderId)
|
||||
return publicationDetails
|
||||
}
|
||||
|
||||
@@ -182,8 +185,9 @@ export class PublicationFolderService {
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
if (!found) {
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
this.revertPublicationOrder(folderId)
|
||||
} else {
|
||||
this.publicationList[folderId][findIndex] = publicationDetails
|
||||
}
|
||||
@@ -196,8 +200,10 @@ export class PublicationFolderService {
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
if (!found) {
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
this.revertPublicationOrder(folderId);
|
||||
|
||||
} else {
|
||||
return this.publicationList[folderId][findIndex]
|
||||
}
|
||||
@@ -205,10 +211,10 @@ export class PublicationFolderService {
|
||||
}
|
||||
|
||||
|
||||
getLocalPublication (folderId, DocumentId) {
|
||||
getLocalPublication(folderId, DocumentId) {
|
||||
|
||||
if(this.publicationList[folderId]) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == DocumentId )
|
||||
if (this.publicationList[folderId]) {
|
||||
return this.publicationList[folderId].find(e => e.DocumentId == DocumentId)
|
||||
} else {
|
||||
|
||||
}
|
||||
@@ -217,11 +223,22 @@ export class PublicationFolderService {
|
||||
|
||||
|
||||
PublicationHasImage(Publication: Publication) {
|
||||
return Publication?.Files?.[0]?.FileBase64 != '' && Publication?.Files?.[0]?.FileBase64 != "data:image/jpg;base64,null"
|
||||
return Publication?.Files?.[0]?.FileBase64 != '' && Publication?.Files?.[0]?.FileBase64 != "data:image/jpg;base64,null"
|
||||
}
|
||||
|
||||
hasCapturedImage(Publication: Publication) {
|
||||
return Publication?.Files?.[0]?.FileBase64 != '' && Publication?.Files?.[0]?.FileBase64 != "data:image/jpg;base64,null"
|
||||
return Publication?.Files?.[0]?.FileBase64 != '' && Publication?.Files?.[0]?.FileBase64 != "data:image/jpg;base64,null"
|
||||
}
|
||||
|
||||
revertPublicationOrder(folderId) {
|
||||
//Revert order of the list
|
||||
if (this.publicationList[folderId]) {
|
||||
this.publicationList[folderId] = this.publicationList[folderId].sort((a, b) => {
|
||||
const dateA = new Date(a.DatePublication).getTime();
|
||||
const dateB = new Date(b.DatePublication).getTime();
|
||||
return dateB - dateA; // Revertendo a ordem aqui
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+14
-45
@@ -1,6 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<modules>
|
||||
|
||||
<remove name="WebDAVModule"/>
|
||||
|
||||
</modules>
|
||||
|
||||
<handlers>
|
||||
|
||||
<remove name="WebDAV"/>
|
||||
|
||||
</handlers>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="AngularRewrite" stopProcessing="true">
|
||||
@@ -16,49 +27,7 @@
|
||||
<httpProtocol>
|
||||
<customHeaders>
|
||||
<!-- Iframe on the same host only -->
|
||||
<add name="X-Frame-Options" value="SAMEORIGIN" />
|
||||
<!-- HTTPS on -->
|
||||
<add name="Strict-Transport-Security" value="max-age=31536000" />
|
||||
<add name="Referrer-Policy" value="no-referrer" />
|
||||
<add name="X-Content-Type-Options" value="nosniff" />
|
||||
<!-- <add e="Expect-CT" value="enforce, max-age=86400" /> -->
|
||||
<!-- Permision -->
|
||||
<add name="Permissions-Policy" value="camera=(), microphone=*" />
|
||||
<!-- same origin only -->
|
||||
<add name="Cross-Origin-Embedder-Policy" value="require-corp" />
|
||||
<!-- same origin only -->
|
||||
<!-- <add name="Cross-Origin-Opener-Policy" value="same-origin" /> -->
|
||||
</customHeaders>
|
||||
</httpProtocol>
|
||||
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="AngularRewrite" stopProcessing="true">
|
||||
<match url=".*" />
|
||||
<conditions logicalGrouping="MatchAll">
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||
</conditions>
|
||||
<action type="Rewrite" url="/" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
<httpProtocol>
|
||||
<customHeaders>
|
||||
<!-- Iframe on the same host only -->
|
||||
<add name="Content-Security-Policy" value="frame-ancestors https://gdviewer-dev.dyndns.info/" />
|
||||
<add name="Content-Security-Policy" value="frame-ancestors https://gdqas.oapr.gov.ao/" />
|
||||
<!-- HTTPS on -->
|
||||
<add name="Strict-Transport-Security" value="max-age=31536000" />
|
||||
<add name="Referrer-Policy" value="no-referrer" />
|
||||
@@ -74,13 +43,13 @@
|
||||
</httpProtocol>
|
||||
|
||||
|
||||
<directoryBrowse enabled="false" />
|
||||
<!-- <directoryBrowse enabled="false" />
|
||||
<httpErrors>
|
||||
<remove statusCode="404" subStatusCode="-1" />
|
||||
<remove statusCode="403" subStatusCode="-1" />
|
||||
<error statusCode="403" prefixLanguageFilePath="" path="/home/events" responseMode="ExecuteURL" />
|
||||
<error statusCode="404" prefixLanguageFilePath="" path="/index.html" responseMode="ExecuteURL" />
|
||||
</httpErrors>
|
||||
</httpErrors> -->
|
||||
|
||||
|
||||
</system.webServer>
|
||||
|
||||
Reference in New Issue
Block a user