mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
jwt implemented
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.gpr.gabinetedigital">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
@@ -40,7 +39,12 @@
|
||||
<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="text/plain" />
|
||||
<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>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"server": {
|
||||
"url": "http://192.168.0.57:8101",
|
||||
"originalUrl": "http://192.168.0.95:8100"
|
||||
"url": "http://192.168.1.3:8101",
|
||||
"originalUrl": "http://192.168.1.3:8100"
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -19,13 +19,16 @@ def capacitor_pods
|
||||
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
|
||||
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
|
||||
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
|
||||
pod 'CapacitorLocalNotifications', :path => '../../node_modules/@capacitor/local-notifications'
|
||||
pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
|
||||
pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications'
|
||||
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
|
||||
pod 'CapacitorStorage', :path => '../../node_modules/@capacitor/storage'
|
||||
pod 'CapawesomeCapacitorFilePicker', :path => '../../node_modules/@capawesome/capacitor-file-picker'
|
||||
pod 'SentryCapacitor', :path => '../../node_modules/@sentry/capacitor'
|
||||
pod 'TeamhiveCapacitorVideoRecorder', :path => '../../node_modules/@teamhive/capacitor-video-recorder'
|
||||
pod 'CapacitorVideoPlayer', :path => '../../node_modules/capacitor-video-player'
|
||||
pod 'CapacitorVoiceRecorder', :path => '../../node_modules/capacitor-voice-recorder'
|
||||
pod 'SendIntent', :path => '../../node_modules/send-intent'
|
||||
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
|
||||
pod 'CordovaPluginsResources', :path => '../capacitor-cordova-ios-plugins'
|
||||
end
|
||||
|
||||
Generated
+88
-24
@@ -147,7 +147,6 @@
|
||||
"ionic2-calendar": "^0.6.6",
|
||||
"ionicons": "^5.5.3",
|
||||
"jest-puppeteer": "^7.0.1",
|
||||
"jetifier": "^1.6.8",
|
||||
"lite-server": "^2.6.1",
|
||||
"minisearch": "^6.0.1",
|
||||
"moment": "^2.29.3",
|
||||
@@ -168,6 +167,7 @@
|
||||
"send-intent": "^5.0.0",
|
||||
"sharp": "^0.30.7",
|
||||
"socket.io-client": "^2.3.0",
|
||||
"swiper": "^11.0.5",
|
||||
"tinymce": "^6.6.0",
|
||||
"ts-jest": "^27.0.3",
|
||||
"ts-jest-puppeteer": "^0.0.5",
|
||||
@@ -186,7 +186,7 @@
|
||||
"@angular/compiler": "^12.1.2",
|
||||
"@angular/compiler-cli": "^12.1.2",
|
||||
"@angular/language-service": "^12.1.2",
|
||||
"@capacitor/cli": "^4.6.1",
|
||||
"@capacitor/cli": "^4.8.1",
|
||||
"@ionic/angular-toolkit": "^6.1.0",
|
||||
"@ionic/lab": "3.1.7",
|
||||
"@types/core-js": "^2.5.7",
|
||||
@@ -217,6 +217,7 @@
|
||||
"jest-environment-jsdom": "^27.5.1",
|
||||
"jest-jasmine2": "^29.4.3",
|
||||
"jest-preset-angular": "^9.0.4",
|
||||
"jetifier": "^2.0.0",
|
||||
"karma": "^6.3.20",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||
@@ -3722,15 +3723,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@capacitor/cli": {
|
||||
"version": "4.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.6.1.tgz",
|
||||
"integrity": "sha512-iFMK83B67RXEQyWi1kOzQmRdCFc/pPD924mjAXG7yFLVyMvVRGAwwf8LzWFzHyQDoKK+auPMHycVfzm9T6Iyyg==",
|
||||
"version": "4.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.8.1.tgz",
|
||||
"integrity": "sha512-Ssxh+YaMuP+ZHJYaRJ78NCxS5L+u3X3XWK+NGhe+aluRZDigK5LJIiqjp+K3Xx1zQBG62gWWCEZoDvXJvafPIw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@ionic/cli-framework-output": "^2.2.5",
|
||||
"@ionic/utils-fs": "^3.1.6",
|
||||
"@ionic/utils-subprocess": "^2.1.11",
|
||||
"@ionic/utils-terminal": "^2.3.3",
|
||||
"@ionic/cli-framework-output": "2.2.5",
|
||||
"@ionic/utils-fs": "3.1.6",
|
||||
"@ionic/utils-subprocess": "2.1.11",
|
||||
"@ionic/utils-terminal": "2.3.3",
|
||||
"commander": "^9.3.0",
|
||||
"debug": "^4.3.4",
|
||||
"env-paths": "^2.2.0",
|
||||
@@ -3743,7 +3744,7 @@
|
||||
"semver": "^7.3.7",
|
||||
"tar": "^6.1.11",
|
||||
"tslib": "^2.4.0",
|
||||
"xml2js": "^0.4.23"
|
||||
"xml2js": "^0.5.0"
|
||||
},
|
||||
"bin": {
|
||||
"cap": "bin/capacitor",
|
||||
@@ -3908,6 +3909,28 @@
|
||||
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@capacitor/cli/node_modules/xml2js": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz",
|
||||
"integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@capacitor/cli/node_modules/xmlbuilder": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@capacitor/core": {
|
||||
"version": "5.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-5.4.2.tgz",
|
||||
@@ -24649,9 +24672,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jetifier": {
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/jetifier/-/jetifier-1.6.8.tgz",
|
||||
"integrity": "sha512-3Zi16h6L5tXDRQJTb221cnRoVG9/9OvreLdLU2/ZjRv/GILL+2Cemt0IKvkowwkDpvouAU1DQPOJ7qaiHeIdrw==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jetifier/-/jetifier-2.0.0.tgz",
|
||||
"integrity": "sha512-J4Au9KuT74te+PCCCHKgAjyLlEa+2VyIAEPNCdE5aNkAJ6FAJcAqcdzEkSnzNksIa9NkGmC4tPiClk2e7tCJuQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"jetifier": "bin/jetify",
|
||||
"jetifier-standalone": "bin/jetifier-standalone",
|
||||
@@ -35202,6 +35226,24 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/swiper": {
|
||||
"version": "11.0.5",
|
||||
"resolved": "https://registry.npmjs.org/swiper/-/swiper-11.0.5.tgz",
|
||||
"integrity": "sha512-rhCwupqSyRnWrtNzWzemnBLMoyYuoDgGgspAm/8iBD3jCvAWycPLH4Z3TB0O5520DHLzMx94yUMH/B9Efpa48w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/swiperjs"
|
||||
},
|
||||
{
|
||||
"type": "open_collective",
|
||||
"url": "http://opencollective.com/swiper"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 4.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/symbol-observable": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
|
||||
@@ -46115,15 +46157,15 @@
|
||||
"requires": {}
|
||||
},
|
||||
"@capacitor/cli": {
|
||||
"version": "4.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.6.1.tgz",
|
||||
"integrity": "sha512-iFMK83B67RXEQyWi1kOzQmRdCFc/pPD924mjAXG7yFLVyMvVRGAwwf8LzWFzHyQDoKK+auPMHycVfzm9T6Iyyg==",
|
||||
"version": "4.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.8.1.tgz",
|
||||
"integrity": "sha512-Ssxh+YaMuP+ZHJYaRJ78NCxS5L+u3X3XWK+NGhe+aluRZDigK5LJIiqjp+K3Xx1zQBG62gWWCEZoDvXJvafPIw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@ionic/cli-framework-output": "^2.2.5",
|
||||
"@ionic/utils-fs": "^3.1.6",
|
||||
"@ionic/utils-subprocess": "^2.1.11",
|
||||
"@ionic/utils-terminal": "^2.3.3",
|
||||
"@ionic/cli-framework-output": "2.2.5",
|
||||
"@ionic/utils-fs": "3.1.6",
|
||||
"@ionic/utils-subprocess": "2.1.11",
|
||||
"@ionic/utils-terminal": "2.3.3",
|
||||
"commander": "^9.3.0",
|
||||
"debug": "^4.3.4",
|
||||
"env-paths": "^2.2.0",
|
||||
@@ -46136,7 +46178,7 @@
|
||||
"semver": "^7.3.7",
|
||||
"tar": "^6.1.11",
|
||||
"tslib": "^2.4.0",
|
||||
"xml2js": "^0.4.23"
|
||||
"xml2js": "^0.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ionic/utils-object": {
|
||||
@@ -46252,6 +46294,22 @@
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
|
||||
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==",
|
||||
"dev": true
|
||||
},
|
||||
"xml2js": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz",
|
||||
"integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
}
|
||||
},
|
||||
"xmlbuilder": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -62416,9 +62474,10 @@
|
||||
}
|
||||
},
|
||||
"jetifier": {
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/jetifier/-/jetifier-1.6.8.tgz",
|
||||
"integrity": "sha512-3Zi16h6L5tXDRQJTb221cnRoVG9/9OvreLdLU2/ZjRv/GILL+2Cemt0IKvkowwkDpvouAU1DQPOJ7qaiHeIdrw=="
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jetifier/-/jetifier-2.0.0.tgz",
|
||||
"integrity": "sha512-J4Au9KuT74te+PCCCHKgAjyLlEa+2VyIAEPNCdE5aNkAJ6FAJcAqcdzEkSnzNksIa9NkGmC4tPiClk2e7tCJuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"joi": {
|
||||
"version": "17.7.1",
|
||||
@@ -70509,6 +70568,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"swiper": {
|
||||
"version": "11.0.5",
|
||||
"resolved": "https://registry.npmjs.org/swiper/-/swiper-11.0.5.tgz",
|
||||
"integrity": "sha512-rhCwupqSyRnWrtNzWzemnBLMoyYuoDgGgspAm/8iBD3jCvAWycPLH4Z3TB0O5520DHLzMx94yUMH/B9Efpa48w=="
|
||||
},
|
||||
"symbol-observable": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
|
||||
|
||||
+3
-2
@@ -161,7 +161,6 @@
|
||||
"ionic2-calendar": "^0.6.6",
|
||||
"ionicons": "^5.5.3",
|
||||
"jest-puppeteer": "^7.0.1",
|
||||
"jetifier": "^1.6.8",
|
||||
"lite-server": "^2.6.1",
|
||||
"minisearch": "^6.0.1",
|
||||
"moment": "^2.29.3",
|
||||
@@ -182,6 +181,7 @@
|
||||
"send-intent": "^5.0.0",
|
||||
"sharp": "^0.30.7",
|
||||
"socket.io-client": "^2.3.0",
|
||||
"swiper": "^11.0.5",
|
||||
"tinymce": "^6.6.0",
|
||||
"ts-jest": "^27.0.3",
|
||||
"ts-jest-puppeteer": "^0.0.5",
|
||||
@@ -200,7 +200,7 @@
|
||||
"@angular/compiler": "^12.1.2",
|
||||
"@angular/compiler-cli": "^12.1.2",
|
||||
"@angular/language-service": "^12.1.2",
|
||||
"@capacitor/cli": "^4.6.1",
|
||||
"@capacitor/cli": "^4.8.1",
|
||||
"@ionic/angular-toolkit": "^6.1.0",
|
||||
"@ionic/lab": "3.1.7",
|
||||
"@types/core-js": "^2.5.7",
|
||||
@@ -231,6 +231,7 @@
|
||||
"jest-environment-jsdom": "^27.5.1",
|
||||
"jest-jasmine2": "^29.4.3",
|
||||
"jest-preset-angular": "^9.0.4",
|
||||
"jetifier": "^2.0.0",
|
||||
"karma": "^6.3.20",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { ChatController } from './controller/chat';
|
||||
import { register } from 'swiper/element/bundle';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -22,7 +23,7 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
monthYearA11yLabel: "MMMM YYYY"
|
||||
}
|
||||
}
|
||||
|
||||
register();
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
|
||||
@@ -88,6 +88,7 @@ import { CreateProcessPage } from './modals/create-process/create-process.page';
|
||||
import { LoggingInterceptorService } from './services/logging-interceptor.service';
|
||||
import { PopupQuestionPipe } from './modals/popup-question.pipe';
|
||||
import '@teamhive/capacitor-video-recorder';
|
||||
import { tokenInterceptor } from './interceptors/token.interceptors';
|
||||
|
||||
|
||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
@@ -214,7 +215,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
FileOpener,
|
||||
DocumentViewer,
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
|
||||
|
||||
tokenInterceptor
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpHandler,
|
||||
HttpEvent,
|
||||
HttpInterceptor,
|
||||
HttpErrorResponse,
|
||||
HTTP_INTERCEPTORS,
|
||||
HttpClient,
|
||||
} from "@angular/common/http";
|
||||
import { AuthService } from '../services/auth.service';
|
||||
import { Observable, throwError, BehaviorSubject, of } from "rxjs";
|
||||
import { catchError, filter, take, switchMap, tap } from "rxjs/operators";
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { environment } from "src/environments/environment";
|
||||
|
||||
@Injectable()
|
||||
export class TokenInterceptor implements HttpInterceptor {
|
||||
private isRefreshing = false;
|
||||
private refreshTokenSubject: BehaviorSubject<any> = new BehaviorSubject<any>(
|
||||
null
|
||||
);
|
||||
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
|
||||
intercept(
|
||||
request: HttpRequest<any>,
|
||||
next: HttpHandler
|
||||
): Observable<HttpEvent<any>> {
|
||||
if (SessionStore.user.Authorization) {
|
||||
request = this.addToken(request, SessionStore.user.Authorization);
|
||||
}
|
||||
|
||||
return next.handle(request).pipe(
|
||||
catchError((error) => {
|
||||
if (error instanceof HttpErrorResponse && error.status === 401) {
|
||||
return this.handle401Error(request, next);
|
||||
} else {
|
||||
return throwError(error);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private addToken(request: HttpRequest<any>, token: string) {
|
||||
return request.clone({
|
||||
setHeaders: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
private handle401Error(request: HttpRequest<any>, next: HttpHandler) {
|
||||
if (!this.isRefreshing) {
|
||||
this.isRefreshing = true;
|
||||
this.refreshTokenSubject.next(null);
|
||||
|
||||
return this.refreshToken().pipe(
|
||||
switchMap((token: any) => {
|
||||
this.isRefreshing = false;
|
||||
this.refreshTokenSubject.next(token['result'].accessToken);
|
||||
return next.handle(this.addToken(request, token['result'].accessToken));
|
||||
})
|
||||
);
|
||||
} else {
|
||||
return this.refreshTokenSubject.pipe(
|
||||
filter((token) => token != null),
|
||||
take(1),
|
||||
switchMap((jwt) => {
|
||||
return next.handle(this.addToken(request, jwt));
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//this method refresh token is declared here temporary beacouse a circular error
|
||||
refreshToken() {
|
||||
|
||||
return this.http
|
||||
.put<any>(environment.apiURL + "UserAuthentication/RefreshToken", {
|
||||
refreshToken: SessionStore.user.RefreshToken,
|
||||
},)
|
||||
.pipe(
|
||||
tap((tokens) => {
|
||||
console.log(tokens)
|
||||
SessionStore.user.Authorization = tokens.Authorization;
|
||||
SessionStore.user.RefreshToken = tokens.refreshToken;
|
||||
|
||||
}),
|
||||
catchError((error) => {
|
||||
/* this.logoutUser(); */
|
||||
return of(false);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const tokenInterceptor = {
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: TokenInterceptor,
|
||||
multi: true
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { IonSlides, ModalController, NavParams } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ImageCroppedEvent } from 'ngx-image-cropper';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { GroupIconsPage } from '../group-icons/group-icons.page';
|
||||
@@ -22,7 +22,7 @@ export class PreviewCameraPage implements OnInit {
|
||||
public ThemeService: ThemeService,) { }
|
||||
|
||||
|
||||
@ViewChild(IonSlides) slides : IonSlides
|
||||
/* @ViewChild(IonSlides) slides : IonSlides */
|
||||
image: any;
|
||||
name: string
|
||||
_updatedAt: string
|
||||
@@ -47,13 +47,13 @@ ngOnInit() {
|
||||
}
|
||||
|
||||
ionViewDidEnter(){
|
||||
this.slides.update()
|
||||
/* this.slides.update() */
|
||||
}
|
||||
|
||||
async zoom(zoomIn: boolean){
|
||||
const slider = await this.slides.getSwiper() //is swipper =!
|
||||
/* const slider = await this.slides.getSwiper() //is swipper =!
|
||||
const zoom = slider.zoom
|
||||
zoomIn ? zoom.in(): zoom.out()
|
||||
zoomIn ? zoom.in(): zoom.out() */
|
||||
}
|
||||
|
||||
close(){
|
||||
|
||||
@@ -56,7 +56,8 @@ export class ProfilePage implements OnInit {
|
||||
private processesService: ProcessesService,
|
||||
private eventsService: EventsService,
|
||||
private storageService: StorageService,
|
||||
public NotificationHolderService: NotificationHolderService
|
||||
public NotificationHolderService: NotificationHolderService,
|
||||
private authservice: AuthService
|
||||
) {
|
||||
|
||||
window['e'] = () => {
|
||||
@@ -377,6 +378,7 @@ export class ProfilePage implements OnInit {
|
||||
}
|
||||
|
||||
logout() {
|
||||
this.authservice.logoutUser();
|
||||
SessionStore.setInativity(false)
|
||||
SessionStore.setUrlBeforeInactivity(this.router.url);
|
||||
this.logoutOut == false
|
||||
|
||||
@@ -8,7 +8,7 @@ export class Publication{
|
||||
Message: string;
|
||||
DatePublication: Date | string;
|
||||
OriginalFileName?: string;
|
||||
FileBase64?:string = "";
|
||||
Files:any = [];
|
||||
FileExtension?: string;
|
||||
OrganicEntityId?: number;
|
||||
}
|
||||
@@ -97,4 +97,5 @@ export class UserSession {
|
||||
UrlBeforeInactivity: string;
|
||||
UserPermissions: any;
|
||||
UserPhoto: string;
|
||||
RefreshToken: string
|
||||
}
|
||||
@@ -122,7 +122,7 @@ export class LoginPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
let attempt = await this.authService.login(this.userattempt, { saveSession: false })
|
||||
const data = await this.authService.loginContenteProduction(this.userattempt, { saveSession: true })
|
||||
/* const data = await this.authService.loginContenteProduction(this.userattempt, { saveSession: true }) */
|
||||
|
||||
|
||||
loader.remove()
|
||||
@@ -131,7 +131,7 @@ export class LoginPage implements OnInit {
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
CPSession.save(data)
|
||||
/* CPSession.save(data) */
|
||||
this.changeProfileService.run();
|
||||
|
||||
if (attempt.ChatData) {
|
||||
@@ -165,7 +165,7 @@ export class LoginPage implements OnInit {
|
||||
this.storage.clear();
|
||||
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
CPSession.save(data)
|
||||
/* CPSession.save(data) */
|
||||
this.changeProfileService.run();
|
||||
|
||||
|
||||
|
||||
@@ -27,20 +27,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="filecontent" class="ion-item-container-no-border mb-20">
|
||||
<div *ngIf="seletedContent.length > 0" class="ion-item-container-no-border mb-20">
|
||||
<ion-label class="attached-title pb-10">Fotografia Anexada</ion-label>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex">
|
||||
<ion-thumbnail *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start">
|
||||
|
||||
<ion-img *ngIf="checkFileType.checkFileType(seleted.fileType) == 'image'" [(ngModel)]="capturedImage"
|
||||
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.base64"
|
||||
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage"
|
||||
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.FileBase64"
|
||||
(click)="imageSize(capturedImage)"></ion-img>
|
||||
|
||||
<video *ngIf="checkFileType.checkFileType(seleted.fileType) == 'video'" width="70" height="70"
|
||||
<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,' + capturedVideo">
|
||||
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.FileBase64">
|
||||
</video>
|
||||
|
||||
</ion-thumbnail>
|
||||
@@ -64,20 +64,20 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="picture d-flex pb-5 hide-desktop"
|
||||
*ngIf="publication && !( publication.FileBase64 == 'data:image/jpg;base64,null' || publication.FileBase64 == '' ) && !capturedImage">
|
||||
<div class="post-img" *ngIf="publication.FileBase64">
|
||||
<img src="{{publication.FileBase64}}" alt="image">
|
||||
<!-- <div class="picture d-flex pb-5 hide-desktop"
|
||||
*ngIf="publication && !( publication.Files[0].FileBase64 == 'data:image/jpg;base64,null' || publication.Files[0].FileBase64 == '' )">
|
||||
<div class="post-img" *ngIf="publication.Files[0].FileBase64 ">
|
||||
<img src="{{publication.Files[0].FileBase64 }}" alt="image">
|
||||
</div>
|
||||
<div class="d-flex flex-column pl-10" *ngIf="publication.FileBase64">
|
||||
<div class="d-flex flex-column pl-10" *ngIf="publication.Files[0].FileBase64 ">
|
||||
<div class="picture-file-name">{{publication.OriginalFileName}}.{{publication.FileExtension}}</div>
|
||||
<!-- <div class="size">75 Kb</div> -->
|
||||
<div class="size">75 Kb</div>
|
||||
</div>
|
||||
<div class="flex-grow-1 d-flex align-center justify-end font-25" *ngIf="publication.FileBase64"
|
||||
<div class="flex-grow-1 d-flex align-center justify-end font-25" *ngIf="publication.Files[0].FileBase64 "
|
||||
(click)="deletePublicationImage()">
|
||||
<ion-icon name="close"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="ion-item-container-no-border">
|
||||
<ion-label (click)="chossePhotoOrVideo()">
|
||||
|
||||
File diff suppressed because one or more lines are too long
+16
-6
@@ -23,19 +23,29 @@
|
||||
</div>
|
||||
|
||||
<div class="post-item overflow-y-auto">
|
||||
<div (click)="play()" *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
<!-- <img src="{{publication.FileBase64}}" alt="image" > -->
|
||||
<video controls>
|
||||
<source type="video/mp4" src="{{publication.FileBase64}}">
|
||||
<swiper-container [modules]="swiperModules" [pagination]="{clickable: true, dynamicBullets: true }">
|
||||
<swiper-slide *ngFor="let files of publication.Files let k = index">
|
||||
<div (click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)">
|
||||
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img"
|
||||
src="{{'data:image/jpg;base64,' + files.FileBase64}}">
|
||||
|
||||
<video *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="metadata"
|
||||
webkit-playsinline="webkit-playsinline">
|
||||
<source src="{{'data:video/mp4;base64,' + files.FileBase64}}" type="video/mp4">
|
||||
</video>
|
||||
|
||||
</div>
|
||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
</swiper-slide>
|
||||
</swiper-container>
|
||||
<!-- <div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="post-description px-20">
|
||||
<pre class="text font-14-rem">{{publication.Message}}</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="publication.Title == ''" class="d-flex flex-column">
|
||||
|
||||
+6
-4
@@ -11,6 +11,7 @@ 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';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +38,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
public p:PermissionService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
public publicationFolderService: PublicationFolderService
|
||||
public publicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -65,7 +67,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
Message: '',
|
||||
/* image: null, */
|
||||
DatePublication: null,
|
||||
FileBase64: '',
|
||||
Files: [],
|
||||
OriginalFileName: '',
|
||||
FileExtension: '',
|
||||
};
|
||||
@@ -85,7 +87,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
this.publications.GetPublicationById(this.DocumentId).subscribe(res => {
|
||||
this.publications.GetPublicationWithArrayOfFilesById(this.DocumentId).subscribe(res => {
|
||||
|
||||
/* this.publication = res; */
|
||||
this.publication = {
|
||||
@@ -95,7 +97,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
Title:res.Title,
|
||||
Message: res.Message,
|
||||
DatePublication: res.DatePublication,
|
||||
FileBase64: "data:video/mp4;base64," +res.FileBase64,
|
||||
Files: res.Files,
|
||||
OriginalFileName: res.OriginalFileName,
|
||||
FileExtension: res.FileExtension,
|
||||
}
|
||||
|
||||
@@ -43,18 +43,27 @@
|
||||
|
||||
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
|
||||
<ion-card-content>
|
||||
<div *ngIf="publication.FileExtension != 'mp4'" (click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)" class="post-img" >
|
||||
<img [lazyLoad]="publication.FileBase64">
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="publication.FileExtension == 'mp4'" (click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)" class="post-video" >
|
||||
<swiper-container [modules]="swiperModules" [pagination]="{clickable: true, dynamicBullets: true }">
|
||||
<swiper-slide *ngFor="let files of publication.Files let k = index">
|
||||
<div (click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)">
|
||||
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img"
|
||||
[lazyLoad]="'data:image/jpg;base64,' + files.FileBase64">
|
||||
|
||||
<video controls="controls" preload="metadata" webkit-playsinline="webkit-playsinline">
|
||||
<source src="{{publication.FileBase64}}" type="video/mp4">
|
||||
<video *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="metadata"
|
||||
webkit-playsinline="webkit-playsinline">
|
||||
<source src="{{'data:video/mp4;base64,' + files.FileBase64}}" type="video/mp4">
|
||||
</video>
|
||||
|
||||
</div>
|
||||
</swiper-slide>
|
||||
</swiper-container>
|
||||
<!-- <div *ngIf="publication.FileExtension == 'mp4'"
|
||||
(click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)" class="post-video">
|
||||
|
||||
</div> -->
|
||||
|
||||
<div class="post-content">
|
||||
<div class="post-title-time">
|
||||
<div class="post-title font-15-em">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '~src/function.scss';
|
||||
@import "~src/function.scss";
|
||||
|
||||
:host {
|
||||
background: transparent;
|
||||
@@ -27,7 +27,7 @@
|
||||
.div-search {
|
||||
font-size: rem(45);
|
||||
float: left;
|
||||
margin: 0 0 0 10px
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
.div-logo {
|
||||
background: transparent;
|
||||
@@ -86,11 +86,8 @@
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
|
||||
float: left;
|
||||
font-size: rem(35);
|
||||
|
||||
|
||||
}
|
||||
.div-title {
|
||||
/* padding: 0!important; */
|
||||
@@ -139,7 +136,6 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: black;
|
||||
|
||||
}
|
||||
.post-video {
|
||||
width: 100%;
|
||||
@@ -157,7 +153,6 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background: black;
|
||||
|
||||
}
|
||||
video {
|
||||
max-width: -webkit-fill-available;
|
||||
@@ -190,7 +185,109 @@
|
||||
color: #000;
|
||||
}
|
||||
|
||||
|
||||
.font-13-em {
|
||||
font-size: 0.8125em !important;
|
||||
}
|
||||
|
||||
.numbertext {
|
||||
color: #f2f2f2;
|
||||
font-size: 12px;
|
||||
padding: 8px 12px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.prev,
|
||||
.next {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: auto;
|
||||
margin-top: -22px;
|
||||
padding: 16px;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
transition: 0.6s ease;
|
||||
border-radius: 0 3px 3px 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* Position the "next button" to the right */
|
||||
.next {
|
||||
right: 0;
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
/* On hover, add a black background color with a little bit see-through */
|
||||
.prev:hover,
|
||||
.next:hover {
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
.dot {
|
||||
cursor: pointer;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
margin: 0 2px;
|
||||
background-color: #bbb;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
transition: background-color 0.6s ease;
|
||||
}
|
||||
|
||||
.active,
|
||||
.dot:hover {
|
||||
background-color: #717171;
|
||||
}
|
||||
|
||||
swiper-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
swiper-slide {
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
background: #ffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
swiper-slide img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
max-height: 400px;
|
||||
min-height: 350px;
|
||||
min-width: 350px;
|
||||
|
||||
margin: 5px auto;
|
||||
|
||||
border-radius: 0px !important;
|
||||
overflow: hidden;
|
||||
background-color: white;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: black;
|
||||
}
|
||||
|
||||
swiper-slide video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
max-height: 400px;
|
||||
min-height: 350px;
|
||||
min-width: 350px;
|
||||
|
||||
margin: 5px auto;
|
||||
|
||||
border-radius: 0px !important;
|
||||
overflow: hidden;
|
||||
background-color: white;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background: black;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController,IonicSlides } from '@ionic/angular';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||
@@ -15,6 +15,7 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||
import { CapacitorVideoPlayer } from 'capacitor-video-player';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -31,13 +32,23 @@ export class ViewPublicationsPage implements OnInit {
|
||||
folderId: string;
|
||||
id: string;
|
||||
error: any;
|
||||
arrayOfFile: any = [];
|
||||
|
||||
publicationPipe = new PublicationPipe()
|
||||
publicationDitails: any;
|
||||
getpublication = [];
|
||||
private videoplayer: any;
|
||||
private videoUrl: any;
|
||||
|
||||
slideOpts = {
|
||||
initialSlide: 0,
|
||||
speed: 400,
|
||||
loop: true,
|
||||
pagination : {
|
||||
el: '.swiper-pagination',
|
||||
clickable: true
|
||||
}
|
||||
};
|
||||
swiperModules = [IonicSlides];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -50,7 +61,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
public p: PermissionService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
private storage: Storage,
|
||||
public publicationFolderService: PublicationFolderService,) {
|
||||
public publicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService) {
|
||||
|
||||
this.createPublicationList()
|
||||
|
||||
@@ -209,7 +221,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
async loadPublication(publicationId, folderId) {
|
||||
let Publication = await this.publications.GetPublicationWithArrayOfFilesById(publicationId).toPromise();
|
||||
console.log('Publications with array of file: ', Publication)
|
||||
console.log('Publications with array of file: ', Publication.Files)
|
||||
this.arrayOfFile = Publication.Files
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
|
||||
@@ -19,7 +19,7 @@ export class PublicationPipe implements PipeTransform {
|
||||
"Message": element.Message,
|
||||
"DatePublication": element.DatePublication,
|
||||
/* image:itemImage, */
|
||||
"FileBase64": "data:image/jpg;base64," + element.FileBase64,
|
||||
"Files": element.Files,
|
||||
"OriginalFileName": element.OriginalFileName,
|
||||
"FileExtension": element.FileExtension,
|
||||
"OrganicEntityId": element.OrganicEntityId,
|
||||
|
||||
@@ -33,7 +33,7 @@ export class AttachmentsService {
|
||||
setHeader() {
|
||||
this.loggeduser = SessionStore.user
|
||||
this.headers = new HttpHeaders();;
|
||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
}
|
||||
|
||||
uploadFile(formData: any) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { StorageService } from './storage.service';
|
||||
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
|
||||
import { LoginUserRespose, UserForm, UserSession } from '../models/user.model';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { BehaviorSubject, of } from 'rxjs';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { AESEncrypt } from '../services/aesencrypt.service';
|
||||
@@ -21,6 +21,7 @@ import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { captureException } from '@sentry/angular';
|
||||
import { CPSession } from '../store/documentManagement';
|
||||
import { catchError, tap } from 'rxjs/operators';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -80,17 +81,24 @@ export class AuthService {
|
||||
}
|
||||
|
||||
async login(user: UserForm, { saveSession = true }): Promise<LoginUserRespose> {
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password, user.username));
|
||||
user.BasicAuthKey = btoa(user.username + ':' + this.aesencrypt.encrypt(user.password, user.username));
|
||||
|
||||
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||
|
||||
this.opts = {
|
||||
headers: this.headers,
|
||||
/* headers: this.headers, */
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
}
|
||||
let body = {
|
||||
"Auth": user.BasicAuthKey,
|
||||
"ChannelId": 1
|
||||
}
|
||||
|
||||
let response: any;
|
||||
|
||||
try {
|
||||
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
|
||||
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", body, this.opts).toPromise();
|
||||
|
||||
|
||||
if (saveSession) {
|
||||
@@ -117,7 +125,7 @@ export class AuthService {
|
||||
let response: any;
|
||||
|
||||
try {
|
||||
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/LoginJwt", '', this.opts).toPromise();
|
||||
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
|
||||
console.log('JWT', response)
|
||||
|
||||
if (saveSession) {
|
||||
@@ -293,4 +301,46 @@ export class AuthService {
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
async logoutUser() {
|
||||
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
|
||||
this.opts = {
|
||||
headers: this.headers,
|
||||
}
|
||||
|
||||
let response: any;
|
||||
try {
|
||||
response = await this.http.delete<LoginUserRespose>(environment.apiURL + "userauthentication/Logout", this.opts).toPromise();
|
||||
SessionStore.user.Authorization = "";
|
||||
SessionStore.user.RefreshToken = "";
|
||||
} catch (error) {
|
||||
this.errorHandler.handleError(error);
|
||||
this.httpErroHandle.loginHttpStatusHandle(error)
|
||||
captureException(error);
|
||||
} finally {
|
||||
return response
|
||||
}
|
||||
}
|
||||
|
||||
refreshToken() {
|
||||
|
||||
return this.http
|
||||
.put<any>(environment.apiURL + "UserAuthentication/RefreshToken", {
|
||||
refreshToken: SessionStore.user.RefreshToken,
|
||||
},)
|
||||
.pipe(
|
||||
tap((tokens) => {
|
||||
console.log(tokens)
|
||||
SessionStore.user.Authorization = tokens.Authorization;
|
||||
SessionStore.user.RefreshToken = tokens.refreshToken;
|
||||
|
||||
}),
|
||||
catchError((error) => {
|
||||
this.logoutUser();
|
||||
return of(false);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ export class ChatService {
|
||||
async refreshtoken() {
|
||||
|
||||
if(this.headers && SessionStore.user.ChatData) {
|
||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
let options = {
|
||||
headers: this.headers
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ export class ContactsService {
|
||||
setHeader() {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.headers = new HttpHeaders();;
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
}
|
||||
|
||||
getContacts(namefilter:string): Observable<EventPerson[]>{
|
||||
|
||||
@@ -99,7 +99,7 @@ export class EventsService {
|
||||
this.headerSharedOficial= new HttpHeaders();;
|
||||
this.headerSharedPessoal= new HttpHeaders();;
|
||||
|
||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
|
||||
this.usersCalendarIds = [];
|
||||
this.calendarNames = {}
|
||||
@@ -137,7 +137,7 @@ export class EventsService {
|
||||
this.hasOwnOficial = true
|
||||
|
||||
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ export class EventsService {
|
||||
|
||||
this.hasOwnPessoal = true
|
||||
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
@@ -159,7 +159,7 @@ export class EventsService {
|
||||
|
||||
this.hasSharedOficial = true
|
||||
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ export class EventsService {
|
||||
|
||||
this.hasSharedPessoal = true
|
||||
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
@@ -183,7 +183,7 @@ export class EventsService {
|
||||
|
||||
this.hasOwnOficial = true
|
||||
|
||||
this.headersPrOficial = this.headersPrOficial.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headersPrOficial = this.headersPrOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ export class EventsService {
|
||||
|
||||
this.hasOwnPessoal = true
|
||||
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
@@ -216,7 +216,7 @@ export class EventsService {
|
||||
|
||||
this.hasOwnOficial = true
|
||||
|
||||
this.headerOwnOficial = this.headerOwnOficial.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headerOwnOficial = this.headerOwnOficial.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headerOwnOficial = this.headerOwnOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
|
||||
@@ -225,7 +225,7 @@ export class EventsService {
|
||||
|
||||
this.hasOwnPessoal = true
|
||||
|
||||
this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
|
||||
@@ -248,7 +248,7 @@ export class EventsService {
|
||||
if (sharedCalendar.CalendarName == 'Oficial') {
|
||||
this.hasSharedOficial = true
|
||||
|
||||
this.headerSharedOficial = this.headerSharedOficial.set('Authorization',SessionStore.user.BasicAuthKey);
|
||||
this.headerSharedOficial = this.headerSharedOficial.set('Authorization','Bearer ' + SessionStore.user.Authorization);
|
||||
this.headerSharedOficial = this.headerSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
|
||||
@@ -257,7 +257,7 @@ export class EventsService {
|
||||
|
||||
this.hasSharedPessoal = true
|
||||
|
||||
this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization',SessionStore.user.BasicAuthKey);
|
||||
this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization','Bearer ' + SessionStore.user.Authorization);
|
||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
|
||||
@@ -378,7 +378,7 @@ export class EventsService {
|
||||
|
||||
makeHeader(calendar: calendarInterface) {
|
||||
let header = new HttpHeaders();;
|
||||
header = header.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
header = header.set('CalendarId', calendar.CalendarId);
|
||||
header = header.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
header = header.set('CalendarName', calendar.CalendarName);
|
||||
@@ -616,7 +616,7 @@ export class EventsService {
|
||||
|
||||
for(let agendasCalendar of agendasCalendars) {
|
||||
var header = new HttpHeaders();;
|
||||
header = header.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
header = header.set('CalendarId', agendasCalendar.CalendarId);
|
||||
header = header.set('CalendarRoleId', agendasCalendar.CalendarRoleId);
|
||||
header = header.set('CalendarName', agendasCalendar.CalendarName);
|
||||
@@ -649,7 +649,7 @@ export class EventsService {
|
||||
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||
|
||||
var header = new HttpHeaders();;
|
||||
header = header.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
header = header.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
header = header.set('CalendarId', sharedCalendar.CalendarId);
|
||||
header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
header = header.set('CalendarName', sharedCalendar.CalendarName);
|
||||
|
||||
@@ -32,7 +32,7 @@ export class OrganicEntityService {
|
||||
setHeader() {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.headers = new HttpHeaders();;
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
}
|
||||
|
||||
getOrganicEntity(): Observable<OrganicEntity[]>{
|
||||
|
||||
@@ -46,11 +46,11 @@ export class ProcessesService {
|
||||
|
||||
this.headers = new HttpHeaders();;
|
||||
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
|
||||
this.headers2 = new HttpHeaders();;
|
||||
|
||||
this.headers2 = this.headers2.set('Authorization', "Bearer " + CPSession.AuthorizationJwt);
|
||||
this.headers2 = this.headers2.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export class PublicationsService {
|
||||
setHeader () {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.headers = new HttpHeaders();;
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
}
|
||||
|
||||
GetPublicationFolderList(){
|
||||
@@ -218,7 +218,8 @@ GetIdsPublicationNext(id:any){
|
||||
//my last tries
|
||||
|
||||
CreatePublication(folderId:any,body:any){
|
||||
const geturl = environment.apiURL + 'presidentialActions/'+folderId+'/posts';
|
||||
console.log('body publi', body)
|
||||
const geturl = environment.apiURL + 'presidentialActions/'+folderId+'/v2/posts';
|
||||
let params = new HttpParams();
|
||||
params = params.set("folderId", folderId);
|
||||
let options = {
|
||||
|
||||
@@ -38,7 +38,7 @@ export class SearchService {
|
||||
setHeader() {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.headers = new HttpHeaders();;
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
<div class="content-container">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<div *ngIf="publicationType!='1'" class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Title" name="title" placeholder="Título*" ></ion-input>
|
||||
<div *ngIf="publicationType!='1'" class="ion-item-container"
|
||||
[class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Title" name="title"
|
||||
placeholder="Título*"></ion-input>
|
||||
</div>
|
||||
|
||||
<div *ngIf="publicationType!='1' " class="container-div pb-20">
|
||||
@@ -23,8 +25,10 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-textarea-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
|
||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto*"></ion-textarea>
|
||||
<div class="ion-textarea-class flex-grow-1"
|
||||
[class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
|
||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message"
|
||||
name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto*"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,21 +40,30 @@
|
||||
|
||||
|
||||
<!-- Captured -->
|
||||
<div class="ion-item-container-no-border" *ngIf="captureContent">
|
||||
<div class="ion-item-container-no-border" *ngIf="seletedContent.length > 0">
|
||||
<ion-label class="attached-title pb-10">Fotografia Anexada</ion-label>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex">
|
||||
<ion-thumbnail *ngIf="fileType == 'image'" slot="start">
|
||||
<ion-img [(ngModel)]="captureContent" name="image" ngDefaultControl [src]="captureContent"></ion-img>
|
||||
</ion-thumbnail>
|
||||
|
||||
<ion-thumbnail slot="start">
|
||||
<video *ngIf="fileType == 'video'" width="70" height="70" controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline">
|
||||
<source type="video/mp4" [src]="captureContent">
|
||||
<ion-thumbnail *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start">
|
||||
|
||||
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
|
||||
name="image" ngDefaultControl [src]="seleted.FileBase64"
|
||||
(click)="imageSize(seleted.FileBase64)"></ion-img>
|
||||
|
||||
<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]="seleted.FileBase64">
|
||||
</video>
|
||||
|
||||
</ion-thumbnail>
|
||||
<!-- Display the blurred image and count if there are more images -->
|
||||
<ion-thumbnail *ngIf="seletedContent.length > displayLimit" lot="start">
|
||||
<ion-img [src]="'data:image/jpg;base64,' + seletedContent[displayLimit - 1].base64"
|
||||
style="filter: blur(5px);"></ion-img>
|
||||
|
||||
|
||||
<p>mais {{ seletedContent.length - displayLimit }}</p>
|
||||
</ion-thumbnail>
|
||||
|
||||
<ion-label class="pl-10">
|
||||
<p>{{capturedImageTitle}}</p>
|
||||
@@ -65,13 +78,15 @@
|
||||
|
||||
|
||||
<!-- Current -->
|
||||
<div *ngIf="!captureContent">
|
||||
<div class="ion-item-container-no-border mb-20" *ngIf="publication && !( publication.FileBase64 == 'data:image/jpg;base64,null' || publication.FileBase64 == '' ) && !capturedImage">
|
||||
<!-- <ion-label class="attached-title pb-10">Fotografia Anexada</ion-label> -->
|
||||
<!-- <div *ngIf="!captureContent">
|
||||
<div class="ion-item-container-no-border mb-20"
|
||||
*ngIf="publication && !( publication.FileBase64 == 'data:image/jpg;base64,null' || publication.FileBase64 == '' ) && !capturedImage">
|
||||
<ion-label class="attached-title pb-10">Fotografia Anexada</ion-label>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex">
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-img [(ngModel)]="publication.FileBase64" name="image" ngDefaultControl [src]="publication.FileBase64"></ion-img>
|
||||
<ion-img [(ngModel)]="publication.FileBase64" name="image" ngDefaultControl
|
||||
[src]="publication.FileBase64"></ion-img>
|
||||
</ion-thumbnail>
|
||||
|
||||
<ion-label class="pl-10">
|
||||
@@ -84,7 +99,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
|
||||
@@ -92,7 +107,8 @@
|
||||
<ion-label (click)="loadVideo()">
|
||||
<div class="attach-icon">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photo.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photo.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' "
|
||||
src="assets/images/theme/gov/icons-add-photo.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document cursor-pointer">
|
||||
<ion-label>Tirar Fotografia</ion-label>
|
||||
@@ -104,7 +120,8 @@
|
||||
<ion-label (click)="loadVideo()" class="cursor-pointer">
|
||||
<div class="attach-icon">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photos.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photos.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' "
|
||||
src="assets/images/theme/gov/icons-add-photos.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document cursor-pointer">
|
||||
<ion-label>Anexar Fotografia</ion-label>
|
||||
|
||||
File diff suppressed because one or more lines are too long
+13
-6
@@ -32,16 +32,23 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="post-item px-20">
|
||||
<div (click)="openPreview(publication)" class="post-img">
|
||||
<img *ngIf="publication.FileExtension == 'jpeg'" src="{{publication.FileBase64}}" alt="image" tappable>
|
||||
<swiper-container [modules]="swiperModules" navigation="true" [pagination]="{clickable: true, dynamicBullets: true }">
|
||||
<swiper-slide *ngFor="let files of publication.Files let k = index">
|
||||
<div (click)="openPreview(publication)">
|
||||
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" alt="image" tappable
|
||||
src="{{'data:image/jpg;base64,' + files.FileBase64}}">
|
||||
|
||||
<video *ngIf="publication.FileExtension == 'mp4'" controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline">
|
||||
<source type="video/mp4" [src]="publication.FileBase64">
|
||||
<video *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" controls="controls" autoplay="autoplay" preload="metadata"
|
||||
webkit-playsinline="webkit-playsinline">
|
||||
<source src="{{'data:video/mp4;base64,' + files.FileBase64}}" type="video/mp4">
|
||||
</video>
|
||||
|
||||
</div>
|
||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
</swiper-slide>
|
||||
</swiper-container>
|
||||
<!-- <div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="post-description">
|
||||
<pre class="text">{{publication.Message}}</pre>
|
||||
</div>
|
||||
|
||||
+35
@@ -98,3 +98,38 @@
|
||||
margin: 0 auto;
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
|
||||
swiper-slide img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
max-height: 1000px;
|
||||
max-width: 868px;
|
||||
|
||||
min-height: 350px;
|
||||
min-width: 468px;
|
||||
object-fit: cover;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
swiper-slide video {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
max-height: 1000px;
|
||||
max-width: 868px;
|
||||
|
||||
min-height: 350px;
|
||||
min-width: 468px;
|
||||
object-fit: cover;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
+4
-2
@@ -10,6 +10,7 @@ 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';
|
||||
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
@Component({
|
||||
selector: 'app-publication-detail-shared',
|
||||
templateUrl: './publication-detail.page.html',
|
||||
@@ -34,6 +35,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
public p:PermissionService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
public publicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService
|
||||
) {
|
||||
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
@@ -45,7 +47,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
Message: '',
|
||||
/* image: null, */
|
||||
DatePublication: null,
|
||||
FileBase64: '',
|
||||
Files: [],
|
||||
OriginalFileName: '',
|
||||
FileExtension: '',
|
||||
};
|
||||
@@ -80,7 +82,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
console.log('API res')
|
||||
|
||||
this.showLoader = true;
|
||||
this.publications.GetPublicationById(this.publicationId).subscribe(res => {
|
||||
this.publications.GetPublicationWithArrayOfFilesById(this.publicationId).subscribe(res => {
|
||||
|
||||
this.publication = this.publicationPipe.itemList(res)
|
||||
|
||||
|
||||
@@ -28,27 +28,32 @@
|
||||
</div>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-content [scrollEvents]="true" (ionScroll)="onScroll($event)">
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-container px-20" *ngIf="publicationFolderService.FolderDetails[folderId]">
|
||||
<div class="main-container px-20" *ngIf="publicationFolderService.FolderDetails[foldserId]">
|
||||
<p class="item-content-detail">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
|
||||
|
||||
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
|
||||
<ion-card-content>
|
||||
<div *ngIf="publication.FileExtension != 'mp4'" class="post-img cursor-pointer" (click)="viewPublicationDetail(publication.DocumentId, publication.ProcessId)">
|
||||
<img [lazyLoad]="publication.FileBase64">
|
||||
</div>
|
||||
|
||||
<div *ngIf="publication.FileExtension == 'mp4'" class="post-video cursor-pointer" (click)="viewPublicationDetail(publication.DocumentId, publication.ProcessId)">
|
||||
<video controls="controls" preload="metadata" webkit-playsinline="webkit-playsinline" class="videoPlayer">
|
||||
<source [src]="publication.FileBase64" type="video/mp4" />
|
||||
<swiper-container [modules]="swiperModules" [speed]=400 navigation="true" [pagination]="{clickable: true, dynamicBullets: true }">
|
||||
<swiper-slide *ngFor="let files of publication.Files let k = index">
|
||||
<div (click)="viewPublicationDetail(publication.DocumentId, publication.ProcessId)">
|
||||
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img cursor-pointer"
|
||||
[lazyLoad]="'data:image/jpg;base64,' + files.FileBase64">
|
||||
|
||||
<video #myVideo *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="metadata"
|
||||
webkit-playsinline="webkit-playsinline" class="videoPlayer">
|
||||
<source [src]="'data:video/mp4;base64,' + files.FileBase64" type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</swiper-slide>
|
||||
</swiper-container>
|
||||
|
||||
<div class="post-content">
|
||||
<div class="post-title-time">
|
||||
|
||||
@@ -234,8 +234,6 @@ ion-fab-button:hover{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ion-card{
|
||||
width: fit-content;
|
||||
max-width: calc(468px + 16px + 16px);
|
||||
@@ -244,3 +242,52 @@ ion-card{
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
|
||||
swiper-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
swiper-slide {
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
background: #ffff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
swiper-slide img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
max-height: 500px;
|
||||
max-width: 468px;
|
||||
|
||||
min-height: 350px;
|
||||
min-width: 468px;
|
||||
object-fit: cover;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
swiper-slide video {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
max-height: 500px;
|
||||
max-width: 468px;
|
||||
|
||||
min-height: 350px;
|
||||
min-width: 468px;
|
||||
object-fit: fill;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
||||
import { IonicSlides, ModalController } from '@ionic/angular';
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
@@ -14,6 +14,7 @@ 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';
|
||||
import { AskModalPage } from 'src/app/modals/ask-modal/ask-modal.page';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -38,6 +39,11 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
publicationPipe = new PublicationPipe()
|
||||
|
||||
swiperModules = [IonicSlides];
|
||||
@ViewChild('myVideo') myVideo: any;
|
||||
public lastScrollTop = 0;
|
||||
public isHidden = false;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private publications: PublicationsService,
|
||||
@@ -46,7 +52,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private storage: Storage,
|
||||
public p: PermissionService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
public publicationFolderService: PublicationFolderService
|
||||
public publicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService
|
||||
) {
|
||||
this.createPublicationList()
|
||||
}
|
||||
@@ -182,7 +189,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
async loadPublication(publicationId, folderId) {
|
||||
let Publication = await this.publications.GetPublicationById(publicationId).toPromise();
|
||||
let Publication = await this.publications.GetPublicationWithArrayOfFilesById(publicationId).toPromise();
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
@@ -290,4 +297,19 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
stopVideo() {
|
||||
this.myVideo.nativeElement.pause();
|
||||
this.myVideo.nativeElement.currentTime = 0;
|
||||
}
|
||||
|
||||
public onScroll(event): void {
|
||||
if(this.lastScrollTop < event.detail.scrollTop) {
|
||||
console.log("scrolling down")
|
||||
} else {
|
||||
console.log("scrolling up")
|
||||
}
|
||||
|
||||
this.lastScrollTop = event.detail.scrollTop;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -203,11 +203,11 @@ export class PublicationFolderService {
|
||||
|
||||
|
||||
PublicationHasImage(Publication: Publication) {
|
||||
return Publication.FileBase64 != '' && Publication.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.FileBase64 != '' && Publication.FileBase64 != "data:image/jpg;base64,null"
|
||||
return Publication.Files[0].FileBase64 != '' && Publication.Files[0].FileBase64 != "data:image/jpg;base64,null"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Environment } from './../../app/models/envarioment'
|
||||
|
||||
export const DevProd: Environment = {
|
||||
id:'3',
|
||||
apiURL: 'https://gdapi-dev.dyndns.info/api/',
|
||||
apiURL: 'https://gdapi-dev.dyndns.info/jwt/api/',
|
||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
||||
@@ -47,7 +47,7 @@ export const DevProd: Environment = {
|
||||
|
||||
export const DevDev: Environment = {
|
||||
id:'3',
|
||||
apiURL: 'https://gdapi-dev.dyndns.info/api/',
|
||||
apiURL: 'https://gdapi-dev.dyndns.info/jwt/api/',
|
||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
||||
|
||||
Reference in New Issue
Block a user