diff --git a/android/.idea/codeStyles/Project.xml b/android/.idea/codeStyles/Project.xml
new file mode 100644
index 000000000..681f41ae2
--- /dev/null
+++ b/android/.idea/codeStyles/Project.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/.idea/jarRepositories.xml b/android/.idea/jarRepositories.xml
new file mode 100644
index 000000000..eaf2266d9
--- /dev/null
+++ b/android/.idea/jarRepositories.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml
new file mode 100644
index 000000000..7bfef59df
--- /dev/null
+++ b/android/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/.idea/runConfigurations.xml b/android/.idea/runConfigurations.xml
new file mode 100644
index 000000000..7f68460d8
--- /dev/null
+++ b/android/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index a023e22bb..b48ce4420 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -527,6 +527,12 @@
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
+ "ini": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
+ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
+ "dev": true
+ },
"inquirer": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz",
@@ -2027,9 +2033,12 @@
}
},
"@ionic-native/camera": {
- "version": "4.20.0",
- "resolved": "https://registry.npmjs.org/@ionic-native/camera/-/camera-4.20.0.tgz",
- "integrity": "sha512-WnfQq8RV+7ezOqpCyNx9Xgpy7Y8TZehGLSxZXnCqCbFZ72CpC70Q5AV/eTIRGiKkotx2U6nUopYF+gTj1cunFA=="
+ "version": "5.30.0",
+ "resolved": "https://registry.npmjs.org/@ionic-native/camera/-/camera-5.30.0.tgz",
+ "integrity": "sha512-eIEhr7dRsjTyw/XIxF+TPx4A4feFmFE4cZhg5qYXUdI+eBymX6iii/J47OjsFg9ulCcrNUXg54iL5LqmhkeG5A==",
+ "requires": {
+ "@types/cordova": "^0.0.34"
+ }
},
"@ionic-native/core": {
"version": "5.27.0",
@@ -2930,6 +2939,12 @@
"semver-intersect": "1.4.0"
},
"dependencies": {
+ "ini": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
+ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
+ "dev": true
+ },
"rxjs": {
"version": "6.5.4",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
@@ -7943,9 +7958,9 @@
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"ini": {
- "version": "1.3.5",
- "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
- "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz",
+ "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ=="
},
"inquirer": {
"version": "6.3.1",
diff --git a/package.json b/package.json
index 07618b901..e8717023b 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"@fullcalendar/angular": "^5.3.0",
"@fullcalendar/daygrid": "^5.3.0",
"@fullcalendar/interaction": "^5.3.0",
- "@ionic-native/camera": "^4.20.0",
+ "@ionic-native/camera": "^5.30.0",
"@ionic-native/core": "^5.0.7",
"@ionic-native/file": "^5.30.0",
"@ionic-native/file-path": "^5.30.0",
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 54da817d0..d006325ee 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -16,6 +16,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { File } from '@ionic-native/File/ngx';
import { WebView } from '@ionic-native/ionic-webview/ngx';
import { FilePath } from '@ionic-native/file-path/ngx';
+import { Camera } from '@ionic-native/camera/ngx';
import { IonicStorageModule } from '@ionic/storage';
@@ -34,6 +35,7 @@ import { IonicStorageModule } from '@ionic/storage';
HttpClientModule,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
InAppBrowser,
+ Camera,
File,
WebView,
FilePath,
diff --git a/src/app/models/photo.ts b/src/app/models/photo.ts
new file mode 100644
index 000000000..9db471185
--- /dev/null
+++ b/src/app/models/photo.ts
@@ -0,0 +1,5 @@
+export class Photo {
+ fileName: string;
+ webviewPath: string;
+ fileFormat: string;
+ }
\ No newline at end of file
diff --git a/src/app/models/publication.ts b/src/app/models/publication.ts
index bd06f9808..873513361 100644
--- a/src/app/models/publication.ts
+++ b/src/app/models/publication.ts
@@ -1,13 +1,13 @@
/* import { Image } from './image'; */
export class Publication{
- publicationId:string;
- processId:string;
- title: string;
- description: string;
- date: Date;
+ DocumentId:string;
+ ProcessId:string;
+ Title: string;
+ Message: string;
+ DatePublication: Date;
/* image: Image; */
- imageTitle: string;
- imageUrl:string;
- imageFormat: string;
+ OriginalFileName: string;
+ FileBase64:string;
+ FileExtension: string;
}
\ No newline at end of file
diff --git a/src/app/models/publicationfolder.ts b/src/app/models/publicationfolder.ts
index f85750eff..8d9a4ecb4 100644
--- a/src/app/models/publicationfolder.ts
+++ b/src/app/models/publicationfolder.ts
@@ -2,6 +2,7 @@ export class PublicationFolder {
ProcessId: number;
Description: string;
Detail: string;
- DateBegin: Date;
+ DateBegin: string;
+ DateEnd: string;
ActionType: string;
}
\ No newline at end of file
diff --git a/src/app/pages/publications/new-action/new-action.page.html b/src/app/pages/publications/new-action/new-action.page.html
index 6bb40f58e..7ac37fae9 100644
--- a/src/app/pages/publications/new-action/new-action.page.html
+++ b/src/app/pages/publications/new-action/new-action.page.html
@@ -46,6 +46,25 @@
+
+
+
+
+
+
diff --git a/src/app/pages/publications/new-action/new-action.page.ts b/src/app/pages/publications/new-action/new-action.page.ts
index fc78fab26..fb9917823 100644
--- a/src/app/pages/publications/new-action/new-action.page.ts
+++ b/src/app/pages/publications/new-action/new-action.page.ts
@@ -34,6 +34,7 @@ export class NewActionPage implements OnInit {
Description: this.folder.Description,
Detail: this.folder.Detail,
DateBegin: this.folder.DateBegin,
+ DateEnd: this.folder.DateEnd,
ActionType: this.segment,
}
console.log(this.folder);
diff --git a/src/app/pages/publications/new-publication/new-publication.page.html b/src/app/pages/publications/new-publication/new-publication.page.html
index 18daf780c..4d597b5ac 100644
--- a/src/app/pages/publications/new-publication/new-publication.page.html
+++ b/src/app/pages/publications/new-publication/new-publication.page.html
@@ -23,7 +23,7 @@
-
+
@@ -32,24 +32,24 @@
-
+
-
+
0" class="ion-item-container-no-border">
Fotografia Anexada
-
+
- Nome da foto
+ {{photoService.photos[0].fileName}}
size
-
+
-
30" class="post-img">
-

+ (click)="viewPublicationDetail(publication.ProcessId,publication.DocumentId)">
+
30" class="post-img">
+
-
+
- {{publication.title}}
+ {{publication.Title}}
-
{{publication.date}}
+
{{publication.DatePublication | date: 'dd-MM-yy | h:mm'}}
-
{{publication.description}}
+
{{publication.Message}}
diff --git a/src/app/pages/publications/view-publications/view-publications.page.scss b/src/app/pages/publications/view-publications/view-publications.page.scss
index 3d977d554..56275f153 100644
--- a/src/app/pages/publications/view-publications/view-publications.page.scss
+++ b/src/app/pages/publications/view-publications/view-publications.page.scss
@@ -125,13 +125,13 @@
margin-top: 5px;
}
.post-title{
- width: 80%;
+ width: 60%;
float: left;
font-size: 15px;
color: #0d89d1;
}
.post-data{
- width: 20%;
+ width: 40%;
float: left;
font-size: 13px;
color: #797979;
diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts
index 37a568091..e8008887a 100644
--- a/src/app/pages/publications/view-publications/view-publications.page.ts
+++ b/src/app/pages/publications/view-publications/view-publications.page.ts
@@ -12,6 +12,8 @@ import { PublicationDetailPage } from './publication-detail/publication-detail.p
styleUrls: ['./view-publications.page.scss'],
})
export class ViewPublicationsPage implements OnInit {
+ showLoader: boolean;
+
publicationList: Publication[];
item: PublicationFolder;
@@ -27,6 +29,13 @@ export class ViewPublicationsPage implements OnInit {
this.getPublications()
/* console.log(this.item); */
}
+ doRefresh(event) {
+ this.getPublications()
+
+ setTimeout(() => {
+ event.target.complete();
+ }, 2000);
+ }
close(){
this.modalController.dismiss();
}
@@ -43,15 +52,15 @@ export class ViewPublicationsPage implements OnInit {
format: 'png'
}
let item: Publication = {
- "publicationId":element.DocumentId,
- "processId":element.ProcessId,
- "title":element.Title,
- "description": element.Message,
- "date": element.DatePublication,
+ "DocumentId":element.DocumentId,
+ "ProcessId":element.ProcessId,
+ "Title":element.Title,
+ "Message": element.Message,
+ "DatePublication": element.DatePublication,
/* image:itemImage, */
- "imageUrl": "data:image/jpg;base64," + element.FileBase64,
- "imageTitle": '',
- "imageFormat": '',
+ "FileBase64": "data:image/jpg;base64," + element.FileBase64,
+ "OriginalFileName": '',
+ "FileExtension": '',
}
this.publicationList.push(item);
});
diff --git a/src/app/services/photo.service.spec.ts b/src/app/services/photo.service.spec.ts
new file mode 100644
index 000000000..00ab0b05d
--- /dev/null
+++ b/src/app/services/photo.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { PhotoService } from './photo.service';
+
+describe('PhotoService', () => {
+ let service: PhotoService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(PhotoService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/services/photo.service.ts b/src/app/services/photo.service.ts
new file mode 100644
index 000000000..fcfdcfda8
--- /dev/null
+++ b/src/app/services/photo.service.ts
@@ -0,0 +1,66 @@
+import { Injectable } from '@angular/core';
+
+import { Plugins, CameraResultType, Capacitor, FilesystemDirectory, CameraPhoto, CameraSource } from '@capacitor/core';
+import { Photo } from '../models/photo';
+import { Platform } from '@ionic/angular';
+import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
+
+ /* const { Camera, Filesystem, Storage } = Plugins; */
+
+@Injectable({
+ providedIn: 'root'
+})
+export class PhotoService {
+ public photos: Photo[] = [];
+ private PHOTO_STORAGE: string = "photos";
+ private platform: Platform;
+
+ constructor(platform: Platform,
+ private camera:Camera) {
+ this.platform = platform;
+ }
+
+ async takePicture(){
+ const options: CameraOptions = {
+ quality: 100,
+ destinationType: this.camera.DestinationType.FILE_URI,
+ encodingType: this.camera.EncodingType.JPEG,
+ mediaType: this.camera.MediaType.PICTURE
+ }
+
+ this.camera.getPicture(options).then((imageData) => {
+ // imageData is either a base64 encoded string or a file URI
+ // If it's base64 (DATA_URL):
+ let base64Image = 'data:image/jpeg;base64,' + imageData;
+ return base64Image;
+ }, (err) => {
+ // Handle error
+ });
+
+ }
+
+
+ /* async addNewToGallery() {
+ // Take a photo using Capacitor
+ const capturedPhoto = await Camera.getPhoto({
+ resultType: CameraResultType.Base64,
+ source: CameraSource.Camera,
+ quality: 90,
+ width: 1080,
+ height: 720,
+ });
+
+ this.photos.unshift({
+ fileName: new Date().getTime() + '.png',
+ webviewPath: capturedPhoto.base64String,
+ fileFormat: capturedPhoto.format,
+ });
+
+ console.log(capturedPhoto);
+
+
+ console.log(this.photos[0]);
+
+ } */
+
+}
diff --git a/src/app/services/publications.service.ts b/src/app/services/publications.service.ts
index 840c3db7d..dd34bd26d 100644
--- a/src/app/services/publications.service.ts
+++ b/src/app/services/publications.service.ts
@@ -110,7 +110,7 @@ export class PublicationsService {
params = params.set("folderId", folderId);
let options = {
headers: this.headers,
- params: params
+ /* params: params */
};
return this.http.post
(`${geturl}`, body, options).toPromise().then(res =>{
console.log(res);
@@ -123,13 +123,29 @@ export class PublicationsService {
params = params.set("folderId", folderId);
let options = {
headers: this.headers,
- params: params
+ /* params: params */
};
return this.http.put(`${geturl}`, body, options).toPromise().then(res =>{
console.log(res);
});
}
+ DeletePublication(folderId:any,publicationId:any){
+ const geturl = environment.apiURL + 'presidentialActions/'+folderId+'/posts/'+publicationId;
+ let params = new HttpParams();
+ params = params.set("folderId", folderId);
+ params = params.set("id", publicationId);
+ let options = {
+ headers: this.headers,
+ /* params: params */
+ };
+ return this.http.delete(`${geturl}`, options).toPromise().then(res =>{
+ console.log(res);
+ });
+ }
+
+
+
}