mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
jwt implemented
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
package="com.gpr.gabinetedigital">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
@@ -40,10 +39,15 @@
|
|||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
<!-- Depending on your project, you can add here the type of data you wish to receive -->
|
<!-- 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="image/*" />
|
||||||
<data android:mimeType="video/*" />
|
<data android:mimeType="video/*" />
|
||||||
</intent-filter>
|
</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>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"server": {
|
"server": {
|
||||||
"url": "http://192.168.0.57:8101",
|
"url": "http://192.168.1.3:8101",
|
||||||
"originalUrl": "http://192.168.0.95:8100"
|
"originalUrl": "http://192.168.1.3:8100"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -19,13 +19,16 @@ def capacitor_pods
|
|||||||
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
|
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
|
||||||
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
|
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
|
||||||
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
|
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
|
||||||
pod 'CapacitorLocalNotifications', :path => '../../node_modules/@capacitor/local-notifications'
|
|
||||||
pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
|
pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
|
||||||
pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications'
|
pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications'
|
||||||
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
|
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
|
||||||
pod 'CapacitorStorage', :path => '../../node_modules/@capacitor/storage'
|
pod 'CapacitorStorage', :path => '../../node_modules/@capacitor/storage'
|
||||||
|
pod 'CapawesomeCapacitorFilePicker', :path => '../../node_modules/@capawesome/capacitor-file-picker'
|
||||||
pod 'SentryCapacitor', :path => '../../node_modules/@sentry/capacitor'
|
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 'CapacitorVoiceRecorder', :path => '../../node_modules/capacitor-voice-recorder'
|
||||||
|
pod 'SendIntent', :path => '../../node_modules/send-intent'
|
||||||
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
|
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
|
||||||
pod 'CordovaPluginsResources', :path => '../capacitor-cordova-ios-plugins'
|
pod 'CordovaPluginsResources', :path => '../capacitor-cordova-ios-plugins'
|
||||||
end
|
end
|
||||||
|
|||||||
Generated
+88
-24
@@ -147,7 +147,6 @@
|
|||||||
"ionic2-calendar": "^0.6.6",
|
"ionic2-calendar": "^0.6.6",
|
||||||
"ionicons": "^5.5.3",
|
"ionicons": "^5.5.3",
|
||||||
"jest-puppeteer": "^7.0.1",
|
"jest-puppeteer": "^7.0.1",
|
||||||
"jetifier": "^1.6.8",
|
|
||||||
"lite-server": "^2.6.1",
|
"lite-server": "^2.6.1",
|
||||||
"minisearch": "^6.0.1",
|
"minisearch": "^6.0.1",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.29.3",
|
||||||
@@ -168,6 +167,7 @@
|
|||||||
"send-intent": "^5.0.0",
|
"send-intent": "^5.0.0",
|
||||||
"sharp": "^0.30.7",
|
"sharp": "^0.30.7",
|
||||||
"socket.io-client": "^2.3.0",
|
"socket.io-client": "^2.3.0",
|
||||||
|
"swiper": "^11.0.5",
|
||||||
"tinymce": "^6.6.0",
|
"tinymce": "^6.6.0",
|
||||||
"ts-jest": "^27.0.3",
|
"ts-jest": "^27.0.3",
|
||||||
"ts-jest-puppeteer": "^0.0.5",
|
"ts-jest-puppeteer": "^0.0.5",
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
"@angular/compiler": "^12.1.2",
|
"@angular/compiler": "^12.1.2",
|
||||||
"@angular/compiler-cli": "^12.1.2",
|
"@angular/compiler-cli": "^12.1.2",
|
||||||
"@angular/language-service": "^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/angular-toolkit": "^6.1.0",
|
||||||
"@ionic/lab": "3.1.7",
|
"@ionic/lab": "3.1.7",
|
||||||
"@types/core-js": "^2.5.7",
|
"@types/core-js": "^2.5.7",
|
||||||
@@ -217,6 +217,7 @@
|
|||||||
"jest-environment-jsdom": "^27.5.1",
|
"jest-environment-jsdom": "^27.5.1",
|
||||||
"jest-jasmine2": "^29.4.3",
|
"jest-jasmine2": "^29.4.3",
|
||||||
"jest-preset-angular": "^9.0.4",
|
"jest-preset-angular": "^9.0.4",
|
||||||
|
"jetifier": "^2.0.0",
|
||||||
"karma": "^6.3.20",
|
"karma": "^6.3.20",
|
||||||
"karma-chrome-launcher": "~3.1.0",
|
"karma-chrome-launcher": "~3.1.0",
|
||||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||||
@@ -3722,15 +3723,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@capacitor/cli": {
|
"node_modules/@capacitor/cli": {
|
||||||
"version": "4.6.1",
|
"version": "4.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.8.1.tgz",
|
||||||
"integrity": "sha512-iFMK83B67RXEQyWi1kOzQmRdCFc/pPD924mjAXG7yFLVyMvVRGAwwf8LzWFzHyQDoKK+auPMHycVfzm9T6Iyyg==",
|
"integrity": "sha512-Ssxh+YaMuP+ZHJYaRJ78NCxS5L+u3X3XWK+NGhe+aluRZDigK5LJIiqjp+K3Xx1zQBG62gWWCEZoDvXJvafPIw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ionic/cli-framework-output": "^2.2.5",
|
"@ionic/cli-framework-output": "2.2.5",
|
||||||
"@ionic/utils-fs": "^3.1.6",
|
"@ionic/utils-fs": "3.1.6",
|
||||||
"@ionic/utils-subprocess": "^2.1.11",
|
"@ionic/utils-subprocess": "2.1.11",
|
||||||
"@ionic/utils-terminal": "^2.3.3",
|
"@ionic/utils-terminal": "2.3.3",
|
||||||
"commander": "^9.3.0",
|
"commander": "^9.3.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"env-paths": "^2.2.0",
|
"env-paths": "^2.2.0",
|
||||||
@@ -3743,7 +3744,7 @@
|
|||||||
"semver": "^7.3.7",
|
"semver": "^7.3.7",
|
||||||
"tar": "^6.1.11",
|
"tar": "^6.1.11",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"xml2js": "^0.4.23"
|
"xml2js": "^0.5.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"cap": "bin/capacitor",
|
"cap": "bin/capacitor",
|
||||||
@@ -3908,6 +3909,28 @@
|
|||||||
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==",
|
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==",
|
||||||
"dev": true
|
"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": {
|
"node_modules/@capacitor/core": {
|
||||||
"version": "5.4.2",
|
"version": "5.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-5.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-5.4.2.tgz",
|
||||||
@@ -24649,9 +24672,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jetifier": {
|
"node_modules/jetifier": {
|
||||||
"version": "1.6.8",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/jetifier/-/jetifier-1.6.8.tgz",
|
"resolved": "https://registry.npmjs.org/jetifier/-/jetifier-2.0.0.tgz",
|
||||||
"integrity": "sha512-3Zi16h6L5tXDRQJTb221cnRoVG9/9OvreLdLU2/ZjRv/GILL+2Cemt0IKvkowwkDpvouAU1DQPOJ7qaiHeIdrw==",
|
"integrity": "sha512-J4Au9KuT74te+PCCCHKgAjyLlEa+2VyIAEPNCdE5aNkAJ6FAJcAqcdzEkSnzNksIa9NkGmC4tPiClk2e7tCJuQ==",
|
||||||
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"jetifier": "bin/jetify",
|
"jetifier": "bin/jetify",
|
||||||
"jetifier-standalone": "bin/jetifier-standalone",
|
"jetifier-standalone": "bin/jetifier-standalone",
|
||||||
@@ -35202,6 +35226,24 @@
|
|||||||
"node": ">= 10"
|
"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": {
|
"node_modules/symbol-observable": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
|
||||||
@@ -46115,15 +46157,15 @@
|
|||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"@capacitor/cli": {
|
"@capacitor/cli": {
|
||||||
"version": "4.6.1",
|
"version": "4.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-4.8.1.tgz",
|
||||||
"integrity": "sha512-iFMK83B67RXEQyWi1kOzQmRdCFc/pPD924mjAXG7yFLVyMvVRGAwwf8LzWFzHyQDoKK+auPMHycVfzm9T6Iyyg==",
|
"integrity": "sha512-Ssxh+YaMuP+ZHJYaRJ78NCxS5L+u3X3XWK+NGhe+aluRZDigK5LJIiqjp+K3Xx1zQBG62gWWCEZoDvXJvafPIw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@ionic/cli-framework-output": "^2.2.5",
|
"@ionic/cli-framework-output": "2.2.5",
|
||||||
"@ionic/utils-fs": "^3.1.6",
|
"@ionic/utils-fs": "3.1.6",
|
||||||
"@ionic/utils-subprocess": "^2.1.11",
|
"@ionic/utils-subprocess": "2.1.11",
|
||||||
"@ionic/utils-terminal": "^2.3.3",
|
"@ionic/utils-terminal": "2.3.3",
|
||||||
"commander": "^9.3.0",
|
"commander": "^9.3.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"env-paths": "^2.2.0",
|
"env-paths": "^2.2.0",
|
||||||
@@ -46136,7 +46178,7 @@
|
|||||||
"semver": "^7.3.7",
|
"semver": "^7.3.7",
|
||||||
"tar": "^6.1.11",
|
"tar": "^6.1.11",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"xml2js": "^0.4.23"
|
"xml2js": "^0.5.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ionic/utils-object": {
|
"@ionic/utils-object": {
|
||||||
@@ -46252,6 +46294,22 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
|
||||||
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==",
|
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==",
|
||||||
"dev": true
|
"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": {
|
"jetifier": {
|
||||||
"version": "1.6.8",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/jetifier/-/jetifier-1.6.8.tgz",
|
"resolved": "https://registry.npmjs.org/jetifier/-/jetifier-2.0.0.tgz",
|
||||||
"integrity": "sha512-3Zi16h6L5tXDRQJTb221cnRoVG9/9OvreLdLU2/ZjRv/GILL+2Cemt0IKvkowwkDpvouAU1DQPOJ7qaiHeIdrw=="
|
"integrity": "sha512-J4Au9KuT74te+PCCCHKgAjyLlEa+2VyIAEPNCdE5aNkAJ6FAJcAqcdzEkSnzNksIa9NkGmC4tPiClk2e7tCJuQ==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"joi": {
|
"joi": {
|
||||||
"version": "17.7.1",
|
"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": {
|
"symbol-observable": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
|
||||||
|
|||||||
+3
-2
@@ -161,7 +161,6 @@
|
|||||||
"ionic2-calendar": "^0.6.6",
|
"ionic2-calendar": "^0.6.6",
|
||||||
"ionicons": "^5.5.3",
|
"ionicons": "^5.5.3",
|
||||||
"jest-puppeteer": "^7.0.1",
|
"jest-puppeteer": "^7.0.1",
|
||||||
"jetifier": "^1.6.8",
|
|
||||||
"lite-server": "^2.6.1",
|
"lite-server": "^2.6.1",
|
||||||
"minisearch": "^6.0.1",
|
"minisearch": "^6.0.1",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.29.3",
|
||||||
@@ -182,6 +181,7 @@
|
|||||||
"send-intent": "^5.0.0",
|
"send-intent": "^5.0.0",
|
||||||
"sharp": "^0.30.7",
|
"sharp": "^0.30.7",
|
||||||
"socket.io-client": "^2.3.0",
|
"socket.io-client": "^2.3.0",
|
||||||
|
"swiper": "^11.0.5",
|
||||||
"tinymce": "^6.6.0",
|
"tinymce": "^6.6.0",
|
||||||
"ts-jest": "^27.0.3",
|
"ts-jest": "^27.0.3",
|
||||||
"ts-jest-puppeteer": "^0.0.5",
|
"ts-jest-puppeteer": "^0.0.5",
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
"@angular/compiler": "^12.1.2",
|
"@angular/compiler": "^12.1.2",
|
||||||
"@angular/compiler-cli": "^12.1.2",
|
"@angular/compiler-cli": "^12.1.2",
|
||||||
"@angular/language-service": "^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/angular-toolkit": "^6.1.0",
|
||||||
"@ionic/lab": "3.1.7",
|
"@ionic/lab": "3.1.7",
|
||||||
"@types/core-js": "^2.5.7",
|
"@types/core-js": "^2.5.7",
|
||||||
@@ -231,6 +231,7 @@
|
|||||||
"jest-environment-jsdom": "^27.5.1",
|
"jest-environment-jsdom": "^27.5.1",
|
||||||
"jest-jasmine2": "^29.4.3",
|
"jest-jasmine2": "^29.4.3",
|
||||||
"jest-preset-angular": "^9.0.4",
|
"jest-preset-angular": "^9.0.4",
|
||||||
|
"jetifier": "^2.0.0",
|
||||||
"karma": "^6.3.20",
|
"karma": "^6.3.20",
|
||||||
"karma-chrome-launcher": "~3.1.0",
|
"karma-chrome-launcher": "~3.1.0",
|
||||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
"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 { environment } from 'src/environments/environment';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { ChatController } from './controller/chat';
|
import { ChatController } from './controller/chat';
|
||||||
|
import { register } from 'swiper/element/bundle';
|
||||||
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
@@ -22,7 +23,7 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
|||||||
monthYearA11yLabel: "MMMM YYYY"
|
monthYearA11yLabel: "MMMM YYYY"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
register();
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ import { CreateProcessPage } from './modals/create-process/create-process.page';
|
|||||||
import { LoggingInterceptorService } from './services/logging-interceptor.service';
|
import { LoggingInterceptorService } from './services/logging-interceptor.service';
|
||||||
import { PopupQuestionPipe } from './modals/popup-question.pipe';
|
import { PopupQuestionPipe } from './modals/popup-question.pipe';
|
||||||
import '@teamhive/capacitor-video-recorder';
|
import '@teamhive/capacitor-video-recorder';
|
||||||
|
import { tokenInterceptor } from './interceptors/token.interceptors';
|
||||||
|
|
||||||
|
|
||||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||||
@@ -214,7 +215,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
|||||||
FileOpener,
|
FileOpener,
|
||||||
DocumentViewer,
|
DocumentViewer,
|
||||||
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
|
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
|
||||||
|
tokenInterceptor
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
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 { 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 { ImageCroppedEvent } from 'ngx-image-cropper';
|
||||||
import { PublicationsService } from 'src/app/services/publications.service';
|
import { PublicationsService } from 'src/app/services/publications.service';
|
||||||
import { GroupIconsPage } from '../group-icons/group-icons.page';
|
import { GroupIconsPage } from '../group-icons/group-icons.page';
|
||||||
@@ -22,7 +22,7 @@ export class PreviewCameraPage implements OnInit {
|
|||||||
public ThemeService: ThemeService,) { }
|
public ThemeService: ThemeService,) { }
|
||||||
|
|
||||||
|
|
||||||
@ViewChild(IonSlides) slides : IonSlides
|
/* @ViewChild(IonSlides) slides : IonSlides */
|
||||||
image: any;
|
image: any;
|
||||||
name: string
|
name: string
|
||||||
_updatedAt: string
|
_updatedAt: string
|
||||||
@@ -47,13 +47,13 @@ ngOnInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ionViewDidEnter(){
|
ionViewDidEnter(){
|
||||||
this.slides.update()
|
/* this.slides.update() */
|
||||||
}
|
}
|
||||||
|
|
||||||
async zoom(zoomIn: boolean){
|
async zoom(zoomIn: boolean){
|
||||||
const slider = await this.slides.getSwiper() //is swipper =!
|
/* const slider = await this.slides.getSwiper() //is swipper =!
|
||||||
const zoom = slider.zoom
|
const zoom = slider.zoom
|
||||||
zoomIn ? zoom.in(): zoom.out()
|
zoomIn ? zoom.in(): zoom.out() */
|
||||||
}
|
}
|
||||||
|
|
||||||
close(){
|
close(){
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ export class ProfilePage implements OnInit {
|
|||||||
private processesService: ProcessesService,
|
private processesService: ProcessesService,
|
||||||
private eventsService: EventsService,
|
private eventsService: EventsService,
|
||||||
private storageService: StorageService,
|
private storageService: StorageService,
|
||||||
public NotificationHolderService: NotificationHolderService
|
public NotificationHolderService: NotificationHolderService,
|
||||||
|
private authservice: AuthService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
window['e'] = () => {
|
window['e'] = () => {
|
||||||
@@ -377,6 +378,7 @@ export class ProfilePage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
|
this.authservice.logoutUser();
|
||||||
SessionStore.setInativity(false)
|
SessionStore.setInativity(false)
|
||||||
SessionStore.setUrlBeforeInactivity(this.router.url);
|
SessionStore.setUrlBeforeInactivity(this.router.url);
|
||||||
this.logoutOut == false
|
this.logoutOut == false
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export class Publication{
|
|||||||
Message: string;
|
Message: string;
|
||||||
DatePublication: Date | string;
|
DatePublication: Date | string;
|
||||||
OriginalFileName?: string;
|
OriginalFileName?: string;
|
||||||
FileBase64?:string = "";
|
Files:any = [];
|
||||||
FileExtension?: string;
|
FileExtension?: string;
|
||||||
OrganicEntityId?: number;
|
OrganicEntityId?: number;
|
||||||
}
|
}
|
||||||
@@ -97,4 +97,5 @@ export class UserSession {
|
|||||||
UrlBeforeInactivity: string;
|
UrlBeforeInactivity: string;
|
||||||
UserPermissions: any;
|
UserPermissions: any;
|
||||||
UserPhoto: string;
|
UserPhoto: string;
|
||||||
|
RefreshToken: string
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ export class LoginPage implements OnInit {
|
|||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
let attempt = await this.authService.login(this.userattempt, { saveSession: false })
|
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()
|
loader.remove()
|
||||||
@@ -131,7 +131,7 @@ export class LoginPage implements OnInit {
|
|||||||
if (attempt.UserId == SessionStore.user.UserId) {
|
if (attempt.UserId == SessionStore.user.UserId) {
|
||||||
|
|
||||||
await this.authService.SetSession(attempt, this.userattempt);
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
CPSession.save(data)
|
/* CPSession.save(data) */
|
||||||
this.changeProfileService.run();
|
this.changeProfileService.run();
|
||||||
|
|
||||||
if (attempt.ChatData) {
|
if (attempt.ChatData) {
|
||||||
@@ -165,7 +165,7 @@ export class LoginPage implements OnInit {
|
|||||||
this.storage.clear();
|
this.storage.clear();
|
||||||
|
|
||||||
await this.authService.SetSession(attempt, this.userattempt);
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
CPSession.save(data)
|
/* CPSession.save(data) */
|
||||||
this.changeProfileService.run();
|
this.changeProfileService.run();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,20 +27,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
<ion-label class="attached-title pb-10">Fotografia Anexada</ion-label>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<ion-thumbnail *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start">
|
<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"
|
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage"
|
||||||
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.base64"
|
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.FileBase64"
|
||||||
(click)="imageSize(capturedImage)"></ion-img>
|
(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">
|
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>
|
</video>
|
||||||
|
|
||||||
</ion-thumbnail>
|
</ion-thumbnail>
|
||||||
@@ -64,20 +64,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="picture d-flex pb-5 hide-desktop"
|
<!-- <div class="picture d-flex pb-5 hide-desktop"
|
||||||
*ngIf="publication && !( publication.FileBase64 == 'data:image/jpg;base64,null' || publication.FileBase64 == '' ) && !capturedImage">
|
*ngIf="publication && !( publication.Files[0].FileBase64 == 'data:image/jpg;base64,null' || publication.Files[0].FileBase64 == '' )">
|
||||||
<div class="post-img" *ngIf="publication.FileBase64">
|
<div class="post-img" *ngIf="publication.Files[0].FileBase64 ">
|
||||||
<img src="{{publication.FileBase64}}" alt="image">
|
<img src="{{publication.Files[0].FileBase64 }}" alt="image">
|
||||||
</div>
|
</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="picture-file-name">{{publication.OriginalFileName}}.{{publication.FileExtension}}</div>
|
||||||
<!-- <div class="size">75 Kb</div> -->
|
<div class="size">75 Kb</div>
|
||||||
</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()">
|
(click)="deletePublicationImage()">
|
||||||
<ion-icon name="close"></ion-icon>
|
<ion-icon name="close"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="ion-item-container-no-border">
|
<div class="ion-item-container-no-border">
|
||||||
<ion-label (click)="chossePhotoOrVideo()">
|
<ion-label (click)="chossePhotoOrVideo()">
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+18
-8
@@ -23,19 +23,29 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-item overflow-y-auto">
|
<div class="post-item overflow-y-auto">
|
||||||
<div (click)="play()" *ngIf="publication.FileBase64.length > 30" class="post-img">
|
<swiper-container [modules]="swiperModules" [pagination]="{clickable: true, dynamicBullets: true }">
|
||||||
<!-- <img src="{{publication.FileBase64}}" alt="image" > -->
|
<swiper-slide *ngFor="let files of publication.Files let k = index">
|
||||||
<video controls>
|
<div (click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)">
|
||||||
<source type="video/mp4" src="{{publication.FileBase64}}">
|
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img"
|
||||||
</video>
|
src="{{'data:image/jpg;base64,' + files.FileBase64}}">
|
||||||
</div>
|
|
||||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
<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.FileBase64.length < 30" class="post-img">
|
||||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||||
</div>
|
</div> -->
|
||||||
<div class="post-description px-20">
|
<div class="post-description px-20">
|
||||||
<pre class="text font-14-rem">{{publication.Message}}</pre>
|
<pre class="text font-14-rem">{{publication.Message}}</pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="publication.Title == ''" class="d-flex flex-column">
|
<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 { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { PublicationFolderService } from 'src/app/store/publication-folder.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 ThemeService: ThemeService,
|
||||||
public p:PermissionService,
|
public p:PermissionService,
|
||||||
private httpErrorHandle: HttpErrorHandle,
|
private httpErrorHandle: HttpErrorHandle,
|
||||||
public publicationFolderService: PublicationFolderService
|
public publicationFolderService: PublicationFolderService,
|
||||||
|
public checkFileType: checkFileTypeService
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +67,7 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
Message: '',
|
Message: '',
|
||||||
/* image: null, */
|
/* image: null, */
|
||||||
DatePublication: null,
|
DatePublication: null,
|
||||||
FileBase64: '',
|
Files: [],
|
||||||
OriginalFileName: '',
|
OriginalFileName: '',
|
||||||
FileExtension: '',
|
FileExtension: '',
|
||||||
};
|
};
|
||||||
@@ -85,7 +87,7 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
|
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
|
|
||||||
this.publications.GetPublicationById(this.DocumentId).subscribe(res => {
|
this.publications.GetPublicationWithArrayOfFilesById(this.DocumentId).subscribe(res => {
|
||||||
|
|
||||||
/* this.publication = res; */
|
/* this.publication = res; */
|
||||||
this.publication = {
|
this.publication = {
|
||||||
@@ -95,7 +97,7 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
Title:res.Title,
|
Title:res.Title,
|
||||||
Message: res.Message,
|
Message: res.Message,
|
||||||
DatePublication: res.DatePublication,
|
DatePublication: res.DatePublication,
|
||||||
FileBase64: "data:video/mp4;base64," +res.FileBase64,
|
Files: res.Files,
|
||||||
OriginalFileName: res.OriginalFileName,
|
OriginalFileName: res.OriginalFileName,
|
||||||
FileExtension: res.FileExtension,
|
FileExtension: res.FileExtension,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,18 +43,27 @@
|
|||||||
|
|
||||||
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
|
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
|
||||||
<ion-card-content>
|
<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">
|
<video *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="metadata"
|
||||||
<source src="{{publication.FileBase64}}" type="video/mp4">
|
webkit-playsinline="webkit-playsinline">
|
||||||
</video>
|
<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>
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<div class="post-title-time">
|
<div class="post-title-time">
|
||||||
<div class="post-title font-15-em">
|
<div class="post-title font-15-em">
|
||||||
|
|||||||
@@ -1,196 +1,293 @@
|
|||||||
@import '~src/function.scss';
|
@import "~src/function.scss";
|
||||||
|
|
||||||
:host{
|
:host {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: 0!important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
ion-content{
|
ion-content {
|
||||||
--background: transparent;
|
--background: transparent;
|
||||||
--border-radius: 30px;
|
--border-radius: 30px;
|
||||||
}
|
|
||||||
ion-toolbar{
|
|
||||||
--border-width: 0 !important;
|
|
||||||
--border-style: none;
|
|
||||||
--padding-top: 0px !important;
|
|
||||||
--padding-start: 0px !important;
|
|
||||||
--padding-right: 0px !important;
|
|
||||||
--padding-end: 0px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.div-top-header{
|
|
||||||
width: 400px;
|
|
||||||
margin: 0 auto;
|
|
||||||
background-color: #0782c9;
|
|
||||||
padding-top: 15px;
|
|
||||||
border: 0!important;
|
|
||||||
}
|
|
||||||
.div-search{
|
|
||||||
font-size: rem(45);
|
|
||||||
float: left;
|
|
||||||
margin: 0 0 0 10px
|
|
||||||
}
|
|
||||||
.div-logo{
|
|
||||||
background: transparent;
|
|
||||||
width: 140px;
|
|
||||||
margin: 5px 0 0px 71px;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
.div-logo img{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.div-profile{
|
|
||||||
font-size: rem(45);
|
|
||||||
float: right;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.main-header{
|
|
||||||
width: 100%; /* 400px */
|
|
||||||
height: 100%;
|
|
||||||
font-family: Roboto;
|
|
||||||
background-color: #fff;
|
|
||||||
overflow:hidden;
|
|
||||||
padding: 25px 20px 0px 20px;
|
|
||||||
color:#000;
|
|
||||||
}
|
|
||||||
.main-content{
|
|
||||||
width: 100%; /* 400px */
|
|
||||||
height: 100%;
|
|
||||||
font-family: Roboto;
|
|
||||||
margin: 0 auto;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 15px 20px 0 20px;
|
|
||||||
}
|
|
||||||
.content-top{
|
|
||||||
background: #f3f2f2;
|
|
||||||
height: 20px;
|
|
||||||
margin: 0 auto;
|
|
||||||
border-top-left-radius: 25px;
|
|
||||||
border-top-right-radius: 25px;
|
|
||||||
transform: translate3d(0, 1px, 0);
|
|
||||||
}
|
}
|
||||||
.content-container{
|
ion-toolbar {
|
||||||
width: 100%;
|
--border-width: 0 !important;
|
||||||
margin:0 auto;
|
--border-style: none;
|
||||||
border-top-left-radius: 25px;
|
--padding-top: 0px !important;
|
||||||
border-top-right-radius: 25px;
|
--padding-start: 0px !important;
|
||||||
background: #ffffff;
|
--padding-right: 0px !important;
|
||||||
height: 100%;
|
--padding-end: 0px !important;
|
||||||
box-shadow: 0px 0px 18px rgba(0, 0, 0, 0.6);
|
|
||||||
padding: 25px 0px 0 0px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
.title-content{
|
|
||||||
margin: 0px auto;
|
|
||||||
overflow: auto;
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-icon{
|
|
||||||
|
|
||||||
float: left;
|
|
||||||
font-size: rem(35);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
.div-title{
|
|
||||||
/* padding: 0!important; */
|
|
||||||
float: left;
|
|
||||||
margin: 2.5px 0 0 5px;
|
|
||||||
color: #000 !important;
|
|
||||||
}
|
|
||||||
.title{
|
|
||||||
color: #000 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions-icon{
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
.actions-icon ion-icon{
|
|
||||||
margin-left: 10px;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
.item-content-date{
|
|
||||||
color: #797979;
|
|
||||||
}
|
|
||||||
.item-content-detail{
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
.post-item{
|
|
||||||
width: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
margin: 0 auto;
|
|
||||||
border-radius: 0px;
|
|
||||||
padding: 0!important;
|
|
||||||
}
|
|
||||||
.post-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;
|
|
||||||
|
|
||||||
}
|
|
||||||
.post-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;
|
|
||||||
|
|
||||||
}
|
|
||||||
video{
|
|
||||||
max-width: -webkit-fill-available;
|
|
||||||
}
|
|
||||||
.post-img img{
|
|
||||||
height: 100%;
|
|
||||||
max-height: 420px;
|
|
||||||
}
|
|
||||||
.post-content{
|
|
||||||
margin: 0 auto;
|
|
||||||
margin-bottom: 35px;
|
|
||||||
}
|
|
||||||
.post-title-time{
|
|
||||||
width: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
.post-title{
|
|
||||||
width: 60%;
|
|
||||||
float: left;
|
|
||||||
color: #0d89d1;
|
|
||||||
}
|
|
||||||
.post-data{
|
|
||||||
width: 40%;
|
|
||||||
float: left;
|
|
||||||
color: #797979;
|
|
||||||
text-align: right;
|
|
||||||
}
|
}
|
||||||
.post-description{
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.div-top-header {
|
||||||
|
width: 400px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #0782c9;
|
||||||
|
padding-top: 15px;
|
||||||
|
border: 0 !important;
|
||||||
|
}
|
||||||
|
.div-search {
|
||||||
|
font-size: rem(45);
|
||||||
|
float: left;
|
||||||
|
margin: 0 0 0 10px;
|
||||||
|
}
|
||||||
|
.div-logo {
|
||||||
|
background: transparent;
|
||||||
|
width: 140px;
|
||||||
|
margin: 5px 0 0px 71px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.div-logo img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.div-profile {
|
||||||
|
font-size: rem(45);
|
||||||
|
float: right;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.main-header {
|
||||||
|
width: 100%; /* 400px */
|
||||||
|
height: 100%;
|
||||||
|
font-family: Roboto;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 25px 20px 0px 20px;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.main-content {
|
||||||
|
width: 100%; /* 400px */
|
||||||
|
height: 100%;
|
||||||
|
font-family: Roboto;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 15px 20px 0 20px;
|
||||||
|
}
|
||||||
|
.content-top {
|
||||||
|
background: #f3f2f2;
|
||||||
|
height: 20px;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-top-left-radius: 25px;
|
||||||
|
border-top-right-radius: 25px;
|
||||||
|
transform: translate3d(0, 1px, 0);
|
||||||
|
}
|
||||||
|
.content-container {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-top-left-radius: 25px;
|
||||||
|
border-top-right-radius: 25px;
|
||||||
|
background: #ffffff;
|
||||||
|
height: 100%;
|
||||||
|
box-shadow: 0px 0px 18px rgba(0, 0, 0, 0.6);
|
||||||
|
padding: 25px 0px 0 0px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.title-content {
|
||||||
|
margin: 0px auto;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-icon {
|
||||||
|
float: left;
|
||||||
|
font-size: rem(35);
|
||||||
|
}
|
||||||
|
.div-title {
|
||||||
|
/* padding: 0!important; */
|
||||||
|
float: left;
|
||||||
|
margin: 2.5px 0 0 5px;
|
||||||
|
color: #000 !important;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
color: #000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions-icon {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.actions-icon ion-icon {
|
||||||
|
margin-left: 10px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.item-content-date {
|
||||||
|
color: #797979;
|
||||||
|
}
|
||||||
|
.item-content-detail {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.post-item {
|
||||||
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
margin: 0 auto;
|
||||||
|
border-radius: 0px;
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
.post-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;
|
||||||
|
}
|
||||||
|
.post-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;
|
||||||
|
}
|
||||||
|
video {
|
||||||
|
max-width: -webkit-fill-available;
|
||||||
|
}
|
||||||
|
.post-img img {
|
||||||
|
height: 100%;
|
||||||
|
max-height: 420px;
|
||||||
|
}
|
||||||
|
.post-content {
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-bottom: 35px;
|
||||||
|
}
|
||||||
|
.post-title-time {
|
||||||
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.post-title {
|
||||||
|
width: 60%;
|
||||||
|
float: left;
|
||||||
|
color: #0d89d1;
|
||||||
|
}
|
||||||
|
.post-data {
|
||||||
|
width: 40%;
|
||||||
|
float: left;
|
||||||
|
color: #797979;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.post-description {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
.font-13-em {
|
.font-13-em {
|
||||||
font-size: 0.8125em !important;
|
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 { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
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 { Publication } from 'src/app/models/publication';
|
||||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||||
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
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 { Storage } from '@ionic/storage';
|
||||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||||
import { CapacitorVideoPlayer } from 'capacitor-video-player';
|
import { CapacitorVideoPlayer } from 'capacitor-video-player';
|
||||||
|
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -31,13 +32,23 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
folderId: string;
|
folderId: string;
|
||||||
id: string;
|
id: string;
|
||||||
error: any;
|
error: any;
|
||||||
|
arrayOfFile: any = [];
|
||||||
|
|
||||||
publicationPipe = new PublicationPipe()
|
publicationPipe = new PublicationPipe()
|
||||||
publicationDitails: any;
|
publicationDitails: any;
|
||||||
getpublication = [];
|
getpublication = [];
|
||||||
private videoplayer: any;
|
private videoplayer: any;
|
||||||
private videoUrl: any;
|
private videoUrl: any;
|
||||||
|
slideOpts = {
|
||||||
|
initialSlide: 0,
|
||||||
|
speed: 400,
|
||||||
|
loop: true,
|
||||||
|
pagination : {
|
||||||
|
el: '.swiper-pagination',
|
||||||
|
clickable: true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
swiperModules = [IonicSlides];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -50,7 +61,8 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private httpErroHandle: HttpErrorHandle,
|
private httpErroHandle: HttpErrorHandle,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
public publicationFolderService: PublicationFolderService,) {
|
public publicationFolderService: PublicationFolderService,
|
||||||
|
public checkFileType: checkFileTypeService) {
|
||||||
|
|
||||||
this.createPublicationList()
|
this.createPublicationList()
|
||||||
|
|
||||||
@@ -209,7 +221,8 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
async loadPublication(publicationId, folderId) {
|
async loadPublication(publicationId, folderId) {
|
||||||
let Publication = await this.publications.GetPublicationWithArrayOfFilesById(publicationId).toPromise();
|
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)
|
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||||
|
|
||||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export class PublicationPipe implements PipeTransform {
|
|||||||
"Message": element.Message,
|
"Message": element.Message,
|
||||||
"DatePublication": element.DatePublication,
|
"DatePublication": element.DatePublication,
|
||||||
/* image:itemImage, */
|
/* image:itemImage, */
|
||||||
"FileBase64": "data:image/jpg;base64," + element.FileBase64,
|
"Files": element.Files,
|
||||||
"OriginalFileName": element.OriginalFileName,
|
"OriginalFileName": element.OriginalFileName,
|
||||||
"FileExtension": element.FileExtension,
|
"FileExtension": element.FileExtension,
|
||||||
"OrganicEntityId": element.OrganicEntityId,
|
"OrganicEntityId": element.OrganicEntityId,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export class AttachmentsService {
|
|||||||
setHeader() {
|
setHeader() {
|
||||||
this.loggeduser = SessionStore.user
|
this.loggeduser = SessionStore.user
|
||||||
this.headers = new HttpHeaders();;
|
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) {
|
uploadFile(formData: any) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { StorageService } from './storage.service';
|
|||||||
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
|
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
|
||||||
import { LoginUserRespose, UserForm, UserSession } from '../models/user.model';
|
import { LoginUserRespose, UserForm, UserSession } from '../models/user.model';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject, of } from 'rxjs';
|
||||||
import { AlertController } from '@ionic/angular';
|
import { AlertController } from '@ionic/angular';
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
import { AESEncrypt } from '../services/aesencrypt.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 { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { captureException } from '@sentry/angular';
|
import { captureException } from '@sentry/angular';
|
||||||
import { CPSession } from '../store/documentManagement';
|
import { CPSession } from '../store/documentManagement';
|
||||||
|
import { catchError, tap } from 'rxjs/operators';
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
@@ -80,17 +81,24 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async login(user: UserForm, { saveSession = true }): Promise<LoginUserRespose> {
|
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.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||||
|
|
||||||
this.opts = {
|
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;
|
let response: any;
|
||||||
|
|
||||||
try {
|
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) {
|
if (saveSession) {
|
||||||
@@ -117,7 +125,7 @@ export class AuthService {
|
|||||||
let response: any;
|
let response: any;
|
||||||
|
|
||||||
try {
|
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)
|
console.log('JWT', response)
|
||||||
|
|
||||||
if (saveSession) {
|
if (saveSession) {
|
||||||
@@ -169,7 +177,7 @@ export class AuthService {
|
|||||||
if (SessionStore.user.ChatData?.data) {
|
if (SessionStore.user.ChatData?.data) {
|
||||||
this.RochetChatConnectorService.connect();
|
this.RochetChatConnectorService.connect();
|
||||||
this.RochetChatConnectorService.login().then((message: any) => {
|
this.RochetChatConnectorService.login().then((message: any) => {
|
||||||
console.log('Chat login',message )
|
console.log('Chat login', message)
|
||||||
|
|
||||||
SessionStore.user.RochetChatUserId = message.result.id
|
SessionStore.user.RochetChatUserId = message.result.id
|
||||||
SessionStore.save()
|
SessionStore.save()
|
||||||
@@ -293,4 +301,46 @@ export class AuthService {
|
|||||||
|
|
||||||
await alert.present();
|
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() {
|
async refreshtoken() {
|
||||||
|
|
||||||
if(this.headers && SessionStore.user.ChatData) {
|
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 = {
|
let options = {
|
||||||
headers: this.headers
|
headers: this.headers
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export class ContactsService {
|
|||||||
setHeader() {
|
setHeader() {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.headers = new HttpHeaders();;
|
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[]>{
|
getContacts(namefilter:string): Observable<EventPerson[]>{
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export class EventsService {
|
|||||||
this.headerSharedOficial= new HttpHeaders();;
|
this.headerSharedOficial= new HttpHeaders();;
|
||||||
this.headerSharedPessoal= 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.usersCalendarIds = [];
|
||||||
this.calendarNames = {}
|
this.calendarNames = {}
|
||||||
@@ -137,7 +137,7 @@ export class EventsService {
|
|||||||
this.hasOwnOficial = true
|
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('CalendarId', calendar.CalendarId);
|
||||||
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnPessoal = true
|
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('CalendarId', calendar.CalendarId);
|
||||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasSharedOficial = true
|
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('CalendarId', sharedCalendar.CalendarId);
|
||||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasSharedPessoal = true
|
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('CalendarId', sharedCalendar.CalendarId);
|
||||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnOficial = true
|
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('CalendarId', calendar.CalendarId);
|
||||||
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
}
|
}
|
||||||
@@ -191,7 +191,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnPessoal = true
|
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('CalendarId', calendar.CalendarId);
|
||||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnOficial = true
|
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('CalendarId', calendar.CalendarId);
|
||||||
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
|
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
|
||||||
@@ -225,7 +225,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnPessoal = true
|
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('CalendarId', calendar.CalendarId);
|
||||||
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
|
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
|
||||||
@@ -248,7 +248,7 @@ export class EventsService {
|
|||||||
if (sharedCalendar.CalendarName == 'Oficial') {
|
if (sharedCalendar.CalendarName == 'Oficial') {
|
||||||
this.hasSharedOficial = true
|
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('CalendarId', sharedCalendar.CalendarId);
|
||||||
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
|
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
|
||||||
@@ -257,7 +257,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasSharedPessoal = true
|
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('CalendarId', sharedCalendar.CalendarId);
|
||||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
|
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
|
||||||
@@ -378,7 +378,7 @@ export class EventsService {
|
|||||||
|
|
||||||
makeHeader(calendar: calendarInterface) {
|
makeHeader(calendar: calendarInterface) {
|
||||||
let header = new HttpHeaders();;
|
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('CalendarId', calendar.CalendarId);
|
||||||
header = header.set('CalendarRoleId', calendar.CalendarRoleId);
|
header = header.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
header = header.set('CalendarName', calendar.CalendarName);
|
header = header.set('CalendarName', calendar.CalendarName);
|
||||||
@@ -616,7 +616,7 @@ export class EventsService {
|
|||||||
|
|
||||||
for(let agendasCalendar of agendasCalendars) {
|
for(let agendasCalendar of agendasCalendars) {
|
||||||
var header = new HttpHeaders();;
|
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('CalendarId', agendasCalendar.CalendarId);
|
||||||
header = header.set('CalendarRoleId', agendasCalendar.CalendarRoleId);
|
header = header.set('CalendarRoleId', agendasCalendar.CalendarRoleId);
|
||||||
header = header.set('CalendarName', agendasCalendar.CalendarName);
|
header = header.set('CalendarName', agendasCalendar.CalendarName);
|
||||||
@@ -649,7 +649,7 @@ export class EventsService {
|
|||||||
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||||
|
|
||||||
var header = new HttpHeaders();;
|
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('CalendarId', sharedCalendar.CalendarId);
|
||||||
header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
header = header.set('CalendarName', sharedCalendar.CalendarName);
|
header = header.set('CalendarName', sharedCalendar.CalendarName);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export class OrganicEntityService {
|
|||||||
setHeader() {
|
setHeader() {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.headers = new HttpHeaders();;
|
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[]>{
|
getOrganicEntity(): Observable<OrganicEntity[]>{
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ export class ProcessesService {
|
|||||||
|
|
||||||
this.headers = new HttpHeaders();;
|
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 = 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 () {
|
setHeader () {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.headers = new HttpHeaders();;
|
this.headers = new HttpHeaders();;
|
||||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetPublicationFolderList(){
|
GetPublicationFolderList(){
|
||||||
@@ -218,7 +218,8 @@ GetIdsPublicationNext(id:any){
|
|||||||
//my last tries
|
//my last tries
|
||||||
|
|
||||||
CreatePublication(folderId:any,body:any){
|
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();
|
let params = new HttpParams();
|
||||||
params = params.set("folderId", folderId);
|
params = params.set("folderId", folderId);
|
||||||
let options = {
|
let options = {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export class SearchService {
|
|||||||
setHeader() {
|
setHeader() {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.headers = new HttpHeaders();;
|
this.headers = new HttpHeaders();;
|
||||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,117 +1,134 @@
|
|||||||
<ion-header class="ion-no-border background-white px-20 pt-25">
|
<ion-header class="ion-no-border background-white px-20 pt-25">
|
||||||
<div class="title-content d-flex">
|
<div class="title-content d-flex">
|
||||||
<!-- <div class="back-icon">
|
<!-- <div class="back-icon">
|
||||||
<ion-icon class="font-35-rem" (click)="goBack()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
<ion-icon class="font-35-rem" (click)="goBack()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="div-title">
|
<div class="div-title">
|
||||||
<ion-label class="title">{{ publicationTitle }}</ion-label> <br>
|
<ion-label class="title">{{ publicationTitle }}</ion-label> <br>
|
||||||
<i style="margin-top: -3px; font-size: 15px;" > Campos marcados com * são obrigatórios</i>
|
<i style="margin-top: -3px; font-size: 15px;"> Campos marcados com * são obrigatórios</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<div class="content-container">
|
<div class="content-container">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<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 ">
|
<div *ngIf="publicationType!='1'" class="ion-item-container"
|
||||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Title" name="title" placeholder="Título*" ></ion-input>
|
[class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||||
</div>
|
<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">
|
<div *ngIf="publicationType!='1' " class="container-div pb-20">
|
||||||
<div class="ion-item-class-2 d-flex">
|
<div class="ion-item-class-2 d-flex">
|
||||||
<div class="ion-icon-class" >
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-textarea-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
|
<div class="ion-textarea-class flex-grow-1"
|
||||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto*"></ion-textarea>
|
[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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <div *ngIf="publication">
|
<!-- <div *ngIf="publication">
|
||||||
OriginalFileName: {{ publication.OriginalFileName }}
|
OriginalFileName: {{ publication.OriginalFileName }}
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Captured -->
|
<!-- 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>
|
<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">
|
|
||||||
</video>
|
|
||||||
</ion-thumbnail>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ion-label class="pl-10">
|
|
||||||
<p>{{capturedImageTitle}}</p>
|
|
||||||
<p hidden>size</p>
|
|
||||||
</ion-label>
|
|
||||||
</div>
|
|
||||||
<button class="btn-no-color" (click)="clear()">
|
|
||||||
<ion-icon name="close"></ion-icon>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 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 class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<ion-thumbnail slot="start">
|
|
||||||
<ion-img [(ngModel)]="publication.FileBase64" name="image" ngDefaultControl [src]="publication.FileBase64"></ion-img>
|
<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-thumbnail>
|
||||||
|
|
||||||
<ion-label class="pl-10">
|
<ion-label class="pl-10">
|
||||||
<p>{{publication.OriginalFileName}}.{{publication.FileExtension}}</p>
|
<p>{{capturedImageTitle}}</p>
|
||||||
<p hidden>size</p>
|
<p hidden>size</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn-no-color" (click)="deletePublicationImage()" >
|
<button class="btn-no-color" (click)="clear()">
|
||||||
<ion-icon name="close"></ion-icon>
|
<ion-icon name="close"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 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 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-thumbnail>
|
||||||
|
|
||||||
<div class="ion-item-container-no-border hide-desktop">
|
<ion-label class="pl-10">
|
||||||
<ion-label (click)="loadVideo()">
|
<p>{{publication.OriginalFileName}}.{{publication.FileExtension}}</p>
|
||||||
<div class="attach-icon">
|
<p hidden>size</p>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photo.svg"></ion-icon>
|
</ion-label>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photo.svg"></ion-icon>
|
</div>
|
||||||
</div>
|
<button class="btn-no-color" (click)="deletePublicationImage()">
|
||||||
<div class="attach-document cursor-pointer">
|
<ion-icon name="close"></ion-icon>
|
||||||
<ion-label>Tirar Fotografia</ion-label>
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="ion-item-container-no-border hide-desktop">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
<div class="attach-document cursor-pointer">
|
||||||
|
<ion-label>Tirar Fotografia</ion-label>
|
||||||
|
</div>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ion-item-container-no-border">
|
<div class="ion-item-container-no-border">
|
||||||
<ion-label (click)="loadVideo()" class="cursor-pointer">
|
<ion-label (click)="loadVideo()" class="cursor-pointer">
|
||||||
<div class="attach-icon">
|
<div class="attach-icon">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photos.svg"></ion-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' "
|
||||||
</div>
|
src="assets/images/theme/gov/icons-add-photos.svg"></ion-icon>
|
||||||
<div class="attach-document cursor-pointer">
|
</div>
|
||||||
<ion-label>Anexar Fotografia</ion-label>
|
<div class="attach-document cursor-pointer">
|
||||||
</div>
|
<ion-label>Anexar Fotografia</ion-label>
|
||||||
</ion-label>
|
</div>
|
||||||
|
</ion-label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+15
-8
@@ -32,16 +32,23 @@
|
|||||||
</ion-refresher-content>
|
</ion-refresher-content>
|
||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
<div class="post-item px-20">
|
<div class="post-item px-20">
|
||||||
<div (click)="openPreview(publication)" class="post-img">
|
<swiper-container [modules]="swiperModules" navigation="true" [pagination]="{clickable: true, dynamicBullets: true }">
|
||||||
<img *ngIf="publication.FileExtension == 'jpeg'" src="{{publication.FileBase64}}" alt="image" tappable>
|
<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">
|
<video *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" controls="controls" autoplay="autoplay" preload="metadata"
|
||||||
<source type="video/mp4" [src]="publication.FileBase64">
|
webkit-playsinline="webkit-playsinline">
|
||||||
</video>
|
<source src="{{'data:video/mp4;base64,' + files.FileBase64}}" type="video/mp4">
|
||||||
</div>
|
</video>
|
||||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
|
||||||
|
</div>
|
||||||
|
</swiper-slide>
|
||||||
|
</swiper-container>
|
||||||
|
<!-- <div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||||
</div>
|
</div> -->
|
||||||
<div class="post-description">
|
<div class="post-description">
|
||||||
<pre class="text">{{publication.Message}}</pre>
|
<pre class="text">{{publication.Message}}</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+35
@@ -98,3 +98,38 @@
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-bottom: 35px;
|
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 { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||||
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||||
|
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication-detail-shared',
|
selector: 'app-publication-detail-shared',
|
||||||
templateUrl: './publication-detail.page.html',
|
templateUrl: './publication-detail.page.html',
|
||||||
@@ -34,6 +35,7 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
public p:PermissionService,
|
public p:PermissionService,
|
||||||
private httpErrorHandle: HttpErrorHandle,
|
private httpErrorHandle: HttpErrorHandle,
|
||||||
public publicationFolderService: PublicationFolderService,
|
public publicationFolderService: PublicationFolderService,
|
||||||
|
public checkFileType: checkFileTypeService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||||
@@ -45,7 +47,7 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
Message: '',
|
Message: '',
|
||||||
/* image: null, */
|
/* image: null, */
|
||||||
DatePublication: null,
|
DatePublication: null,
|
||||||
FileBase64: '',
|
Files: [],
|
||||||
OriginalFileName: '',
|
OriginalFileName: '',
|
||||||
FileExtension: '',
|
FileExtension: '',
|
||||||
};
|
};
|
||||||
@@ -80,7 +82,7 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
console.log('API res')
|
console.log('API res')
|
||||||
|
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
this.publications.GetPublicationById(this.publicationId).subscribe(res => {
|
this.publications.GetPublicationWithArrayOfFilesById(this.publicationId).subscribe(res => {
|
||||||
|
|
||||||
this.publication = this.publicationPipe.itemList(res)
|
this.publication = this.publicationPipe.itemList(res)
|
||||||
|
|
||||||
|
|||||||
@@ -28,27 +28,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content [scrollEvents]="true" (ionScroll)="onScroll($event)">
|
||||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
<ion-refresher-content>
|
<ion-refresher-content>
|
||||||
</ion-refresher-content>
|
</ion-refresher-content>
|
||||||
</ion-refresher>
|
</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>
|
<p class="item-content-detail">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
|
||||||
|
|
||||||
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
|
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
|
||||||
<ion-card-content>
|
<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)">
|
<swiper-container [modules]="swiperModules" [speed]=400 navigation="true" [pagination]="{clickable: true, dynamicBullets: true }">
|
||||||
<video controls="controls" preload="metadata" webkit-playsinline="webkit-playsinline" class="videoPlayer">
|
<swiper-slide *ngFor="let files of publication.Files let k = index">
|
||||||
<source [src]="publication.FileBase64" type="video/mp4" />
|
<div (click)="viewPublicationDetail(publication.DocumentId, publication.ProcessId)">
|
||||||
</video>
|
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img cursor-pointer"
|
||||||
</div>
|
[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>
|
||||||
|
</swiper-slide>
|
||||||
|
</swiper-container>
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<div class="post-title-time">
|
<div class="post-title-time">
|
||||||
|
|||||||
@@ -234,8 +234,6 @@ ion-fab-button:hover{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ion-card{
|
ion-card{
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
max-width: calc(468px + 16px + 16px);
|
max-width: calc(468px + 16px + 16px);
|
||||||
@@ -244,3 +242,52 @@ ion-card{
|
|||||||
margin-bottom: 20px;
|
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 { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
||||||
import { ModalController } from '@ionic/angular';
|
import { IonicSlides, ModalController } from '@ionic/angular';
|
||||||
import { Publication } from 'src/app/models/publication';
|
import { Publication } from 'src/app/models/publication';
|
||||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||||
import { PublicationsService } from 'src/app/services/publications.service';
|
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 { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||||
import { AskModalPage } from 'src/app/modals/ask-modal/ask-modal.page';
|
import { AskModalPage } from 'src/app/modals/ask-modal/ask-modal.page';
|
||||||
|
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-publications',
|
selector: 'app-view-publications',
|
||||||
@@ -28,31 +29,37 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
oldpublicationIds = []
|
oldpublicationIds = []
|
||||||
|
|
||||||
@Input() folderId: any;
|
@Input() folderId: any;
|
||||||
@Output() addNewPublication = new EventEmitter<any>();
|
@Output() addNewPublication = new EventEmitter<any>();
|
||||||
@Output() editPublication = new EventEmitter<any>();
|
@Output() editPublication = new EventEmitter<any>();
|
||||||
@Output() openPublicationDetails= new EventEmitter<any>();
|
@Output() openPublicationDetails = new EventEmitter<any>();
|
||||||
@Output() goBackToViewPublications = new EventEmitter();
|
@Output() goBackToViewPublications = new EventEmitter();
|
||||||
@Output() closeDesktopComponent = new EventEmitter<any>();
|
@Output() closeDesktopComponent = new EventEmitter<any>();
|
||||||
@Output() goBacktoPublicationDetails = new EventEmitter<any>();
|
@Output() goBacktoPublicationDetails = new EventEmitter<any>();
|
||||||
@Output() getActions= new EventEmitter<any>();
|
@Output() getActions = new EventEmitter<any>();
|
||||||
|
|
||||||
publicationPipe = new PublicationPipe()
|
publicationPipe = new PublicationPipe()
|
||||||
|
|
||||||
|
swiperModules = [IonicSlides];
|
||||||
|
@ViewChild('myVideo') myVideo: any;
|
||||||
|
public lastScrollTop = 0;
|
||||||
|
public isHidden = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private publications: PublicationsService,
|
private publications: PublicationsService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
public p:PermissionService,
|
public p: PermissionService,
|
||||||
private httpErrorHandle: HttpErrorHandle,
|
private httpErrorHandle: HttpErrorHandle,
|
||||||
public publicationFolderService: PublicationFolderService
|
public publicationFolderService: PublicationFolderService,
|
||||||
) {
|
public checkFileType: checkFileTypeService
|
||||||
this.createPublicationList()
|
) {
|
||||||
}
|
this.createPublicationList()
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if(typeof(this.folderId) == 'object') {
|
if (typeof (this.folderId) == 'object') {
|
||||||
this.folderId = this.folderId['ProcessId']
|
this.folderId = this.folderId['ProcessId']
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,11 +76,11 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
ngOnChanges(changes: any): void {
|
ngOnChanges(changes: any): void {
|
||||||
|
|
||||||
if(typeof(this.folderId) == 'object') {
|
if (typeof (this.folderId) == 'object') {
|
||||||
this.folderId = this.folderId['ProcessId']
|
this.folderId = this.folderId['ProcessId']
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.publicationFolderService.publicationList[this.folderId]) {
|
if (!this.publicationFolderService.publicationList[this.folderId]) {
|
||||||
this.publicationFolderService.FolderDetails[this.folderId] = new PublicationFolder();
|
this.publicationFolderService.FolderDetails[this.folderId] = new PublicationFolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,16 +96,16 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
createPublicationList(folderId = this.folderId) {
|
createPublicationList(folderId = this.folderId) {
|
||||||
if(!this.publicationFolderService.publicationList[this.folderId]) {
|
if (!this.publicationFolderService.publicationList[this.folderId]) {
|
||||||
this.publicationFolderService.publicationList[this.folderId] = []
|
this.publicationFolderService.publicationList[this.folderId] = []
|
||||||
}
|
}
|
||||||
if(!this.publicationFolderService.FolderDetails[this.folderId]) {
|
if (!this.publicationFolderService.FolderDetails[this.folderId]) {
|
||||||
this.publicationFolderService.FolderDetails[this.folderId] = new PublicationFolder();
|
this.publicationFolderService.FolderDetails[this.folderId] = new PublicationFolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
doRefresh =(event) => {
|
doRefresh = (event) => {
|
||||||
|
|
||||||
this.getPublicationDetail();
|
this.getPublicationDetail();
|
||||||
this.getPublicationsIds();
|
this.getPublicationsIds();
|
||||||
@@ -110,11 +117,11 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
getPublicationDetail() {
|
getPublicationDetail() {
|
||||||
const folderId = this.folderId
|
const folderId = this.folderId
|
||||||
this.publications.GetPresidentialAction(folderId).subscribe(res=>{
|
this.publications.GetPresidentialAction(folderId).subscribe(res => {
|
||||||
|
|
||||||
// PublicationDetailsModel.create(res)
|
// PublicationDetailsModel.create(res)
|
||||||
this.publicationFolderService.FolderDetails[folderId] = res
|
this.publicationFolderService.FolderDetails[folderId] = res
|
||||||
this.storage.set(folderId+"name", res)
|
this.storage.set(folderId + "name", res)
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
// this.httpErroHandle.httpStatusHandle(error)
|
// this.httpErroHandle.httpStatusHandle(error)
|
||||||
@@ -133,7 +140,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
let loadLater = []
|
let loadLater = []
|
||||||
for (let publicationId of publicationIds) {
|
for (let publicationId of publicationIds) {
|
||||||
|
|
||||||
if(!this.publicationIsPresent(publicationId, folderId)) {
|
if (!this.publicationIsPresent(publicationId, folderId)) {
|
||||||
await this.loadPublication(publicationId, folderId)
|
await this.loadPublication(publicationId, folderId)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -141,15 +148,15 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for( let publicationId of loadLater) {
|
for (let publicationId of loadLater) {
|
||||||
await this.loadPublication(publicationId, folderId)
|
await this.loadPublication(publicationId, folderId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for(let localPublication of this.publicationFolderService.publicationList[folderId]) {
|
for (let localPublication of this.publicationFolderService.publicationList[folderId]) {
|
||||||
|
|
||||||
const apiPublication = publicationIds.includes(localPublication.DocumentId)
|
const apiPublication = publicationIds.includes(localPublication.DocumentId)
|
||||||
if(!apiPublication) {
|
if (!apiPublication) {
|
||||||
this.publicationFolderService.deletePost(folderId, localPublication.DocumentId)
|
this.publicationFolderService.deletePost(folderId, localPublication.DocumentId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,7 +166,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
this.storage.set(folderId, this.publicationFolderService.publicationList[folderId]);
|
this.storage.set(folderId, this.publicationFolderService.publicationList[folderId]);
|
||||||
|
|
||||||
this.oldpublicationIds = publicationIds
|
this.oldpublicationIds = publicationIds
|
||||||
} catch(error) {
|
} catch (error) {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,27 +174,27 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
_deletePublication = (folderId, publicationId) => {
|
_deletePublication = (folderId, publicationId) => {
|
||||||
|
|
||||||
this.publicationFolderService.publicationList[folderId] = this.publicationFolderService.publicationList[folderId].filter( e => e.DocumentId != publicationId)
|
this.publicationFolderService.publicationList[folderId] = this.publicationFolderService.publicationList[folderId].filter(e => e.DocumentId != publicationId)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
publicationIsPresent(publicationId, folderId) {
|
publicationIsPresent(publicationId, folderId) {
|
||||||
return this.publicationFolderService.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
return this.publicationFolderService.publicationList[folderId].find(e => e.DocumentId == publicationId)
|
||||||
}
|
}
|
||||||
publicationFind(publicationId, folderId) {
|
publicationFind(publicationId, folderId) {
|
||||||
return this.publicationFolderService.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
return this.publicationFolderService.publicationList[folderId].find(e => e.DocumentId == publicationId)
|
||||||
}
|
}
|
||||||
publicationFindIndex(publicationId, folderId) {
|
publicationFindIndex(publicationId, folderId) {
|
||||||
return this.publicationFolderService.publicationList[folderId].findIndex( e => e.DocumentId == publicationId )
|
return this.publicationFolderService.publicationList[folderId].findIndex(e => e.DocumentId == publicationId)
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadPublication(publicationId, folderId) {
|
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)
|
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||||
|
|
||||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||||
const found = this.publicationIsPresent(publicationId, folderId)
|
const found = this.publicationIsPresent(publicationId, folderId)
|
||||||
if(!found) {
|
if (!found) {
|
||||||
this.publicationFolderService.publicationList[folderId].push(publicationDetails)
|
this.publicationFolderService.publicationList[folderId].push(publicationDetails)
|
||||||
} else {
|
} else {
|
||||||
this.publicationFolderService.publicationList[folderId][findIndex] = publicationDetails
|
this.publicationFolderService.publicationList[folderId][findIndex] = publicationDetails
|
||||||
@@ -202,12 +209,12 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async AddPublication(publicationType:any, folderId:any) {
|
async AddPublication(publicationType: any, folderId: any) {
|
||||||
|
|
||||||
if( window.innerWidth < 701) {
|
if (window.innerWidth < 701) {
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: NewPublicationPage,
|
component: NewPublicationPage,
|
||||||
componentProps:{
|
componentProps: {
|
||||||
publicationType: publicationType,
|
publicationType: publicationType,
|
||||||
folderId: folderId,
|
folderId: folderId,
|
||||||
},
|
},
|
||||||
@@ -215,7 +222,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
|
|
||||||
modal.onDidDismiss().then(()=>{
|
modal.onDidDismiss().then(() => {
|
||||||
this.doRefresh(event);
|
this.doRefresh(event);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -229,9 +236,9 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async openEditPublication(folderId?:any){
|
async openEditPublication(folderId?: any) {
|
||||||
|
|
||||||
if( window.innerWidth < 701) {
|
if (window.innerWidth < 701) {
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: EditActionPage,
|
component: EditActionPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
@@ -251,7 +258,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async deletePublication(folderId?:any) {
|
async deletePublication(folderId?: any) {
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: AskModalPage,
|
component: AskModalPage,
|
||||||
@@ -264,7 +271,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
modal.onDidDismiss().then((res) => {
|
modal.onDidDismiss().then((res) => {
|
||||||
if(res.data == 'Yes') {
|
if (res.data == 'Yes') {
|
||||||
const loader = this.toastService.loading();
|
const loader = this.toastService.loading();
|
||||||
try {
|
try {
|
||||||
this.publications.DeletePresidentialAction(folderId).toPromise();
|
this.publications.DeletePresidentialAction(folderId).toPromise();
|
||||||
@@ -284,10 +291,25 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async viewPublicationDetail(DocumentId:string, ProcessId: string) {
|
async viewPublicationDetail(DocumentId: string, ProcessId: string) {
|
||||||
|
|
||||||
this.openPublicationDetails.emit({DocumentId, ProcessId});
|
this.openPublicationDetails.emit({ DocumentId, ProcessId });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
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) {
|
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 = {
|
export const DevProd: Environment = {
|
||||||
id:'3',
|
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/',
|
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||||
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
||||||
@@ -47,7 +47,7 @@ export const DevProd: Environment = {
|
|||||||
|
|
||||||
export const DevDev: Environment = {
|
export const DevDev: Environment = {
|
||||||
id:'3',
|
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/',
|
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||||
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
||||||
|
|||||||
Reference in New Issue
Block a user