mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'feature/downloadFile' of bitbucket.org:equilibriumito/gabinete-digital into feature/downloadFile
This commit is contained in:
+3
-2
@@ -35,7 +35,7 @@ npm-debug.log*
|
|||||||
# Custom
|
# Custom
|
||||||
/package-lock.json
|
/package-lock.json
|
||||||
|
|
||||||
|
|
||||||
src/app/architect/
|
src/app/architect/
|
||||||
src/environments/environment.e2e.ts
|
src/environments/environment.e2e.ts
|
||||||
.env
|
.env
|
||||||
@@ -51,5 +51,6 @@ src/assets/www/pdfjs/web/compressed.tracemonkey-pldi-09.pdf.pdf
|
|||||||
node_modules_
|
node_modules_
|
||||||
node_modules__
|
node_modules__
|
||||||
plugins_
|
plugins_
|
||||||
|
android
|
||||||
ios
|
ios
|
||||||
src/plugin/beast-orm
|
src/plugin/beast-orm
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ dependencies {
|
|||||||
implementation project(':capacitor-share')
|
implementation project(':capacitor-share')
|
||||||
implementation project(':capacitor-storage')
|
implementation project(':capacitor-storage')
|
||||||
implementation project(':capacitor-voice-recorder')
|
implementation project(':capacitor-voice-recorder')
|
||||||
|
implementation project(':capacitor2-file-picker')
|
||||||
implementation "com.soundcloud.android:android-crop:1.0.0@aar"
|
implementation "com.soundcloud.android:android-crop:1.0.0@aar"
|
||||||
|
implementation "androidx.appcompat:appcompat:1.0.0"
|
||||||
|
implementation "com.android.support:support-v4:27.+"
|
||||||
implementation "com.squareup.okhttp:okhttp-urlconnection:2+"
|
implementation "com.squareup.okhttp:okhttp-urlconnection:2+"
|
||||||
}
|
}
|
||||||
apply from: "../../node_modules/com-sarriaroman-photoviewer/src/android/photoviewer.gradle"
|
apply from: "../../node_modules/com-sarriaroman-photoviewer/src/android/photoviewer.gradle"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<manifest package="com.gpr.gabinetedigital" xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest package="com.gpr.gabinetedigital" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name=".App" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
|
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name=".App" android:requestLegacyExternalStorage="true" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
|
||||||
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/title_activity_main" android:launchMode="singleTask" android:name="com.gpr.gabinetedigital.MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
|
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/title_activity_main" android:launchMode="singleTask" android:name="com.gpr.gabinetedigital.MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|||||||
@@ -16,5 +16,8 @@
|
|||||||
"sound"
|
"sound"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"url": "http://192.168.0.69:8100"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,5 +58,9 @@
|
|||||||
{
|
{
|
||||||
"pkg": "capacitor-voice-recorder",
|
"pkg": "capacitor-voice-recorder",
|
||||||
"classpath": "com.tchvu3.capacitorvoicerecorder.VoiceRecorder"
|
"classpath": "com.tchvu3.capacitorvoicerecorder.VoiceRecorder"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pkg": "capacitor2-file-picker",
|
||||||
|
"classpath": "com.devmantosh.filepicker.FilePicker"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -10,11 +10,28 @@
|
|||||||
<param name="android-package" value="me.rahul.plugins.sqlDB.sqlDB"/>
|
<param name="android-package" value="me.rahul.plugins.sqlDB.sqlDB"/>
|
||||||
</feature>
|
</feature>
|
||||||
|
|
||||||
|
<feature name="SitewaertsDocumentViewer">
|
||||||
|
<param name="android-package" value="de.sitewaerts.cordova.documentviewer.DocumentViewerPlugin"/>
|
||||||
|
</feature>
|
||||||
|
|
||||||
|
<feature name="File">
|
||||||
|
<param name="android-package" value="org.apache.cordova.file.FileUtils"/>
|
||||||
|
<param name="onload" value="true"/>
|
||||||
|
</feature>
|
||||||
|
|
||||||
|
<feature name="FileOpener2">
|
||||||
|
<param name="android-package" value="io.github.pwlin.cordova.plugins.fileopener2.FileOpener2"/>
|
||||||
|
</feature>
|
||||||
|
|
||||||
<feature name="FilePath">
|
<feature name="FilePath">
|
||||||
<param name="android-package" value="com.hiddentao.cordova.filepath.FilePath"/>
|
<param name="android-package" value="com.hiddentao.cordova.filepath.FilePath"/>
|
||||||
<param name="onload" value="true"/>
|
<param name="onload" value="true"/>
|
||||||
</feature>
|
</feature>
|
||||||
|
|
||||||
|
<feature name="MultipleDocumentsPicker">
|
||||||
|
<param name="android-package" value="com.akeo.cordova.plugin.MultipleDocumentsPicker"/>
|
||||||
|
</feature>
|
||||||
|
|
||||||
<feature name="OkHttpPlugin">
|
<feature name="OkHttpPlugin">
|
||||||
<param name="android-package" value="com.google.cordova.OkHttpPlugin"/>
|
<param name="android-package" value="com.google.cordova.OkHttpPlugin"/>
|
||||||
<param name="onload" value="true"/>
|
<param name="onload" value="true"/>
|
||||||
@@ -40,11 +57,6 @@
|
|||||||
<param name="android-package" value="org.apache.cordova.dialogs.Notification"/>
|
<param name="android-package" value="org.apache.cordova.dialogs.Notification"/>
|
||||||
</feature>
|
</feature>
|
||||||
|
|
||||||
<feature name="File">
|
|
||||||
<param name="android-package" value="org.apache.cordova.file.FileUtils"/>
|
|
||||||
<param name="onload" value="true"/>
|
|
||||||
</feature>
|
|
||||||
|
|
||||||
<feature name="Fingerprint">
|
<feature name="Fingerprint">
|
||||||
<param name="android-package" value="de.niklasmerz.cordova.biometric.Fingerprint"/>
|
<param name="android-package" value="de.niklasmerz.cordova.biometric.Fingerprint"/>
|
||||||
</feature>
|
</feature>
|
||||||
|
|||||||
@@ -46,3 +46,6 @@ project(':capacitor-storage').projectDir = new File('../node_modules/@capacitor/
|
|||||||
|
|
||||||
include ':capacitor-voice-recorder'
|
include ':capacitor-voice-recorder'
|
||||||
project(':capacitor-voice-recorder').projectDir = new File('../node_modules/capacitor-voice-recorder/android')
|
project(':capacitor-voice-recorder').projectDir = new File('../node_modules/capacitor-voice-recorder/android')
|
||||||
|
|
||||||
|
include ':capacitor2-file-picker'
|
||||||
|
project(':capacitor2-file-picker').projectDir = new File('../node_modules/capacitor2-file-picker/android')
|
||||||
|
|||||||
@@ -25,6 +25,11 @@
|
|||||||
"input": "src/assets",
|
"input": "src/assets",
|
||||||
"output": "assets"
|
"output": "assets"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "node_modules/ngx-extended-pdf-viewer/assets/",
|
||||||
|
"output": "/assets/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"glob": "**/*.svg",
|
"glob": "**/*.svg",
|
||||||
"input": "node_modules/ionicons/dist/ionicons/svg",
|
"input": "node_modules/ionicons/dist/ionicons/svg",
|
||||||
|
|||||||
+1
-44
@@ -22,7 +22,7 @@
|
|||||||
<preference name="SplashScreenDelay" value="3000" />
|
<preference name="SplashScreenDelay" value="3000" />
|
||||||
<platform name="android">
|
<platform name="android">
|
||||||
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
|
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<application android:networkSecurityConfig="@xml/network_security_config" />
|
<application android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true" android:networkSecurityConfig="@xml/network_security_config" />
|
||||||
</edit-config>
|
</edit-config>
|
||||||
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
|
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
|
||||||
<resource-file src="google-services.json" target="google-services.json" />
|
<resource-file src="google-services.json" target="google-services.json" />
|
||||||
@@ -46,49 +46,6 @@
|
|||||||
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
|
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
|
||||||
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
|
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
|
||||||
</platform>
|
</platform>
|
||||||
<mfp:android>
|
|
||||||
<mfp:sdkChecksum>3077110622</mfp:sdkChecksum>
|
|
||||||
<mfp:appChecksum>3619450036</mfp:appChecksum>
|
|
||||||
<mfp:security>
|
|
||||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
|
||||||
</mfp:security>
|
|
||||||
</mfp:android>
|
|
||||||
<mfp:ios>
|
|
||||||
<mfp:sdkChecksum>1979143311</mfp:sdkChecksum>
|
|
||||||
<mfp:appChecksum>1328564293</mfp:appChecksum>
|
|
||||||
<mfp:security>
|
|
||||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
|
||||||
</mfp:security>
|
|
||||||
</mfp:ios>
|
|
||||||
<mfp:windows>
|
|
||||||
<mfp:windows8>
|
|
||||||
<mfp:sdkChecksum>0</mfp:sdkChecksum>
|
|
||||||
<mfp:security>
|
|
||||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
|
||||||
</mfp:security>
|
|
||||||
</mfp:windows8>
|
|
||||||
<mfp:windowsphone8>
|
|
||||||
<mfp:sdkChecksum>0</mfp:sdkChecksum>
|
|
||||||
<mfp:security>
|
|
||||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
|
||||||
</mfp:security>
|
|
||||||
</mfp:windowsphone8>
|
|
||||||
<mfp:windows10>
|
|
||||||
<mfp:sdkChecksum>0</mfp:sdkChecksum>
|
|
||||||
<mfp:security>
|
|
||||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
|
||||||
</mfp:security>
|
|
||||||
</mfp:windows10>
|
|
||||||
<mfp:appChecksum>0</mfp:appChecksum>
|
|
||||||
</mfp:windows>
|
|
||||||
<mfp:platformVersion>8.0.0.00-20210905-154328</mfp:platformVersion>
|
|
||||||
<mfp:clientCustomInit enabled="false" />
|
|
||||||
<mfp:server runtime="mfp" url="http://gpr-dev-10.gabinetedigital.local:9080" />
|
|
||||||
<mfp:serverUri url="" />
|
|
||||||
<mfp:directUpdateAuthenticityPublicKey />
|
|
||||||
<mfp:languagePreferences>en</mfp:languagePreferences>
|
|
||||||
<mfp:APIproxyURL>/adapters/MobileAPIProxy</mfp:APIproxyURL>
|
|
||||||
<mfp:SDKProtocolVersion>2</mfp:SDKProtocolVersion>
|
|
||||||
<allow-navigation href="http://localhost:8100" sessionid="9714472a" />
|
<allow-navigation href="http://localhost:8100" sessionid="9714472a" />
|
||||||
<allow-navigation href="http://localhost:8101" sessionid="4721f88c" />
|
<allow-navigation href="http://localhost:8101" sessionid="4721f88c" />
|
||||||
<plugin name="cordova-plugin-dbcopy" spec="https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git" />
|
<plugin name="cordova-plugin-dbcopy" spec="https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git" />
|
||||||
|
|||||||
Generated
+572
-56
@@ -799,12 +799,79 @@
|
|||||||
"integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg==",
|
"integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@awesome-cordova-plugins/media-capture": {
|
"@awesome-cordova-plugins/core": {
|
||||||
"version": "5.40.0",
|
"version": "5.40.0",
|
||||||
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/media-capture/-/media-capture-5.40.0.tgz",
|
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/core/-/core-5.40.0.tgz",
|
||||||
"integrity": "sha512-Es5qhC6VeCzo0pq0V9txlMwSL3v1ZAUKtT74DDsTnItvbX56ZPdawL4u4fLA40VikaRNYZbYNnkYopifb8nJIw==",
|
"integrity": "sha512-tk5QlnXfSE2Zu3mJVC3f11Guu5iqnLtNkvvClNHjz/e4FsJEmprfXWCv/QImWs5fLsismHcn31LKYBfWIhOv9g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/cordova": "^0.0.34"
|
"@types/cordova": "^0.0.34"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@awesome-cordova-plugins/document-viewer": {
|
||||||
|
"version": "5.41.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/document-viewer/-/document-viewer-5.41.0.tgz",
|
||||||
|
"integrity": "sha512-90zZvtYuCHTvK55LDoESd7F3OtuDj8AJ0C0Owz+PqZq2J2fUP4fzd7lJE89Cp6vZet7rjiOz7d/8hbTxKMWsdg==",
|
||||||
|
"requires": {
|
||||||
|
"@types/cordova": "^0.0.34"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@awesome-cordova-plugins/file": {
|
||||||
|
"version": "5.41.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/file/-/file-5.41.0.tgz",
|
||||||
|
"integrity": "sha512-1UrtbRdHIDZEFD6UnKFeBpITK+UqrAhr/saJmMsXLjCtsdJFB05abNHzcfdBO+z3mQFK/DnMQ0YdYJtR5x6zYw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/cordova": "^0.0.34"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@awesome-cordova-plugins/file-opener": {
|
||||||
|
"version": "5.41.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/file-opener/-/file-opener-5.41.0.tgz",
|
||||||
|
"integrity": "sha512-CFdAum1EOxSdi+yMzEkOribU/joaDiqs1lL/ddxj7I78ryzlU+dj7rg6HZKvAN7aTjbWTX6A3p628eNpQoopgg==",
|
||||||
|
"requires": {
|
||||||
|
"@types/cordova": "^0.0.34"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@awesome-cordova-plugins/multiple-document-picker": {
|
||||||
|
"version": "5.40.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/multiple-document-picker/-/multiple-document-picker-5.40.0.tgz",
|
||||||
|
"integrity": "sha512-7mYRo2yulfgStK0XsPaTUJigFbYwlQy/qWjLRbNHMbEUOk372a/HnjTUwFBFT+oWX8k0Rn9hjX50Xsqoz46hyQ==",
|
||||||
|
"requires": {
|
||||||
|
"@types/cordova": "^0.0.34"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/code-frame": {
|
"@babel/code-frame": {
|
||||||
@@ -3059,6 +3126,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@ionic-native/file-opener": {
|
||||||
|
"version": "5.36.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@ionic-native/file-opener/-/file-opener-5.36.0.tgz",
|
||||||
|
"integrity": "sha512-UKp3pbqvQXsAtLMJ5JE+KcTMxpjSZMFebf6nvy/KJvwy85JGIaCV4ZVM/H9CFUrHJMWBH6wDbY+WPygnsrl4Yg==",
|
||||||
|
"requires": {
|
||||||
|
"@types/cordova": "^0.0.34"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@ionic-native/file-path": {
|
"@ionic-native/file-path": {
|
||||||
"version": "5.36.0",
|
"version": "5.36.0",
|
||||||
"resolved": "https://registry.npmjs.org/@ionic-native/file-path/-/file-path-5.36.0.tgz",
|
"resolved": "https://registry.npmjs.org/@ionic-native/file-path/-/file-path-5.36.0.tgz",
|
||||||
@@ -3175,9 +3257,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@ionic-native/network": {
|
"@ionic-native/network": {
|
||||||
"version": "5.36.0",
|
"version": "5.22.0-beta-1",
|
||||||
"resolved": "https://registry.npmjs.org/@ionic-native/network/-/network-5.36.0.tgz",
|
"resolved": "https://registry.npmjs.org/@ionic-native/network/-/network-5.22.0-beta-1.tgz",
|
||||||
"integrity": "sha512-gpa7cJqodEK+zmmViYJCqEpXoKSXcaYLaaRKdv5gn5M++bpmiw2pKM9JH8VoqYWaYDcUwD3S0yYeBBkG5DE0Kg==",
|
"integrity": "sha512-reOgFhHkyzCujqoGc1x8U9AZ40SBzdYT4HCFA6L2RwQT1NMyv+sDsp5er64p419Rfxg1k2QVTaDlEh+xPwhEqQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/cordova": "^0.0.34"
|
"@types/cordova": "^0.0.34"
|
||||||
},
|
},
|
||||||
@@ -5077,6 +5159,11 @@
|
|||||||
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
|
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@types/pdfjs-dist": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/pdfjs-dist/-/pdfjs-dist-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-BvRLWz6RCI8FMKbgfdTCadVwimUv8920gLsnBEAkECjtqIy95jtt+G1ebNQE2b8PTnLjJICPpmBOGhgkSsiPKA=="
|
||||||
|
},
|
||||||
"@types/prettier": {
|
"@types/prettier": {
|
||||||
"version": "2.4.1",
|
"version": "2.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz",
|
||||||
@@ -5525,23 +5612,6 @@
|
|||||||
"integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
|
"integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"android-versions": {
|
|
||||||
"version": "1.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.7.0.tgz",
|
|
||||||
"integrity": "sha512-TCy4b8Dk8YS6A23ZPfhSKqK66JHFq0D8avGYiwvYpjno6HrrcI0DRgHx9+jtkvWYmrsE2vQWgbHJhvGGhhOb0g==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"semver": "^5.7.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"semver": {
|
|
||||||
"version": "5.7.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
|
||||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"angular-calendar": {
|
"angular-calendar": {
|
||||||
"version": "0.28.28",
|
"version": "0.28.28",
|
||||||
"resolved": "https://registry.npmjs.org/angular-calendar/-/angular-calendar-0.28.28.tgz",
|
"resolved": "https://registry.npmjs.org/angular-calendar/-/angular-calendar-0.28.28.tgz",
|
||||||
@@ -6230,9 +6300,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"beast-orm": {
|
"beast-orm": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/beast-orm/-/beast-orm-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/beast-orm/-/beast-orm-1.0.3.tgz",
|
||||||
"integrity": "sha512-wSholUbFMteq50U3QM0o4H3xY9IpevpG9MPlq0ZK8yRtRkIuKf/YoZW4QUwFOfY72PJbNzp68z7Ln/iFhpOxDg=="
|
"integrity": "sha512-kSTc8Sosm1CbLjSGc+nA1s9i4QmGQoF1rfWDmhTrHOvH+uZAtRXbZAypzscMmF67g04mK5XAuB+TUoKV5XmNiQ=="
|
||||||
},
|
},
|
||||||
"big-integer": {
|
"big-integer": {
|
||||||
"version": "1.6.49",
|
"version": "1.6.49",
|
||||||
@@ -6242,8 +6312,7 @@
|
|||||||
"big.js": {
|
"big.js": {
|
||||||
"version": "5.2.2",
|
"version": "5.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
|
||||||
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
|
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"binary-extensions": {
|
"binary-extensions": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
@@ -6971,6 +7040,29 @@
|
|||||||
"get-blob-duration": "^1.2.0"
|
"get-blob-duration": "^1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"capacitor2-file-picker": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/capacitor2-file-picker/-/capacitor2-file-picker-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-mumuW44Bx6mMK0V5KEifu6EgBGPsWQ/kXKWMIaHGFYYUtmZTVpDl2DWiQe6VYFbaemhT+0C1EvKbP681RpLOpQ==",
|
||||||
|
"requires": {
|
||||||
|
"@capacitor/core": "^2.4.7"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@capacitor/core": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-WUkUnqqLtlEYn6tly8t6VR0ABlSVbXdlD/gBbYxx0P+gEqMF9b46uYb2YqyH+8HBDANzTweEySpLfhiSUvYS7w==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^1.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tslib": {
|
||||||
|
"version": "1.14.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||||
|
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"capture-exit": {
|
"capture-exit": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz",
|
||||||
@@ -7264,8 +7356,7 @@
|
|||||||
"co": {
|
"co": {
|
||||||
"version": "4.6.0",
|
"version": "4.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
|
||||||
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
|
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
@@ -7793,21 +7884,345 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cordova-android": {
|
"cordova-android": {
|
||||||
"version": "9.1.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-9.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-5.0.0.tgz",
|
||||||
"integrity": "sha512-bzOX9E4eQsOSpa06oZZ7XAGq3DwB73juhhj0oPqHH/khWk0mkCD4aiVYMFoc0fmIaSQvzbY1ww7L6UBW5pyGfg==",
|
"integrity": "sha1-vFlPYEhSWGz3500gQqNzH9dts6o=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"android-versions": "^1.5.0",
|
"cordova-common": "~1.0.0",
|
||||||
"cordova-common": "^4.0.1",
|
"elementtree": "^0.1.6",
|
||||||
"execa": "^4.0.2",
|
"nopt": "^3.0.1",
|
||||||
"fast-glob": "^3.2.4",
|
"properties-parser": "^0.2.3",
|
||||||
"fs-extra": "^9.0.1",
|
"q": "^1.4.1",
|
||||||
"is-path-inside": "^3.0.2",
|
"shelljs": "^0.5.3"
|
||||||
"nopt": "^4.0.3",
|
},
|
||||||
"properties-parser": "^0.3.1",
|
"dependencies": {
|
||||||
"semver": "^7.3.4",
|
"cordova-common": {
|
||||||
"which": "^2.0.2"
|
"version": "1.0.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"bplist-parser": "^0.1.0",
|
||||||
|
"cordova-registry-mapper": "^1.1.8",
|
||||||
|
"elementtree": "^0.1.6",
|
||||||
|
"glob": "^5.0.13",
|
||||||
|
"osenv": "^0.1.3",
|
||||||
|
"plist": "^1.1.0",
|
||||||
|
"q": "^1.4.1",
|
||||||
|
"semver": "^5.0.1",
|
||||||
|
"shelljs": "^0.5.1",
|
||||||
|
"underscore": "^1.8.3",
|
||||||
|
"unorm": "^1.3.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"bplist-parser": {
|
||||||
|
"version": "0.1.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"cordova-registry-mapper": {
|
||||||
|
"version": "1.1.13",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"tape": "^3.5.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tape": {
|
||||||
|
"version": "3.5.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"deep-equal": "~0.2.0",
|
||||||
|
"defined": "~0.0.0",
|
||||||
|
"glob": "~3.2.9",
|
||||||
|
"inherits": "~2.0.1",
|
||||||
|
"object-inspect": "~0.4.0",
|
||||||
|
"resumer": "~0.0.0",
|
||||||
|
"through": "~2.3.4"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"deep-equal": {
|
||||||
|
"version": "0.2.2",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"defined": {
|
||||||
|
"version": "0.0.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"glob": {
|
||||||
|
"version": "3.2.11",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"inherits": "2",
|
||||||
|
"minimatch": "0.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"minimatch": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"lru-cache": "2",
|
||||||
|
"sigmund": "~1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"lru-cache": {
|
||||||
|
"version": "2.7.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"sigmund": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inherits": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"object-inspect": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"resumer": {
|
||||||
|
"version": "0.0.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"through": "~2.3.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"through": {
|
||||||
|
"version": "2.3.8",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"glob": {
|
||||||
|
"version": "5.0.15",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"inflight": "^1.0.4",
|
||||||
|
"inherits": "2",
|
||||||
|
"minimatch": "2 || 3",
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"path-is-absolute": "^1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"inflight": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"once": "^1.3.0",
|
||||||
|
"wrappy": "1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"wrappy": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inherits": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"minimatch": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"brace-expansion": "^1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"balanced-match": "^0.2.0",
|
||||||
|
"concat-map": "0.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": {
|
||||||
|
"version": "0.2.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"concat-map": {
|
||||||
|
"version": "0.0.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"once": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"wrappy": "1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"wrappy": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"path-is-absolute": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"osenv": {
|
||||||
|
"version": "0.1.3",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"os-homedir": "^1.0.0",
|
||||||
|
"os-tmpdir": "^1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"os-homedir": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"os-tmpdir": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plist": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"base64-js": "0.0.6",
|
||||||
|
"util-deprecate": "1.0.0",
|
||||||
|
"xmlbuilder": "2.2.1",
|
||||||
|
"xmldom": "0.1.x"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"base64-js": {
|
||||||
|
"version": "0.0.6",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"util-deprecate": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"xmlbuilder": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"lodash-node": "~2.4.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"lodash-node": {
|
||||||
|
"version": "2.4.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xmldom": {
|
||||||
|
"version": "0.1.19",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"semver": {
|
||||||
|
"version": "5.0.3",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"underscore": {
|
||||||
|
"version": "1.8.3",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"unorm": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"elementtree": {
|
||||||
|
"version": "0.1.6",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"sax": "0.3.5"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"sax": {
|
||||||
|
"version": "0.3.5",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nopt": {
|
||||||
|
"version": "3.0.4",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"abbrev": "1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"abbrev": {
|
||||||
|
"version": "1.0.7",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties-parser": {
|
||||||
|
"version": "0.2.3",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"q": {
|
||||||
|
"version": "1.4.1",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"shelljs": {
|
||||||
|
"version": "0.5.3",
|
||||||
|
"bundled": true,
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cordova-android-support-gradle-release": {
|
"cordova-android-support-gradle-release": {
|
||||||
@@ -8149,11 +8564,20 @@
|
|||||||
"integrity": "sha512-FUHI6eEVeoz2VkxbF0P56QlUQLGzXcvw3i4xuXyM9gEct6Y+FA3Xzgl2pJTZcTg5wRqLWzN08kgNoHPkom15pw==",
|
"integrity": "sha512-FUHI6eEVeoz2VkxbF0P56QlUQLGzXcvw3i4xuXyM9gEct6Y+FA3Xzgl2pJTZcTg5wRqLWzN08kgNoHPkom15pw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"cordova-plugin-document-viewer": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cordova-plugin-document-viewer/-/cordova-plugin-document-viewer-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-LQZiWVU543rLJ0wYoawSdMrAfoxBLWCx8a2CuQjFeav4U9CN16QAh1VHetHaHicp5ZEwTC7Zq/0TNbak6A7bVw=="
|
||||||
|
},
|
||||||
"cordova-plugin-file": {
|
"cordova-plugin-file": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz",
|
||||||
"integrity": "sha512-m7cughw327CjONN/qjzsTpSesLaeybksQh420/gRuSXJX5Zt9NfgsSbqqKDon6jnQ9Mm7h7imgyO2uJ34XMBtA==",
|
"integrity": "sha512-m7cughw327CjONN/qjzsTpSesLaeybksQh420/gRuSXJX5Zt9NfgsSbqqKDon6jnQ9Mm7h7imgyO2uJ34XMBtA=="
|
||||||
"dev": true
|
},
|
||||||
|
"cordova-plugin-file-opener2": {
|
||||||
|
"version": "3.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/cordova-plugin-file-opener2/-/cordova-plugin-file-opener2-3.0.5.tgz",
|
||||||
|
"integrity": "sha512-tjLHDamH5+y0bJZYVe2967L1S4R8tL4Y0rJUzJGoxsyiw3FUlrJNS199POOpzZZ6Xhlntn9a2o7+84r1dMN21A=="
|
||||||
},
|
},
|
||||||
"cordova-plugin-filepath": {
|
"cordova-plugin-filepath": {
|
||||||
"version": "1.6.0",
|
"version": "1.6.0",
|
||||||
@@ -8190,6 +8614,11 @@
|
|||||||
"integrity": "sha512-pVQOrNM7VAuVUMXibAlMGIArrftHPrRs4dUCoE+e2HEFUp3LmN3Yj539LjdUxcWmz/A/cHC65m9E3DS56YJhcg==",
|
"integrity": "sha512-pVQOrNM7VAuVUMXibAlMGIArrftHPrRs4dUCoE+e2HEFUp3LmN3Yj539LjdUxcWmz/A/cHC65m9E3DS56YJhcg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"cordova-plugin-multiple-documents-picker": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cordova-plugin-multiple-documents-picker/-/cordova-plugin-multiple-documents-picker-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-MXc1A6bP8/gOSxRRijj5Tp61Sm4zd+yxz5s5ssWD/VQV+MWK88THPZyDuQ2efUbFVs6i2T255mkboLsEEY8EXQ=="
|
||||||
|
},
|
||||||
"cordova-plugin-network-information": {
|
"cordova-plugin-network-information": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/cordova-plugin-network-information/-/cordova-plugin-network-information-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/cordova-plugin-network-information/-/cordova-plugin-network-information-3.0.0.tgz",
|
||||||
@@ -9536,8 +9965,7 @@
|
|||||||
"emojis-list": {
|
"emojis-list": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
|
||||||
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
|
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
@@ -15741,6 +16169,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
|
||||||
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
|
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
|
||||||
},
|
},
|
||||||
|
"lodash.deburr": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz",
|
||||||
|
"integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s="
|
||||||
|
},
|
||||||
"lodash.isfinite": {
|
"lodash.isfinite": {
|
||||||
"version": "3.3.2",
|
"version": "3.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz",
|
||||||
@@ -16547,6 +16980,26 @@
|
|||||||
"tslib": "^2.3.0"
|
"tslib": "^2.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ng2-pdf-viewer": {
|
||||||
|
"version": "3.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/ng2-pdf-viewer/-/ng2-pdf-viewer-3.0.8.tgz",
|
||||||
|
"integrity": "sha512-p2qndFu1wQW4y+xXXw7yk1BhpRo5PGHKWD3PTc7pUULujx9d2vT26lhXR3p9WHitySadGqdCQpkA7W3v1dBlSg==",
|
||||||
|
"requires": {
|
||||||
|
"@types/pdfjs-dist": "^0.1.1",
|
||||||
|
"pdfjs-dist": "1.9.489"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"pdfjs-dist": {
|
||||||
|
"version": "1.9.489",
|
||||||
|
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-1.9.489.tgz",
|
||||||
|
"integrity": "sha1-yuWf7d0WouXRlappUnlVz+QALB0=",
|
||||||
|
"requires": {
|
||||||
|
"node-ensure": "^0.0.0",
|
||||||
|
"worker-loader": "^0.8.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"ngx-cookie-service": {
|
"ngx-cookie-service": {
|
||||||
"version": "12.0.3",
|
"version": "12.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/ngx-cookie-service/-/ngx-cookie-service-12.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/ngx-cookie-service/-/ngx-cookie-service-12.0.3.tgz",
|
||||||
@@ -16555,6 +17008,15 @@
|
|||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ngx-extended-pdf-viewer": {
|
||||||
|
"version": "13.0.0-alpha.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ngx-extended-pdf-viewer/-/ngx-extended-pdf-viewer-13.0.0-alpha.2.tgz",
|
||||||
|
"integrity": "sha512-/+aTZVW8uubzWHI1KK4eC6QaS2I59IHnJI/0jgyhDkF2bXywB+PR7O/g4aEstRU56lzayh/W8YGSAJbB8tobkw==",
|
||||||
|
"requires": {
|
||||||
|
"lodash.deburr": "^4.1.0",
|
||||||
|
"tslib": "^2.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ngx-image-compress": {
|
"ngx-image-compress": {
|
||||||
"version": "11.0.3",
|
"version": "11.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/ngx-image-compress/-/ngx-image-compress-11.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/ngx-image-compress/-/ngx-image-compress-11.0.3.tgz",
|
||||||
@@ -16632,6 +17094,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
||||||
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A=="
|
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A=="
|
||||||
},
|
},
|
||||||
|
"node-ensure": {
|
||||||
|
"version": "0.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-ensure/-/node-ensure-0.0.0.tgz",
|
||||||
|
"integrity": "sha1-7K52QVDemYYexcgQ/V0Jaxg5Mqc="
|
||||||
|
},
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "2.6.1",
|
"version": "2.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||||
@@ -19009,15 +19476,6 @@
|
|||||||
"read": "1"
|
"read": "1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties-parser": {
|
|
||||||
"version": "0.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz",
|
|
||||||
"integrity": "sha1-ExbpU5/7/ZOEXjabIRAiq9R4dxo=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"string.prototype.codepointat": "^0.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"protobufjs": {
|
"protobufjs": {
|
||||||
"version": "6.11.2",
|
"version": "6.11.2",
|
||||||
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz",
|
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz",
|
||||||
@@ -24841,6 +25299,64 @@
|
|||||||
"resolved": "https://registry.npmjs.org/wordcloud/-/wordcloud-1.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/wordcloud/-/wordcloud-1.2.2.tgz",
|
||||||
"integrity": "sha512-fUnDsGrHXou+49j1OeKaC7nOeZPx+sWjIet0L/j6eAcm0nXy+a+AuUs/iDAX4PLBg1Zc6wgXWXhoXdQsXRWAEw=="
|
"integrity": "sha512-fUnDsGrHXou+49j1OeKaC7nOeZPx+sWjIet0L/j6eAcm0nXy+a+AuUs/iDAX4PLBg1Zc6wgXWXhoXdQsXRWAEw=="
|
||||||
},
|
},
|
||||||
|
"worker-loader": {
|
||||||
|
"version": "0.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-0.8.1.tgz",
|
||||||
|
"integrity": "sha1-6OmVMx6jTfW/aCloJL+38K1XjUM=",
|
||||||
|
"requires": {
|
||||||
|
"loader-utils": "^1.0.2",
|
||||||
|
"schema-utils": "^0.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ajv": {
|
||||||
|
"version": "5.5.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
|
||||||
|
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
|
||||||
|
"requires": {
|
||||||
|
"co": "^4.6.0",
|
||||||
|
"fast-deep-equal": "^1.0.0",
|
||||||
|
"fast-json-stable-stringify": "^2.0.0",
|
||||||
|
"json-schema-traverse": "^0.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fast-deep-equal": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
|
||||||
|
},
|
||||||
|
"json-schema-traverse": {
|
||||||
|
"version": "0.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
|
||||||
|
"integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
|
||||||
|
},
|
||||||
|
"json5": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
||||||
|
"requires": {
|
||||||
|
"minimist": "^1.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"loader-utils": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
|
||||||
|
"requires": {
|
||||||
|
"big.js": "^5.2.2",
|
||||||
|
"emojis-list": "^3.0.0",
|
||||||
|
"json5": "^1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"schema-utils": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz",
|
||||||
|
"integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=",
|
||||||
|
"requires": {
|
||||||
|
"ajv": "^5.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"wrap-ansi": {
|
"wrap-ansi": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||||
|
|||||||
+17
-6
@@ -31,7 +31,11 @@
|
|||||||
"@angular/platform-browser": "~12.1.2",
|
"@angular/platform-browser": "~12.1.2",
|
||||||
"@angular/platform-browser-dynamic": "~12.1.2",
|
"@angular/platform-browser-dynamic": "~12.1.2",
|
||||||
"@angular/router": "~12.1.2",
|
"@angular/router": "~12.1.2",
|
||||||
"@awesome-cordova-plugins/media-capture": "^5.40.0",
|
"@awesome-cordova-plugins/core": "^5.40.0",
|
||||||
|
"@awesome-cordova-plugins/document-viewer": "^5.41.0",
|
||||||
|
"@awesome-cordova-plugins/file": "^5.41.0",
|
||||||
|
"@awesome-cordova-plugins/file-opener": "^5.41.0",
|
||||||
|
"@awesome-cordova-plugins/multiple-document-picker": "^5.40.0",
|
||||||
"@byteowls/capacitor-filesharer": "^3.0.0",
|
"@byteowls/capacitor-filesharer": "^3.0.0",
|
||||||
"@capacitor-community/camera-preview": "^1.2.1",
|
"@capacitor-community/camera-preview": "^1.2.1",
|
||||||
"@capacitor/android": "3.3.3",
|
"@capacitor/android": "3.3.3",
|
||||||
@@ -63,6 +67,7 @@
|
|||||||
"@ionic-native/document-viewer": "^5.36.0",
|
"@ionic-native/document-viewer": "^5.36.0",
|
||||||
"@ionic-native/fcm": "^5.36.0",
|
"@ionic-native/fcm": "^5.36.0",
|
||||||
"@ionic-native/file": "^5.36.0",
|
"@ionic-native/file": "^5.36.0",
|
||||||
|
"@ionic-native/file-opener": "^5.36.0",
|
||||||
"@ionic-native/file-path": "^5.30.0",
|
"@ionic-native/file-path": "^5.30.0",
|
||||||
"@ionic-native/fingerprint-aio": "^4.20.0",
|
"@ionic-native/fingerprint-aio": "^4.20.0",
|
||||||
"@ionic-native/http": "^5.36.0",
|
"@ionic-native/http": "^5.36.0",
|
||||||
@@ -72,7 +77,7 @@
|
|||||||
"@ionic-native/local-notifications": "^4.20.0",
|
"@ionic-native/local-notifications": "^4.20.0",
|
||||||
"@ionic-native/media": "^5.36.0",
|
"@ionic-native/media": "^5.36.0",
|
||||||
"@ionic-native/media-capture": "^5.36.0",
|
"@ionic-native/media-capture": "^5.36.0",
|
||||||
"@ionic-native/network": "^5.36.0",
|
"@ionic-native/network": "^5.22.0-beta-1",
|
||||||
"@ionic-native/photo-viewer": "^5.36.0",
|
"@ionic-native/photo-viewer": "^5.36.0",
|
||||||
"@ionic-native/screen-orientation": "^5.35.0",
|
"@ionic-native/screen-orientation": "^5.35.0",
|
||||||
"@ionic-native/social-sharing": "^5.36.0",
|
"@ionic-native/social-sharing": "^5.36.0",
|
||||||
@@ -99,15 +104,20 @@
|
|||||||
"angular-svg-icon": "^12.0.0",
|
"angular-svg-icon": "^12.0.0",
|
||||||
"angular-tag-cloud-module": "^5.2.2",
|
"angular-tag-cloud-module": "^5.2.2",
|
||||||
"base64-js": "^1.5.1",
|
"base64-js": "^1.5.1",
|
||||||
"beast-orm": "^1.0.0",
|
"beast-orm": "^1.0.3",
|
||||||
"bootstrap": "^4.5.0",
|
"bootstrap": "^4.5.0",
|
||||||
"build": "0.1.4",
|
"build": "0.1.4",
|
||||||
"capacitor-voice-recorder": "^2.1.0",
|
"capacitor-voice-recorder": "^2.0.0",
|
||||||
|
"capacitor2-file-picker": "^1.0.0",
|
||||||
"ci": "^2.1.1",
|
"ci": "^2.1.1",
|
||||||
"cordova": "^10.0.0",
|
"cordova": "^10.0.0",
|
||||||
"cordova-plugin-crop": "^0.4.0",
|
"cordova-plugin-crop": "^0.4.0",
|
||||||
"cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git",
|
"cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git",
|
||||||
|
"cordova-plugin-document-viewer": "^1.0.0",
|
||||||
|
"cordova-plugin-file": "^6.0.2",
|
||||||
|
"cordova-plugin-file-opener2": "^3.0.5",
|
||||||
"cordova-plugin-filepath": "^1.5.8",
|
"cordova-plugin-filepath": "^1.5.8",
|
||||||
|
"cordova-plugin-multiple-documents-picker": "^1.0.0",
|
||||||
"cordova-plugin-okhttp": "^2.0.0",
|
"cordova-plugin-okhttp": "^2.0.0",
|
||||||
"cordova-plugin-screen-orientation": "^3.0.2",
|
"cordova-plugin-screen-orientation": "^3.0.2",
|
||||||
"cordova-res": "^0.15.3",
|
"cordova-res": "^0.15.3",
|
||||||
@@ -136,7 +146,9 @@
|
|||||||
"lite-server": "^2.6.1",
|
"lite-server": "^2.6.1",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"ng-lazyload-image": "^9.1.2",
|
"ng-lazyload-image": "^9.1.2",
|
||||||
|
"ng2-pdf-viewer": "^3.0.8",
|
||||||
"ngx-cookie-service": "^12.0.3",
|
"ngx-cookie-service": "^12.0.3",
|
||||||
|
"ngx-extended-pdf-viewer": "^13.0.0-alpha.2",
|
||||||
"ngx-image-compress": "^11.0.3",
|
"ngx-image-compress": "^11.0.3",
|
||||||
"ngx-image-cropper": "^5.0.1",
|
"ngx-image-cropper": "^5.0.1",
|
||||||
"ngx-letters-avatar": "^1.0.2",
|
"ngx-letters-avatar": "^1.0.2",
|
||||||
@@ -171,14 +183,13 @@
|
|||||||
"@types/node": "^12.11.1",
|
"@types/node": "^12.11.1",
|
||||||
"codelyzer": "^6.0.0",
|
"codelyzer": "^6.0.0",
|
||||||
"com-sarriaroman-photoviewer": "^1.2.5",
|
"com-sarriaroman-photoviewer": "^1.2.5",
|
||||||
"cordova-android": "^9.1.0",
|
"cordova-android": "^5.0.0",
|
||||||
"cordova-android-support-gradle-release": "^3.0.1",
|
"cordova-android-support-gradle-release": "^3.0.1",
|
||||||
"cordova-browser": "^6.0.0",
|
"cordova-browser": "^6.0.0",
|
||||||
"cordova-plugin-androidx": "^3.0.0",
|
"cordova-plugin-androidx": "^3.0.0",
|
||||||
"cordova-plugin-androidx-adapter": "^1.1.3",
|
"cordova-plugin-androidx-adapter": "^1.1.3",
|
||||||
"cordova-plugin-device": "^2.0.2",
|
"cordova-plugin-device": "^2.0.2",
|
||||||
"cordova-plugin-dialogs": "^2.0.2",
|
"cordova-plugin-dialogs": "^2.0.2",
|
||||||
"cordova-plugin-file": "^6.0.2",
|
|
||||||
"cordova-plugin-fingerprint-aio": "^4.0.2",
|
"cordova-plugin-fingerprint-aio": "^4.0.2",
|
||||||
"cordova-plugin-globalization": "^1.11.0",
|
"cordova-plugin-globalization": "^1.11.0",
|
||||||
"cordova-plugin-inappbrowser": "^4.0.0",
|
"cordova-plugin-inappbrowser": "^4.0.0",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { ProcessesService } from '../services/processes.service';
|
|||||||
import { DespachoStore } from '../store/despacho-store.service';
|
import { DespachoStore } from '../store/despacho-store.service';
|
||||||
import { LoaderService } from 'src/app/store/loader.service'
|
import { LoaderService } from 'src/app/store/loader.service'
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
import { PermissionService } from '../services/worker/permission.service';
|
import { PermissionService } from '../services/permission.service';
|
||||||
import { SortService } from '../services/functions/sort.service';
|
import { SortService } from '../services/functions/sort.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ProcessesService } from '../services/processes.service';
|
import { ProcessesService } from '../services/processes.service';
|
||||||
import { PermissionService } from '../services/worker/permission.service';
|
import { PermissionService } from '../services/permission.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -22,10 +22,10 @@ export class PedidoService {
|
|||||||
|
|
||||||
createDeferimento(body: any) {
|
createDeferimento(body: any) {
|
||||||
|
|
||||||
if(this.p.userRole(['PR'])) {
|
if(this.p.userRole(['PR'])) {
|
||||||
throw('PR cant create Deferimento')
|
throw('PR cant create Deferimento')
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.processes.postDeferimento(body)
|
return this.processes.postDeferimento(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,8 +57,8 @@ export class PedidoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
arquivar({note = "", serialNumber, documents= [] }) {
|
arquivar({note = "", serialNumber, documents= [] }) {
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": serialNumber,
|
"serialNumber": serialNumber,
|
||||||
"action": "Arquivo",
|
"action": "Arquivo",
|
||||||
"ActionTypeId": 95,
|
"ActionTypeId": 95,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
|
|||||||
+13
-2
@@ -32,6 +32,11 @@ import {MatDatepickerModule} from '@angular/material/datepicker';
|
|||||||
import {MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';
|
import {MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';
|
||||||
import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||||
import { Network } from '@ionic-native/network/ngx';
|
import { Network } from '@ionic-native/network/ngx';
|
||||||
|
import { MultipleDocumentsPicker } from '@awesome-cordova-plugins/multiple-document-picker/ngx';
|
||||||
|
import { DocumentViewer } from '@awesome-cordova-plugins/document-viewer/ngx';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
NgxMatDatetimePickerModule,
|
NgxMatDatetimePickerModule,
|
||||||
NgxMatNativeDateModule,
|
NgxMatNativeDateModule,
|
||||||
@@ -55,13 +60,15 @@ import { CookieService } from 'ngx-cookie-service';
|
|||||||
import { ImagePicker } from '@ionic-native/image-picker/ngx';
|
import { ImagePicker } from '@ionic-native/image-picker/ngx';
|
||||||
import { MediaCapture } from '@ionic-native/media-capture/ngx';
|
import { MediaCapture } from '@ionic-native/media-capture/ngx';
|
||||||
import { Media } from '@ionic-native/media/ngx';
|
import { Media } from '@ionic-native/media/ngx';
|
||||||
import { File } from '@ionic-native/file/ngx';
|
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||||
|
|
||||||
import { StreamingMedia } from '@ionic-native/streaming-media/ngx';
|
import { StreamingMedia } from '@ionic-native/streaming-media/ngx';
|
||||||
import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
|
import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
|
||||||
import {NgxImageCompressService} from 'ngx-image-compress';
|
import {NgxImageCompressService} from 'ngx-image-compress';
|
||||||
import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
|
import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
|
||||||
import { IonicImageLoaderComponent, IonicImageLoaderModule } from 'ionic-image-loader-v5';
|
import { IonicImageLoaderComponent, IonicImageLoaderModule } from 'ionic-image-loader-v5';
|
||||||
|
import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';
|
||||||
|
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||||
|
|
||||||
/* import { FCM } from '@ionic-native/fcm/ngx';
|
/* import { FCM } from '@ionic-native/fcm/ngx';
|
||||||
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||||
@@ -127,7 +134,6 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
|||||||
ChatService,
|
ChatService,
|
||||||
ScreenOrientation,
|
ScreenOrientation,
|
||||||
Network,
|
Network,
|
||||||
File,
|
|
||||||
SQLite,
|
SQLite,
|
||||||
CookieService,
|
CookieService,
|
||||||
ImagePicker,
|
ImagePicker,
|
||||||
@@ -136,6 +142,11 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
|||||||
StreamingMedia,
|
StreamingMedia,
|
||||||
PhotoViewer,
|
PhotoViewer,
|
||||||
NgxImageCompressService,
|
NgxImageCompressService,
|
||||||
|
MultipleDocumentsPicker,
|
||||||
|
NgxExtendedPdfViewerModule,
|
||||||
|
FileOpener,
|
||||||
|
DocumentViewer
|
||||||
|
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||||
|
|||||||
@@ -3,15 +3,20 @@ import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTr
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
import { AlertController, Platform } from '@ionic/angular';
|
import { AlertController, Platform } from '@ionic/angular';
|
||||||
|
import { PermissionService } from '../services/permission.service';
|
||||||
|
import { PermissionList } from '../models/permission/permissionList';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class InactivityGuard implements CanActivate {
|
export class InactivityGuard implements CanActivate {
|
||||||
|
|
||||||
|
permissionList = new PermissionList();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router:Router,
|
private router:Router,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
|
public permissionService: PermissionService,
|
||||||
){}
|
){}
|
||||||
|
|
||||||
canActivate(
|
canActivate(
|
||||||
@@ -19,17 +24,35 @@ export class InactivityGuard implements CanActivate {
|
|||||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||||
|
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
this.router.navigate(['/home/events']);
|
console.log(this.permissionList);
|
||||||
|
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
||||||
|
this.router.navigate(['/home/events']);
|
||||||
|
}
|
||||||
|
else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||||
|
this.router.navigate(['/home/chat']);
|
||||||
|
}
|
||||||
|
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||||
|
this.router.navigate(['/home/publications']);
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||||
return true
|
return true
|
||||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
||||||
return true
|
return true
|
||||||
} else {
|
}//Mobile or Tablet without session
|
||||||
this.router.navigate(['/home/events']);
|
else {
|
||||||
|
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
||||||
|
this.router.navigate(['/home/events']);
|
||||||
|
}
|
||||||
|
else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||||
|
this.router.navigate(['/home/chat']);
|
||||||
|
}
|
||||||
|
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||||
|
this.router.navigate(['/home/publications']);
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+34
-31
@@ -1,39 +1,42 @@
|
|||||||
|
|
||||||
<ion-tabs class="tab">
|
<ion-tabs class="tab">
|
||||||
<ion-tab-bar class="bottoms" slot="bottom">
|
<ion-tab-bar class="bottoms" slot="bottom">
|
||||||
<ion-tab-button tab="events" [class.active]="pathname === '/home/events' ">
|
|
||||||
<!-- <ion-icon name="home"></ion-icon> -->
|
|
||||||
<ion-icon *ngIf="pathname != '/home/events'" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="pathname == '/home/events'" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon>
|
|
||||||
<!-- <ion-badge color="danger">{{toDayEventStorage.eventsList.length + expedienteGdStore.count}}</ion-badge> -->
|
|
||||||
<ion-label>Início</ion-label>
|
|
||||||
</ion-tab-button>
|
|
||||||
|
|
||||||
<ion-tab-button tab="agenda" [class.active]="pathname === '/home/agenda' ">
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
|
||||||
<!-- <ion-icon name="calendar"></ion-icon> -->
|
<!-- <ion-icon name="home"></ion-icon> -->
|
||||||
<ion-icon *ngIf="pathname != '/home/agenda'" class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
|
<ion-icon *ngIf="pathname != '/home/events'" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="pathname == '/home/agenda'" class="nav-icon" src="assets/images/nav-hover/icons-nav-agenda-active.svg"></ion-icon>
|
<ion-icon *ngIf="pathname == '/home/events'" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon>
|
||||||
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Agenda</ion-label>
|
<!-- <ion-badge color="danger">{{toDayEventStorage.eventsList.length + expedienteGdStore.count}}</ion-badge> -->
|
||||||
</ion-tab-button>
|
<ion-label>Início</ion-label>
|
||||||
<ion-tab-button (click)="goto('/home/gabinete-digital')" [class.active]="pathname === '/home/gabinete-digital' ">
|
</ion-tab-button>
|
||||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
|
||||||
<ion-icon *ngIf="pathname != '/home/gabinete-digital'" class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="pathname == '/home/gabinete-digital'" class="nav-icon" src="assets/images/nav-hover/icons-nav-gabinete-active.svg"></ion-icon>
|
|
||||||
<!-- <ion-badge color="danger" *ngIf="!p.userRole(['PR'])" >{{ documentCounterService.mdTotalDocument }}</ion-badge>
|
|
||||||
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge> -->
|
|
||||||
<ion-label>Gabinete</ion-label>
|
|
||||||
</ion-tab-button>
|
|
||||||
|
|
||||||
<ion-tab-button tab="publications" [class.active]="pathname === '/home/publications' ">
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access])" tab="agenda" [class.active]="pathname === '/home/agenda' ">
|
||||||
<ion-icon *ngIf="pathname != '/home/publications'" class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
|
<!-- <ion-icon name="calendar"></ion-icon> -->
|
||||||
<ion-icon *ngIf="pathname == '/home/publications'" class="nav-icon" src="assets/images/nav-hover/icons-nav-actions-active.svg"></ion-icon>
|
<ion-icon *ngIf="pathname != '/home/agenda'" class="nav-icon" src="assets/images/icons-nav-calendar.svg"></ion-icon>
|
||||||
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Ações</ion-label>
|
<ion-icon *ngIf="pathname == '/home/agenda'" class="nav-icon" src="assets/images/nav-hover/icons-nav-agenda-active.svg"></ion-icon>
|
||||||
</ion-tab-button>
|
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Agenda</ion-label>
|
||||||
<ion-tab-button tab="chat" [class.active]="pathname === '/home/chat' ">
|
</ion-tab-button>
|
||||||
<ion-icon *ngIf="pathname != '/home/chat'" class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
|
|
||||||
<ion-icon *ngIf="pathname == '/home/chat'" class="nav-icon" src="assets/images/nav-hover/icons-nav-chat-active.svg"></ion-icon>
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Gabinete.access])" (click)="goto('/home/gabinete-digital')" [class.active]="pathname === '/home/gabinete-digital' ">
|
||||||
<ion-label>Chat</ion-label>
|
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||||
</ion-tab-button>
|
<ion-icon *ngIf="pathname != '/home/gabinete-digital'" class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="pathname == '/home/gabinete-digital'" class="nav-icon" src="assets/images/nav-hover/icons-nav-gabinete-active.svg"></ion-icon>
|
||||||
|
<!-- <ion-badge color="danger" *ngIf="!p.userRole(['PR'])" >{{ documentCounterService.mdTotalDocument }}</ion-badge>
|
||||||
|
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge> -->
|
||||||
|
<ion-label>Gabinete</ion-label>
|
||||||
|
</ion-tab-button>
|
||||||
|
|
||||||
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Actions.access])" tab="publications" [class.active]="pathname === '/home/publications' ">
|
||||||
|
<ion-icon *ngIf="pathname != '/home/publications'" class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="pathname == '/home/publications'" class="nav-icon" src="assets/images/nav-hover/icons-nav-actions-active.svg"></ion-icon>
|
||||||
|
<ion-label style="margin-bottom: 2px;" class="overflow-visible">Ações</ion-label>
|
||||||
|
</ion-tab-button>
|
||||||
|
|
||||||
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Chat.access])" tab="chat" [class.active]="pathname === '/home/chat' ">
|
||||||
|
<ion-icon *ngIf="pathname != '/home/chat'" class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="pathname == '/home/chat'" class="nav-icon" src="assets/images/nav-hover/icons-nav-chat-active.svg"></ion-icon>
|
||||||
|
<ion-label>Chat</ion-label>
|
||||||
|
</ion-tab-button>
|
||||||
|
|
||||||
</ion-tab-bar>
|
</ion-tab-bar>
|
||||||
</ion-tabs>
|
</ion-tabs>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { StorageService } from '../services/storage.service';
|
|||||||
import { File } from '@ionic-native/file/ngx';
|
import { File } from '@ionic-native/file/ngx';
|
||||||
/* import { WebNotificationPopupService } from '../services/notification/web-notification-popup.service'; */
|
/* import { WebNotificationPopupService } from '../services/notification/web-notification-popup.service'; */
|
||||||
import { DocumentCounterService } from '../services/worker/document-counter.service';
|
import { DocumentCounterService } from '../services/worker/document-counter.service';
|
||||||
import { PermissionService } from '../services/worker/permission.service';
|
import { PermissionService } from '../services/permission.service';
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
@@ -30,6 +30,8 @@ import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
|||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { NativeNotificationService } from 'src/app/services/native-notification.service';
|
import { NativeNotificationService } from 'src/app/services/native-notification.service';
|
||||||
|
import { UserSession } from '../models/user.model';
|
||||||
|
import { PermissionList } from '../models/permission/permissionList';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-home',
|
selector: 'app-home',
|
||||||
@@ -79,6 +81,8 @@ export class HomePage implements OnInit {
|
|||||||
|
|
||||||
status: string = "";
|
status: string = "";
|
||||||
audioName: string = "";
|
audioName: string = "";
|
||||||
|
public user: UserSession;
|
||||||
|
permissionList = new PermissionList();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@@ -102,12 +106,17 @@ export class HomePage implements OnInit {
|
|||||||
private sqliteservice: SqliteService,
|
private sqliteservice: SqliteService,
|
||||||
public RouteService: RouteService,
|
public RouteService: RouteService,
|
||||||
private WsChatService: WsChatService,
|
private WsChatService: WsChatService,
|
||||||
private NativeNotificationService: NativeNotificationService,) {
|
private NativeNotificationService: NativeNotificationService,
|
||||||
|
) {
|
||||||
|
|
||||||
|
if (SessionStore.exist) {
|
||||||
|
this.user = SessionStore.user;
|
||||||
|
}
|
||||||
|
|
||||||
/* this.webNotificationPopupService.askNotificationPermission() */
|
/* this.webNotificationPopupService.askNotificationPermission() */
|
||||||
|
|
||||||
this.NativeNotificationService.askForPermission()
|
this.NativeNotificationService.askForPermission()
|
||||||
|
|
||||||
this.router.events.subscribe((val) => {
|
this.router.events.subscribe((val) => {
|
||||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||||
document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove())
|
document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove())
|
||||||
@@ -171,6 +180,7 @@ export class HomePage implements OnInit {
|
|||||||
|
|
||||||
myWorker.postMessage('ali'); */
|
myWorker.postMessage('ali'); */
|
||||||
this.clearTabButtonSelection();
|
this.clearTabButtonSelection();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clearTabButtonSelection(){
|
clearTabButtonSelection(){
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export class AddNotePage implements OnInit {
|
|||||||
component: SearchPage,
|
component: SearchPage,
|
||||||
cssClass: 'modal-width-100-width-background modal',
|
cssClass: 'modal-width-100-width-background modal',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
typety: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||||
showSearchInput: true,
|
showSearchInput: true,
|
||||||
select: true
|
select: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||||
import { PedidoService } from 'src/app/Rules/pedido.service'
|
import { PedidoService } from 'src/app/Rules/pedido.service'
|
||||||
import { fullTask } from 'src/app/models/dailyworktask.model';
|
import { fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expedient
|
|||||||
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
||||||
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
|
import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document';
|
||||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
|
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { ViewDocumentPage } from '../view-document/view-document.page';
|
import { ViewDocumentPage } from '../view-document/view-document.page';
|
||||||
@@ -132,7 +132,7 @@ export class DocumentDetailPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async viewDocumentModal() {
|
async viewDocumentModal() {
|
||||||
|
|
||||||
const selectedDoc = this.LoadedDocument.Documents[ this.dicIndex]
|
const selectedDoc = this.LoadedDocument.Documents[ this.dicIndex]
|
||||||
|
|
||||||
let task = {
|
let task = {
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import { ViewMediaPageRoutingModule } from './view-media-routing.module';
|
|||||||
|
|
||||||
import { ViewMediaPage } from './view-media.page';
|
import { ViewMediaPage } from './view-media.page';
|
||||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||||
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||||
|
import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -16,6 +18,8 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|||||||
IonicModule,
|
IonicModule,
|
||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
ViewMediaPageRoutingModule,
|
ViewMediaPageRoutingModule,
|
||||||
|
PdfViewerModule,
|
||||||
|
NgxExtendedPdfViewerModule,
|
||||||
],
|
],
|
||||||
declarations: [ViewMediaPage]
|
declarations: [ViewMediaPage]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -24,6 +24,12 @@
|
|||||||
<img src="{{image}}">
|
<img src="{{image}}">
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="type == 'application/pdf'">
|
<div *ngIf="type == 'application/pdf'">
|
||||||
|
|
||||||
|
<pdf-viewer [src]="image"
|
||||||
|
[render-text]="true"
|
||||||
|
[original-size]="false"
|
||||||
|
style="width: 400px; height: 500px"
|
||||||
|
></pdf-viewer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ion-slide>
|
</ion-slide>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ModalController, NavParams } from '@ionic/angular';
|
import { ModalController, NavParams } from '@ionic/angular';
|
||||||
|
import { DomSanitizer} from '@angular/platform-browser';
|
||||||
|
import { pdfDefaultOptions } from 'ngx-extended-pdf-viewer';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-media',
|
selector: 'app-view-media',
|
||||||
@@ -18,19 +20,58 @@ export class ViewMediaPage implements OnInit {
|
|||||||
maxRation: 2
|
maxRation: 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
base64Sanitize = "";
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private navParams:NavParams,
|
private navParams:NavParams,
|
||||||
|
public sanitizer: DomSanitizer,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
this.image = this.navParams.get('image')
|
this.image = this.navParams.get('image')
|
||||||
this.type = this.navParams.get('type')
|
this.type = this.navParams.get('type')
|
||||||
this.name = this.navParams.get('username')
|
this.name = this.navParams.get('username')
|
||||||
this._updatedAt = this.navParams.get('_updatedAt')
|
this._updatedAt = this.navParams.get('_updatedAt')
|
||||||
|
pdfDefaultOptions.assetsFolder = 'bleeding-edge';
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.log(this.image)
|
||||||
|
|
||||||
|
|
||||||
|
const encodedData = btoa(this.image);
|
||||||
|
const blob = new Blob([this.b64toBlob(encodedData)], { type: 'application/pdf' });
|
||||||
|
this.base64Sanitize = URL.createObjectURL(blob);
|
||||||
|
//this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(this.base64Sanitize);
|
||||||
|
this.base64Sanitize;
|
||||||
|
console.log(this.base64Sanitize)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b64toBlob = (b64Data, contentType = '', sliceSize = 512) => {
|
||||||
|
const byteCharacters = atob(b64Data);
|
||||||
|
const byteArrays = [];
|
||||||
|
|
||||||
|
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
||||||
|
const slice = byteCharacters.slice(offset, offset + sliceSize);
|
||||||
|
|
||||||
|
const byteNumbers = new Array(slice.length);
|
||||||
|
for (let i = 0; i < slice.length; i++) {
|
||||||
|
byteNumbers[i] = slice.charCodeAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
const byteArray = new Uint8Array(byteNumbers);
|
||||||
|
byteArrays.push(byteArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = new Blob(byteArrays, { type: contentType });
|
||||||
|
return blob;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
close(){
|
close(){
|
||||||
this.modalController.dismiss()
|
this.modalController.dismiss()
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-14
@@ -1,7 +1,7 @@
|
|||||||
import { models } from 'beast-orm'
|
import { models } from 'beast-orm'
|
||||||
import { AESEncrypt } from '../services/aesencrypt.service'
|
import { AESEncrypt } from '../services/aesencrypt.service'
|
||||||
|
|
||||||
const _AESEncrypt = new AESEncrypt()
|
const _AESEncrypt = new AESEncrypt()
|
||||||
const { ArrayField, JsonField} = models.indexedDB.fields
|
const { ArrayField, JsonField} = models.indexedDB.fields
|
||||||
|
|
||||||
export class MessageModel extends models.Model {
|
export class MessageModel extends models.Model {
|
||||||
@@ -10,35 +10,36 @@ export class MessageModel extends models.Model {
|
|||||||
mentions = ArrayField()
|
mentions = ArrayField()
|
||||||
msg = models.CharField()
|
msg = models.CharField()
|
||||||
rid = models.CharField()
|
rid = models.CharField()
|
||||||
ts = models.CharField()
|
ts = JsonField({blank:true})
|
||||||
u = JsonField()
|
u = JsonField()
|
||||||
_id = models.CharField({unique:true})
|
_id = models.CharField({blank:true})
|
||||||
_updatedAt = models.CharField()
|
_updatedAt = models.IntegerField()
|
||||||
messageSend = models.BooleanField()
|
messageSend = models.BooleanField()
|
||||||
offline = models.BooleanField()
|
offline = models.BooleanField()
|
||||||
viewed = ArrayField()
|
viewed = ArrayField({blank:true})
|
||||||
received = ArrayField()
|
received = ArrayField({blank:true})
|
||||||
localReference = models.CharField({blank:true})
|
localReference = models.CharField({blank:true})
|
||||||
attachments = ArrayField()
|
attachments = ArrayField({blank:true})
|
||||||
file = ArrayField()
|
file = JsonField({blank:true})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DeleteMessageModel extends models.Model {
|
export class DeleteMessageModel extends models.Model {
|
||||||
|
|
||||||
messageId = models.IntegerField()
|
messageId = models.CharField()
|
||||||
rid = models.CharField()
|
rid = models.CharField()
|
||||||
ts = models.CharField()
|
|
||||||
u = JsonField()
|
u = JsonField()
|
||||||
needToReceiveBy = ArrayField()
|
needToReceiveBy = ArrayField()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
models.register({
|
models.register({
|
||||||
databaseName: 'chat-storage',
|
databaseName: 'chat-storage',
|
||||||
type: 'indexedDB',
|
type: 'indexedDB',
|
||||||
version: 1,
|
version: 4,
|
||||||
models: [MessageModel, DeleteMessageModel]
|
models: [MessageModel, DeleteMessageModel]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
window['MessageModel'] = MessageModel
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
export class ActionsPermission{
|
||||||
|
access = 534;
|
||||||
|
create = 535;
|
||||||
|
delete = 536;
|
||||||
|
edit = 537;
|
||||||
|
createPost = 538;
|
||||||
|
deletePost = 539;
|
||||||
|
editPost = 540;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export class AgendaPermission{
|
||||||
|
access = 530
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export class ChatPermission{
|
||||||
|
access = 541;
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export class GabinetePermission{
|
||||||
|
access = 531;
|
||||||
|
pr_tasks = 532;
|
||||||
|
md_tasks = 533;
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { ActionsPermission } from "./actions.permission";
|
||||||
|
import { AgendaPermission } from "./agenda-permission";
|
||||||
|
import { ChatPermission } from "./chat-permission";
|
||||||
|
import { GabinetePermission } from "./gabinete-permission";
|
||||||
|
|
||||||
|
export class PermissionList{
|
||||||
|
Agenda = new AgendaPermission();
|
||||||
|
Gabinete = new GabinetePermission();
|
||||||
|
Actions = new ActionsPermission();
|
||||||
|
Chat = new ChatPermission();
|
||||||
|
}
|
||||||
@@ -2,12 +2,12 @@ export class UserForm {
|
|||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
domainName: string;
|
domainName: string;
|
||||||
BasicAuthKey: string;
|
BasicAuthKey: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export class LoginUserRespose {
|
export class LoginUserRespose {
|
||||||
BasicAuthKey: string;
|
BasicAuthKey: string;
|
||||||
UserId: number;
|
UserId: number;
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
Email: string
|
Email: string
|
||||||
@@ -30,11 +30,12 @@ export class LoginUserRespose {
|
|||||||
}[]
|
}[]
|
||||||
UserName: string
|
UserName: string
|
||||||
Profile: any;
|
Profile: any;
|
||||||
|
UserPermissions: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export class UserSession {
|
export class UserSession {
|
||||||
BasicAuthKey: string;
|
BasicAuthKey: string;
|
||||||
UserId: number;
|
UserId: number;
|
||||||
Authorization: string;
|
Authorization: string;
|
||||||
Email: string
|
Email: string
|
||||||
@@ -63,5 +64,6 @@ export class UserSession {
|
|||||||
LoginPreference: 'None' | 'Password' | 'Pin' | null;
|
LoginPreference: 'None' | 'Password' | 'Pin' | null;
|
||||||
PIN: string
|
PIN: string
|
||||||
Inactivity: boolean
|
Inactivity: boolean
|
||||||
UrlBeforeInactivity: string
|
UrlBeforeInactivity: string;
|
||||||
}
|
UserPermissions: any;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,42 +1,46 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import { AgendaPage } from './agenda.page';
|
import { AgendaPage } from './agenda.page';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: AgendaPage
|
component: AgendaPage
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'approve-event-modal',
|
path: 'approve-event-modal',
|
||||||
loadChildren: () => import('../gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule)
|
loadChildren: () => import('../gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'event-actions-popover',
|
path: 'event-actions-popover',
|
||||||
loadChildren: () => import('./event-actions-popover/event-actions-popover.module').then( m => m.EventActionsPopoverPageModule)
|
loadChildren: () => import('./event-actions-popover/event-actions-popover.module').then( m => m.EventActionsPopoverPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'emend-message-modal',
|
path: 'emend-message-modal',
|
||||||
loadChildren: () => import('./emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule)
|
loadChildren: () => import('./emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'new-event',
|
path: 'new-event',
|
||||||
loadChildren: () => import('./new-event/new-event.module').then( m => m.NewEventPageModule)
|
loadChildren: () => import('./new-event/new-event.module').then( m => m.NewEventPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit-event',
|
path: 'edit-event',
|
||||||
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'view-event',
|
path: 'view-event',
|
||||||
loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule)
|
loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'evandre',
|
||||||
loadChildren: () => import('./evandre/evandre.module').then( m => m.EvandrePageModule)
|
loadChildren: () => import('./evandre/evandre.module').then( m => m.EvandrePageModule)
|
||||||
}
|
}
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
];
|
||||||
imports: [RouterModule.forChild(routes)],
|
|
||||||
exports: [RouterModule],
|
@NgModule({
|
||||||
})
|
imports: [RouterModule.forChild(routes)],
|
||||||
export class AgendaPageRoutingModule {}
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { EvandrePage } from './evandre.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: EvandrePage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class EvandrePageRoutingModule {}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { EvandrePageRoutingModule } from './evandre-routing.module';
|
||||||
|
|
||||||
|
import { EvandrePage } from './evandre.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
EvandrePageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [EvandrePage]
|
||||||
|
})
|
||||||
|
export class EvandrePageModule {}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<ion-header>
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>evandre</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { EvandrePage } from './evandre.page';
|
||||||
|
|
||||||
|
describe('EvandrePage', () => {
|
||||||
|
let component: EvandrePage;
|
||||||
|
let fixture: ComponentFixture<EvandrePage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ EvandrePage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(EvandrePage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-evandre',
|
||||||
|
templateUrl: './evandre.page.html',
|
||||||
|
styleUrls: ['./evandre.page.scss'],
|
||||||
|
})
|
||||||
|
export class EvandrePage implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -102,7 +102,10 @@
|
|||||||
<div class="message">
|
<div class="message">
|
||||||
<div *ngIf="msg.attachments" class="message-attachments">
|
<div *ngIf="msg.attachments" class="message-attachments">
|
||||||
<div *ngFor="let file of msg.attachments">
|
<div *ngFor="let file of msg.attachments">
|
||||||
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)">
|
<div *ngIf="msg.file.type == 'application/img' && !msg.attachments[0].image_url">
|
||||||
|
NOT UPLOADED
|
||||||
|
</div>
|
||||||
|
<div *ngIf="msg.file.type == 'application/img' && msg.attachments[0].image_url" (click)="openPreview(msg)">
|
||||||
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" >
|
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" >
|
||||||
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
@@ -118,7 +121,15 @@
|
|||||||
<ion-label class="file-title">{{file.title}}</ion-label>
|
<ion-label class="file-title">{{file.title}}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.file.type == 'application/audio'">
|
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && !file.title_link">
|
||||||
|
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||||
|
<ion-icon name="mic-outline" class="file-icon"></ion-icon>
|
||||||
|
<ion-label>{{file.title}}</ion-label>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
</ion-item>
|
||||||
|
</div>
|
||||||
|
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
|
||||||
<audio [src]="file.title_link|safehtml" preload="metadata" class="d-flex width-100" controls controlsList="nodownload noplaybackrate"></audio>
|
<audio [src]="file.title_link|safehtml" preload="metadata" class="d-flex width-100" controls controlsList="nodownload noplaybackrate"></audio>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-details-optional add-attachment-bg-color">
|
<div class="file-details-optional add-attachment-bg-color">
|
||||||
@@ -193,7 +204,7 @@
|
|||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
|
|
||||||
<div class="typing" *ngIf="wsChatMethodsService.getGroupRoom(roomId).otherUserType == true">
|
<div class="typing" *ngIf="wsChatMethodsService.getGroupRoom(roomId).otherUserType == true">
|
||||||
<ngx-letters-avatar *ngIf="showAvatar"
|
<ngx-letters-avatar *ngIf="showAvatar"
|
||||||
[avatarName]= "wsChatMethodsService.getGroupRoom(roomId).name"
|
[avatarName]= "wsChatMethodsService.getGroupRoom(roomId).name"
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
|||||||
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
||||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
import { MessageService } from 'src/app/services/chat/message.service';
|
||||||
|
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||||
|
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
@@ -43,8 +46,6 @@ import { DomSanitizer } from '@angular/platform-browser';
|
|||||||
})
|
})
|
||||||
export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
showLoader: boolean;
|
showLoader: boolean;
|
||||||
isGroupCreated: boolean;
|
isGroupCreated: boolean;
|
||||||
loggedUser: any;
|
loggedUser: any;
|
||||||
@@ -81,8 +82,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
allowTyping = true;
|
allowTyping = true;
|
||||||
storedFileNames = [];
|
storedFileNames = [];
|
||||||
lastAudioRecorded = '';
|
lastAudioRecorded = '';
|
||||||
audioRecorded:any = "";
|
audioRecorded: any = "";
|
||||||
audioDownloaded:any = "";
|
audioDownloaded: any = "";
|
||||||
durationDisplay = '';
|
durationDisplay = '';
|
||||||
duration = 0;
|
duration = 0;
|
||||||
showAvatar = true;
|
showAvatar = true;
|
||||||
@@ -112,6 +113,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private processesService: ProcessesService,
|
private processesService: ProcessesService,
|
||||||
private CameraService: CameraService,
|
private CameraService: CameraService,
|
||||||
private sanitiser: DomSanitizer,
|
private sanitiser: DomSanitizer,
|
||||||
|
private file: File,
|
||||||
|
private fileOpener: FileOpener,
|
||||||
) {
|
) {
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
this.isGroupCreated = true;
|
this.isGroupCreated = true;
|
||||||
@@ -225,7 +228,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFile(fileName?:any){
|
async getFile(fileName?: any) {
|
||||||
const audioFile = await Filesystem.readFile({
|
const audioFile = await Filesystem.readFile({
|
||||||
path: fileName,
|
path: fileName,
|
||||||
directory: Directory.Data
|
directory: Directory.Data
|
||||||
@@ -252,15 +255,49 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.lastAudioRecorded = fileName;
|
this.lastAudioRecorded = fileName;
|
||||||
})
|
})
|
||||||
|
|
||||||
this.storage.get('recordData').then((recordData) => {
|
try {
|
||||||
console.log(recordData);
|
this.storage.get('recordData').then((recordData) => {
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
console.log(recordData);
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||||
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) { }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
stopRecording() {
|
||||||
|
this.deleteRecording();
|
||||||
|
this.allowTyping = false;
|
||||||
|
console.log('Stop');
|
||||||
|
if (!this.recording) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.recording = false;
|
||||||
|
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
|
||||||
|
console.log('==================================', result);
|
||||||
|
|
||||||
|
this.recording = false;
|
||||||
|
if (result.value && result.value.recordDataBase64) {
|
||||||
|
const recordData = result.value.recordDataBase64;
|
||||||
|
//console.log(recordData);
|
||||||
|
const fileName = new Date().getTime() + ".mp3";
|
||||||
|
//Save file
|
||||||
|
await this.storage.set('fileName', fileName)
|
||||||
|
this.storage.set('recordData', result).then(() => {
|
||||||
|
console.log('Audio recorded saved', result);
|
||||||
|
|
||||||
|
setTimeout(async () => {
|
||||||
|
this.loadFiles();
|
||||||
|
}, 1000);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
else{
|
})
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
startRecording() {
|
startRecording() {
|
||||||
@@ -274,34 +311,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.calculateDuration();
|
this.calculateDuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
stopRecording() {
|
|
||||||
this.deleteRecording();
|
|
||||||
this.allowTyping = false;
|
|
||||||
console.log('Stop');
|
|
||||||
if (!this.recording) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.recording = false;
|
|
||||||
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
|
|
||||||
console.log(result);
|
|
||||||
this.recording = false;
|
|
||||||
if (result.value && result.value.recordDataBase64) {
|
|
||||||
const recordData = result.value.recordDataBase64;
|
|
||||||
//console.log(recordData);
|
|
||||||
const fileName = new Date().getTime() + ".mp3";
|
|
||||||
//Save file
|
|
||||||
this.storage.set('fileName',fileName);
|
|
||||||
this.storage.set('recordData',result).then(() => {
|
|
||||||
console.log('Audio recorded saved');
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
setTimeout(async () => {
|
|
||||||
this.loadFiles();
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
async deleteRecording(){
|
|
||||||
|
async deleteRecording() {
|
||||||
this.storage.remove('fileName');
|
this.storage.remove('fileName');
|
||||||
this.storage.remove('recordData');
|
this.storage.remove('recordData');
|
||||||
|
|
||||||
@@ -364,7 +376,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getChatMembers() {
|
async getChatMembers() {
|
||||||
//return await this.chatService.getMembers(roomId).toPromise();
|
|
||||||
this.chatService.getAllUsers().subscribe(res => {
|
this.chatService.getAllUsers().subscribe(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
|
||||||
@@ -428,41 +439,64 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.wsChatMethodsService.getGroupRoom(this.roomId).send({})
|
this.wsChatMethodsService.getGroupRoom(this.roomId).send({})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base64toBlob(base64Data, contentType) {
|
||||||
|
contentType = contentType || '';
|
||||||
|
var sliceSize = 1024;
|
||||||
|
var byteCharacters = atob(base64Data);
|
||||||
|
var bytesLength = byteCharacters.length;
|
||||||
|
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||||
|
var byteArrays = new Array(slicesCount);
|
||||||
|
|
||||||
|
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||||
|
var begin = sliceIndex * sliceSize;
|
||||||
|
var end = Math.min(begin + sliceSize, bytesLength);
|
||||||
|
|
||||||
|
var bytes = new Array(end - begin);
|
||||||
|
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||||
|
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||||
|
}
|
||||||
|
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||||
|
}
|
||||||
|
return new Blob(byteArrays, { type: contentType });
|
||||||
|
}
|
||||||
|
|
||||||
async sendAudio(fileName) {
|
async sendAudio(fileName) {
|
||||||
|
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
let audioFile;
|
||||||
this.storage.get('recordData').then((recordData) => {
|
this.storage.get('recordData').then((recordData) => {
|
||||||
console.log(recordData);
|
console.log(recordData);
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
audioFile = recordData;
|
||||||
this.audioRecorded = recordData.value.recordDataBase64;
|
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||||
|
this.audioRecorded = recordData?.value?.recordDataBase64;
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Converting base64 to blob
|
||||||
|
const encodedData = btoa(this.audioRecorded);
|
||||||
|
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||||
|
console.log(blob)
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("blobFile", blob);
|
||||||
|
|
||||||
|
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||||
|
file: {
|
||||||
|
"type": "application/audio",
|
||||||
|
"msDuration": audioFile.value.msDuration,
|
||||||
|
"mimeType": audioFile.value.mimeType,
|
||||||
|
},
|
||||||
|
attachments: [{
|
||||||
|
"title": fileName,
|
||||||
|
"title_link_download": true,
|
||||||
|
"type": "audio"
|
||||||
|
}],
|
||||||
|
temporaryData: formData
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Converting base64 to blob
|
|
||||||
const base64Response = await fetch(this.audioRecorded);
|
|
||||||
const blob = await base64Response.blob();
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("blobFile", blob);
|
|
||||||
|
|
||||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
|
||||||
file: {
|
|
||||||
"type": "application/audio",
|
|
||||||
/* "guid": '', */
|
|
||||||
},
|
|
||||||
attachments: [{
|
|
||||||
"title": fileName ,
|
|
||||||
/* "title_link": this.audioRecorded, */
|
|
||||||
"title_link_download": true,
|
|
||||||
"type": "file"
|
|
||||||
}],
|
|
||||||
temporaryData: formData
|
|
||||||
})
|
|
||||||
this.deleteRecording();
|
this.deleteRecording();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -662,37 +696,60 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async addFileToChat(types: typeof FileType[] ) {
|
async addFileToChat(types: typeof FileType[]) {
|
||||||
|
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
|
||||||
const file: any = await this.fileService.getFileFromDevice(types);
|
const file: any = await this.fileService.getFileFromDevice(types);
|
||||||
console.log('Add file', file)
|
|
||||||
/* const imageData = await this.fileToBase64Service.convert(file).then((filee) => {
|
|
||||||
console.log('Add file', filee)
|
|
||||||
}) */
|
|
||||||
const response = await fetch(file);
|
|
||||||
const blob = await response.blob();
|
|
||||||
console.log('Add file', blob)
|
|
||||||
|
|
||||||
const formData = new FormData();
|
console.log('Add file', JSON.stringify(await this.getBase64(file)))
|
||||||
formData.append("blobFile", blob);
|
|
||||||
|
|
||||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
if (file.type == "application/pdf") {
|
||||||
file: {
|
|
||||||
"type": file.type,
|
|
||||||
"guid": '',
|
|
||||||
},
|
|
||||||
attachments: [{
|
|
||||||
"title": file.name ,
|
|
||||||
"name": file.name ,
|
|
||||||
// "text": "description",
|
|
||||||
//"image_url": file.base64String, // rocketchat
|
|
||||||
"title_link_download": false,
|
|
||||||
}],
|
|
||||||
temporaryData: formData
|
|
||||||
})
|
|
||||||
|
|
||||||
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
||||||
|
const blob = this.base64toBlob(encodedData, 'application/pdf')
|
||||||
|
console.log('Add Blob file', blob)
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('blobFile', blob);
|
||||||
|
console.log(formData)
|
||||||
|
|
||||||
|
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||||
|
file: {
|
||||||
|
"type": file.type,
|
||||||
|
"guid": '',
|
||||||
|
},
|
||||||
|
attachments: [{
|
||||||
|
"title": file.name,
|
||||||
|
"name": file.name,
|
||||||
|
// "text": "description",
|
||||||
|
"title_link_download": false,
|
||||||
|
}],
|
||||||
|
temporaryData: formData
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log('File type invalid')
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getFileReader(): FileReader {
|
||||||
|
const fileReader = new FileReader();
|
||||||
|
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
|
||||||
|
return zoneOriginalInstance || fileReader;
|
||||||
|
}
|
||||||
|
|
||||||
|
getBase64(file) {
|
||||||
|
var reader = this.getFileReader();
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
return new Promise(resolve => {
|
||||||
|
reader.onload = function () {
|
||||||
|
resolve(reader.result)
|
||||||
|
};
|
||||||
|
reader.onerror = function (error) {
|
||||||
|
console.log('Error: ', error);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -950,58 +1007,95 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
card.el.style['z-index'] = 11;
|
card.el.style['z-index'] = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadFileMsg(msg) {
|
b64toBlob(b64Data, contentType) {
|
||||||
console.log('FILE TYPE', msg.file.type)
|
contentType = contentType || '';
|
||||||
this.downloadFile = "";
|
var sliceSize = 512;
|
||||||
// if (msg.file.type == "application/img") {
|
b64Data = b64Data.replace(/^[^,]+,/, '');
|
||||||
this.AttachmentsService.downloadFile(msg.file.guid).subscribe(async (event) => {
|
b64Data = b64Data.replace(/\s/g, '');
|
||||||
console.log('FILE TYPE 22', msg.file.guid)
|
var byteCharacters = window.atob(b64Data);
|
||||||
var name = msg.file.guid;
|
var byteArrays = [];
|
||||||
|
|
||||||
if (event.type === HttpEventType.DownloadProgress) {
|
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
||||||
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
var slice = byteCharacters.slice(offset, offset + sliceSize);
|
||||||
console.log('FILE TYPE 33', msg.file.type)
|
|
||||||
} else if (event.type === HttpEventType.Response) {
|
|
||||||
if (msg.file.type == "application/img") {
|
|
||||||
this.downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
|
||||||
} else {
|
|
||||||
|
|
||||||
this.downloadFile = event.body;
|
var byteNumbers = new Array(slice.length);
|
||||||
}
|
for (var i = 0; i < slice.length; i++) {
|
||||||
|
byteNumbers[i] = slice.charCodeAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
msg.attachments[0] = {
|
var byteArray = new Uint8Array(byteNumbers);
|
||||||
image_url: this.downloadFile,
|
|
||||||
name: msg.attachments[0].name,
|
byteArrays.push(byteArray);
|
||||||
title: msg.attachments[0].title,
|
}
|
||||||
title_link_download: msg.attachments[0].title_link_download,
|
|
||||||
ts: msg.attachments[0].ts
|
var blob = new Blob(byteArrays, { type: contentType });
|
||||||
}
|
return blob;
|
||||||
this.sqlservice.updateChatMsg(msg._id, this.downloadFile);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log('FILE TYPE 44', this.downloadFile)
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async openPreview(msg) {
|
openFile(pdfString, filename) {
|
||||||
|
const blob = this.b64toBlob(pdfString, 'application/pdf')
|
||||||
|
let pathFile = ''
|
||||||
|
const fileName = filename
|
||||||
|
const contentFile = blob
|
||||||
|
if (this.platform.is('ios')) {
|
||||||
|
pathFile = this.file.documentsDirectory
|
||||||
|
} else {
|
||||||
|
pathFile = this.file.externalRootDirectory
|
||||||
|
}
|
||||||
|
console.log(pdfString)
|
||||||
|
console.log(pathFile)
|
||||||
|
console.log(contentFile)
|
||||||
|
this.file
|
||||||
|
.writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||||
|
.then(success => {
|
||||||
|
this.fileOpener
|
||||||
|
.open(pathFile + fileName, 'application/pdf')
|
||||||
|
.then(() => console.log('File is opened'))
|
||||||
|
.catch(e => console.log('Error opening file', e));
|
||||||
|
})
|
||||||
|
.catch(e => console.log('Error writing file', e))
|
||||||
|
}
|
||||||
|
|
||||||
if (!msg.attachments[0].image_url ||msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
downloadFileMsg(msg: MessageService) {
|
||||||
|
msg.downloadFileMsg()
|
||||||
|
}
|
||||||
|
|
||||||
|
async openPreview(msg: MessageService) {
|
||||||
|
|
||||||
|
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
||||||
this.downloadFileMsg(msg)
|
this.downloadFileMsg(msg)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const modal = await this.modalController.create({
|
|
||||||
component: ViewMediaPage,
|
var str = msg.attachments[0].image_url;
|
||||||
cssClass: 'modal modal-desktop',
|
str = str.substring(1, ((str.length) - 1));
|
||||||
componentProps: {
|
|
||||||
image: msg.attachments[0].image_url,
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
type: msg.file.type,
|
|
||||||
username: msg.u.name,
|
const modal = await this.modalController.create({
|
||||||
_updatedAt: msg._updatedAt
|
component: ViewMediaPage,
|
||||||
}
|
cssClass: 'modal modal-desktop',
|
||||||
});
|
componentProps: {
|
||||||
modal.present();
|
image: str,
|
||||||
|
type: msg.file.type,
|
||||||
|
username: msg.u.name,
|
||||||
|
_updatedAt: msg._updatedAt
|
||||||
|
}
|
||||||
|
});
|
||||||
|
modal.present();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.openFile(str, msg.attachments[0].name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async audioPreview(msg) {
|
||||||
|
console.log(msg);
|
||||||
|
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
|
||||||
|
this.downloadFileMsg(msg)
|
||||||
|
} else { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { BtnModalDismissPage } from 'src/app/shared/btn-modal-dismiss/btn-modal-
|
|||||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -23,7 +22,6 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
|||||||
MessagesPageRoutingModule,
|
MessagesPageRoutingModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
LettersAvatarModule,
|
LettersAvatarModule,
|
||||||
PipesModule,
|
|
||||||
],
|
],
|
||||||
declarations: [MessagesPage]
|
declarations: [MessagesPage]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<ion-header class="ion-no-border">
|
<ion-header class="ion-no-border">
|
||||||
<ion-toolbar class="header-toolbar">
|
<ion-toolbar class="header-toolbar">
|
||||||
<!-- <div #rectangle class="rectangle" (press)="handlePress()">
|
<!-- <div #rectangle class="rectangle" (press)="handlePress()">
|
||||||
Double click me to change the color
|
Double click me to change the color
|
||||||
@@ -26,14 +26,15 @@
|
|||||||
<div hidden class="right">
|
<div hidden class="right">
|
||||||
<button class="btn-no-color" (click)="openMessagesOptions()">
|
<button class="btn-no-color" (click)="openMessagesOptions()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg">
|
||||||
|
</ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div hidden class="header-bottom" (click)="addContacts()">
|
<div hidden class="header-bottom" (click)="addContacts()">
|
||||||
<div class="header-bottom-icon">
|
<div class="header-bottom-icon">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/icon/icons-user.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/icon/icons-user.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/icon/theme/gov/icons-user.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/icon/theme/gov/icons-user.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-bottom-contacts">
|
<div class="header-bottom-contacts">
|
||||||
<ion-label class="text-color-blue">Adicionar contacto</ion-label>
|
<ion-label class="text-color-blue">Adicionar contacto</ion-label>
|
||||||
@@ -51,8 +52,11 @@
|
|||||||
</ion-refresher-content>
|
</ion-refresher-content>
|
||||||
</ion-refresher> -->
|
</ion-refresher> -->
|
||||||
<div (click)="handleClick()" class="messages" #scrollMe>
|
<div (click)="handleClick()" class="messages" #scrollMe>
|
||||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId" >
|
<div class="messages-list-item-wrapper container-width-100"
|
||||||
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' (click)="downloadFileMsg(msg)" *ngIf="msg.msg !=''">
|
*ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last"
|
||||||
|
[class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
|
||||||
|
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}'
|
||||||
|
*ngIf="msg.msg !=''">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<ion-label (click)="hkellor()">{{msg.u.name}}</ion-label>
|
<ion-label (click)="hkellor()">{{msg.u.name}}</ion-label>
|
||||||
<span class="time">{{msg.duration}}</span>
|
<span class="time">{{msg.duration}}</span>
|
||||||
@@ -80,47 +84,77 @@
|
|||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.file.type != 'application/img'">
|
<div *ngIf="msg.file.type != 'application/img'">
|
||||||
<div class="file add-attachment-bg-color" *ngIf="msg.file.type != 'application/audio'">
|
<div class="file add-attachment-bg-color" *ngIf="msg.file.type != 'application/audio'">
|
||||||
<div (click)="docIndex(i); viewDocument(msg, file.title_link)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
<div (click)="docIndex(i); openPreview(msg)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
||||||
<span *ngIf="msg.file.type">
|
<span *ngIf="msg.file.type">
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon">
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
|
</fa-icon>
|
||||||
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
<fa-icon
|
||||||
|
*ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'"
|
||||||
|
icon="file-word" class="excel-icon"></fa-icon>
|
||||||
|
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg">
|
||||||
|
</ion-icon>
|
||||||
</span>
|
</span>
|
||||||
<ion-label class="file-title">{{file.title}}</ion-label>
|
<ion-label class="file-title">{{file.title}}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.file.type == 'application/audio'">
|
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && !file.title_link">
|
||||||
<audio [src]="file.title_link|safehtml" preload="metadata" class="d-flex width-100" controls controlsList="nodownload noplaybackrate"></audio>
|
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||||
|
<ion-icon name="mic-outline" class="file-icon"></ion-icon>
|
||||||
|
<ion-label>{{file.title}}</ion-label>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
</ion-item>
|
||||||
|
</div>
|
||||||
|
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
|
||||||
|
<audio [src]="file.title_link|safehtml" preload="metadata" class="d-flex width-100" controls
|
||||||
|
controlsList="nodownload noplaybackrate"></audio>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-details-optional add-attachment-bg-color">
|
<div class="file-details-optional add-attachment-bg-color">
|
||||||
<ion-label *ngIf="msg.file && msg.file != ''">
|
<ion-label *ngIf="msg.file && msg.file != ''">
|
||||||
<span *ngIf="file.description">{{file.description}}</span>
|
<span *ngIf="file.description">{{file.description}}</span>
|
||||||
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
||||||
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
<span
|
||||||
|
*ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
{{last ? scrollToBottom() : ''}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal">
|
||||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
|
||||||
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
</button><br />
|
||||||
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
|
<ion-label class="info-meeting-medium">
|
||||||
</div>
|
<ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a
|
||||||
|
{{showDateDuration(msg.file.end_date)}}
|
||||||
|
</ion-label><br />
|
||||||
|
<ion-label class="info-meeting-medium">
|
||||||
|
<ion-icon></ion-icon>
|
||||||
|
<ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}
|
||||||
|
</ion-label><br />
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="msg.file && msg.delate == false">
|
<div *ngIf="msg.file && msg.delate == false">
|
||||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal">
|
||||||
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
|
||||||
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
|
</button><br />
|
||||||
|
<ion-label class="info-meeting-medium">
|
||||||
|
<ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a
|
||||||
|
{{showDateDuration(msg.file.end_date)}}
|
||||||
|
</ion-label><br />
|
||||||
|
<ion-label class="info-meeting-medium">
|
||||||
|
<ion-icon></ion-icon>
|
||||||
|
<ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}
|
||||||
|
</ion-label><br />
|
||||||
</div>
|
</div>
|
||||||
{{last ? scrollToBottom() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
@@ -164,24 +198,24 @@
|
|||||||
<ion-footer >
|
<ion-footer >
|
||||||
|
|
||||||
|
|
||||||
<div class="typing" *ngIf="wsChatMethodsService.getDmRoom(roomId).otherUserType == true">
|
<div class="typing" *ngIf="wsChatMethodsService.getDmRoom(roomId).otherUserType == true">
|
||||||
<ngx-letters-avatar
|
<ngx-letters-avatar [avatarName]="wsChatMethodsService.getGroupRoom(roomId).name" [width]="30" [circular]="true"
|
||||||
[avatarName]= "wsChatMethodsService.getGroupRoom(roomId).name"
|
fontFamily="Roboto"></ngx-letters-avatar>
|
||||||
[width]="30"
|
|
||||||
[circular]="true"
|
|
||||||
fontFamily="Roboto"></ngx-letters-avatar>
|
|
||||||
está a escrever ...
|
está a escrever ...
|
||||||
</div>
|
</div>
|
||||||
<div class="width-100 pl-20 pr-20">
|
<div class="width-100 pl-20 pr-20">
|
||||||
<span *ngIf="!lastAudioRecorded">{{durationDisplay}}</span>
|
<span *ngIf="!lastAudioRecorded">{{durationDisplay}}</span>
|
||||||
<audio [src]="audioRecorded" class="d-flex width-100 mt-10 mb-10" *ngIf="lastAudioRecorded" controls controlsList="nodownload noplaybackrate"></audio>
|
<audio [src]="audioRecorded" class="d-flex width-100 mt-10 mb-10" *ngIf="lastAudioRecorded" controls
|
||||||
|
controlsList="nodownload noplaybackrate"></audio>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container width-100 d-flex">
|
<div class="container width-100 d-flex">
|
||||||
<div>
|
<div>
|
||||||
<button *ngIf="!recording && !lastAudioRecorded && allowTyping" class="btn-no-color" (click)="openChatOptions()">
|
<button *ngIf="!recording && !lastAudioRecorded && allowTyping" class="btn-no-color" (click)="openChatOptions()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-options" src="assets/images/icons-add.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-options"
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-options" src="assets/images/theme/gov/icons-add.svg"></ion-icon>
|
src="assets/images/icons-add.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-options"
|
||||||
|
src="assets/images/theme/gov/icons-add.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="recording || lastAudioRecorded || !allowTyping" class="btn-no-color" (click)="deleteRecording()">
|
<button *ngIf="recording || lastAudioRecorded || !allowTyping" class="btn-no-color" (click)="deleteRecording()">
|
||||||
<fa-icon class="icon-size-27" icon="trash"></fa-icon>
|
<fa-icon class="icon-size-27" icon="trash"></fa-icon>
|
||||||
@@ -189,26 +223,38 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="width-70 message-container">
|
<div class="width-70 message-container">
|
||||||
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
||||||
<ion-textarea *ngIf="allowTyping" autocomplete="on" autocorrect="on" spellcheck="true" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message" (ionChange)="wsChatMethodsService.getDmRoom(roomId).sendTyping()"></ion-textarea>
|
<ion-textarea *ngIf="allowTyping" autocomplete="on" autocorrect="on" spellcheck="true" clearOnEdit="true"
|
||||||
|
placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1"
|
||||||
|
[(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message"
|
||||||
|
(ionChange)="wsChatMethodsService.getDmRoom(roomId).sendTyping()"></ion-textarea>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
||||||
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
||||||
<ion-icon class="icon-size-45" name="stop-circle-outline" color="danger"></ion-icon>
|
<ion-icon class="icon-size-45" name="stop-circle-outline" color="danger"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button #recordbtn *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
<button #recordbtn *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && !lastAudioRecorded"
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
(click)="startRecording()" class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
||||||
|
src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
||||||
|
src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()" class="btn-no-color">
|
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()"
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
||||||
|
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
||||||
|
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && lastAudioRecorded" (click)="sendAudio(lastAudioRecorded)" class="btn-no-color">
|
<button *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && lastAudioRecorded"
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
(click)="sendAudio(lastAudioRecorded)" class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
||||||
|
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
||||||
|
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
|||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
|
||||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
import { Directory, Encoding, Filesystem, FilesystemDirectory, } from '@capacitor/filesystem';
|
||||||
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
||||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||||
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
|
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
|
||||||
@@ -40,10 +40,16 @@ import { SearchPage } from 'src/app/pages/search/search.page';
|
|||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||||
|
import { Plugins, Capacitor } from '@capacitor/core';
|
||||||
|
import { MultipleDocumentsPicker } from '@awesome-cordova-plugins/multiple-document-picker/ngx';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
/* import {Plugins} from '@capacitor/core';
|
import { StringDecoder } from 'string_decoder';
|
||||||
|
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||||
|
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||||
|
import { DocumentViewer } from '@awesome-cordova-plugins/document-viewer/ngx';
|
||||||
|
|
||||||
const { Filesystem } = Plugins; */
|
|
||||||
|
const IMAGE_DIR = 'stored-images';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-messages',
|
selector: 'app-messages',
|
||||||
@@ -87,14 +93,20 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
allowTyping = true;
|
allowTyping = true;
|
||||||
storedFileNames = [];
|
storedFileNames = [];
|
||||||
lastAudioRecorded = '';
|
lastAudioRecorded = '';
|
||||||
audioRecorded:any = "";
|
audioRecorded: any = "";
|
||||||
audioDownloaded:any = "";
|
audioDownloaded: any = "";
|
||||||
durationDisplay = '';
|
durationDisplay = '';
|
||||||
duration = 0;
|
duration = 0;
|
||||||
@ViewChild('recordbtn', { read: ElementRef }) recordBtn: ElementRef;
|
@ViewChild('recordbtn', { read: ElementRef }) recordBtn: ElementRef;
|
||||||
myAudio: any;
|
myAudio: any;
|
||||||
downloadfile: any;
|
downloadfile: any;
|
||||||
downloadFile: any;
|
downloadFile: any;
|
||||||
|
files: any[] = [];
|
||||||
|
@ViewChild('filechooser') fileChooserElementRef: ElementRef;
|
||||||
|
//items: File[] = [];
|
||||||
|
fileSelected?: Blob;
|
||||||
|
pdfUrl?: string;
|
||||||
|
base64File: string;
|
||||||
downloadProgess: number;
|
downloadProgess: number;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -121,7 +133,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private processesService: ProcessesService,
|
private processesService: ProcessesService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private fileToBase64Service: FileToBase64Service,
|
private fileToBase64Service: FileToBase64Service,
|
||||||
|
private multipleDocumentsPicker: MultipleDocumentsPicker,
|
||||||
|
private sant: DomSanitizer,
|
||||||
|
private file: File,
|
||||||
|
private fileOpener: FileOpener,
|
||||||
private sanitiser: DomSanitizer,
|
private sanitiser: DomSanitizer,
|
||||||
|
private document: DocumentViewer
|
||||||
) {
|
) {
|
||||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||||
this.roomId = this.navParams.get('roomId');
|
this.roomId = this.navParams.get('roomId');
|
||||||
@@ -205,15 +222,19 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.lastAudioRecorded = fileName;
|
this.lastAudioRecorded = fileName;
|
||||||
})
|
})
|
||||||
|
|
||||||
this.storage.get('recordData').then((recordData) => {
|
try {
|
||||||
console.log(recordData);
|
this.storage.get('recordData').then((recordData) => {
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
console.log(recordData);
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||||
}
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
|
||||||
else{
|
}
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
|
else {
|
||||||
}
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
} catch (error) { }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
startRecording() {
|
startRecording() {
|
||||||
@@ -224,8 +245,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
this.recording = true;
|
this.recording = true;
|
||||||
VoiceRecorder.startRecording()
|
VoiceRecorder.startRecording()
|
||||||
.then((result: GenericResponse) => console.log(result.value))
|
.then((result: GenericResponse) => console.log(result.value))
|
||||||
.catch(error => console.log(error));
|
.catch(error => console.log(error));
|
||||||
this.calculateDuration();
|
this.calculateDuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,8 +266,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
//console.log(recordData);
|
//console.log(recordData);
|
||||||
const fileName = new Date().getTime() + ".mp3";
|
const fileName = new Date().getTime() + ".mp3";
|
||||||
//Save file
|
//Save file
|
||||||
this.storage.set('fileName',fileName);
|
this.storage.set('fileName', fileName);
|
||||||
this.storage.set('recordData',result).then(() => {
|
this.storage.set('recordData', result).then(() => {
|
||||||
console.log('Audio recorded saved');
|
console.log('Audio recorded saved');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -256,7 +277,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteRecording(){
|
async deleteRecording() {
|
||||||
this.storage.remove('fileName');
|
this.storage.remove('fileName');
|
||||||
this.storage.remove('recordData');
|
this.storage.remove('recordData');
|
||||||
|
|
||||||
@@ -366,52 +387,67 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
|
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendAudio(fileName) {
|
base64toBlob(base64Data, contentType) {
|
||||||
|
contentType = contentType || '';
|
||||||
|
var sliceSize = 1024;
|
||||||
|
var byteCharacters = atob(base64Data);
|
||||||
|
var bytesLength = byteCharacters.length;
|
||||||
|
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||||
|
var byteArrays = new Array(slicesCount);
|
||||||
|
|
||||||
const roomId = this.roomId
|
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||||
this.storage.get('recordData').then((recordData) => {
|
var begin = sliceIndex * sliceSize;
|
||||||
console.log(recordData);
|
var end = Math.min(begin + sliceSize, bytesLength);
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
|
||||||
this.audioRecorded = recordData.value.recordDataBase64;
|
var bytes = new Array(end - begin);
|
||||||
|
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||||
|
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||||
}
|
}
|
||||||
else{
|
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
}
|
||||||
}
|
return new Blob(byteArrays, { type: contentType });
|
||||||
});
|
|
||||||
|
|
||||||
//Converting base64 to blob
|
|
||||||
const base64Response = await fetch(this.audioRecorded);
|
|
||||||
const blob = await base64Response.blob();
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("blobFile", blob);
|
|
||||||
|
|
||||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
|
||||||
file: {
|
|
||||||
"type": "application/audio",
|
|
||||||
/* "guid": '', */
|
|
||||||
},
|
|
||||||
attachments: [{
|
|
||||||
"title": fileName ,
|
|
||||||
"title_link": this.audioRecorded,
|
|
||||||
"title_link_download": true,
|
|
||||||
"type": "file"
|
|
||||||
}],
|
|
||||||
temporaryData: formData
|
|
||||||
})
|
|
||||||
this.deleteRecording();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blobToBase64 = blob => {
|
async sendAudio(fileName) {
|
||||||
const reader = new FileReader();
|
const roomId = this.roomId
|
||||||
reader.readAsDataURL(blob);
|
let audioFile;
|
||||||
return new Promise(resolve => {
|
this.storage.get('recordData').then((recordData) => {
|
||||||
reader.onloadend = () => {
|
|
||||||
resolve(reader.result);
|
audioFile = recordData;
|
||||||
};
|
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||||
|
this.audioRecorded = recordData?.value?.recordDataBase64;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(this.audioRecorded);
|
||||||
|
|
||||||
|
//Converting base64 to blob
|
||||||
|
const encodedData = btoa(this.audioRecorded);
|
||||||
|
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||||
|
console.log(blob)
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("blobFile", blob);
|
||||||
|
|
||||||
|
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||||
|
file: {
|
||||||
|
"type": "application/audio",
|
||||||
|
"msDuration": audioFile.value.msDuration,
|
||||||
|
"mimeType": audioFile.value.mimeType,
|
||||||
|
},
|
||||||
|
attachments: [{
|
||||||
|
"title": fileName,
|
||||||
|
"title_link_download": true,
|
||||||
|
"type": "audio"
|
||||||
|
}],
|
||||||
|
temporaryData: formData
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
this.deleteRecording();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
viewDocument(msg: any, url?: string) {
|
viewDocument(msg: any, url?: string) {
|
||||||
console.log(msg)
|
console.log(msg)
|
||||||
@@ -730,40 +766,62 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFileReader(): FileReader {
|
||||||
|
const fileReader = new FileReader();
|
||||||
|
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
|
||||||
|
return zoneOriginalInstance || fileReader;
|
||||||
|
}
|
||||||
|
|
||||||
async addFileToChat(types: typeof FileType[]) {
|
async addFileToChat(types: typeof FileType[]) {
|
||||||
|
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
|
||||||
const file: any = await this.fileService.getFileFromDevice(types);
|
const file: any = await this.fileService.getFileFromDevice(types);
|
||||||
console.log('Add file', file)
|
|
||||||
/* const imageData = await this.fileToBase64Service.convert(file).then((filee) => {
|
|
||||||
console.log('Add file', filee)
|
|
||||||
}) */
|
|
||||||
const response = await fetch(file);
|
|
||||||
const blob = await response.blob();
|
|
||||||
const blob2 = new Blob([blob])
|
|
||||||
console.log('Add file base64', file)
|
|
||||||
console.log('Add file blob', blob)
|
|
||||||
|
|
||||||
const formData = new FormData();
|
console.log('Add file', JSON.stringify(await this.getBase64(file)))
|
||||||
formData.append("blobFile", blob2);
|
|
||||||
|
|
||||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
if (file.type == "application/pdf") {
|
||||||
file: {
|
|
||||||
"type": file.type,
|
|
||||||
"guid": '',
|
|
||||||
},
|
|
||||||
attachments: [{
|
|
||||||
"title": file.name,
|
|
||||||
"name": file.name,
|
|
||||||
// "text": "description",
|
|
||||||
"title_link_download": false,
|
|
||||||
}],
|
|
||||||
temporaryData: formData
|
|
||||||
})
|
|
||||||
|
|
||||||
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
||||||
|
const blob = this.base64toBlob(encodedData, 'application/pdf')
|
||||||
|
console.log('Add Blob file', blob)
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('blobFile', blob);
|
||||||
|
console.log(formData)
|
||||||
|
|
||||||
|
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||||
|
file: {
|
||||||
|
"type": file.type,
|
||||||
|
"guid": '',
|
||||||
|
},
|
||||||
|
attachments: [{
|
||||||
|
"title": file.name,
|
||||||
|
"name": file.name,
|
||||||
|
// "text": "description",
|
||||||
|
"title_link_download": false,
|
||||||
|
}],
|
||||||
|
temporaryData: formData
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('File type invalid')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getBase64(file) {
|
||||||
|
var reader = this.getFileReader();
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
return new Promise(resolve => {
|
||||||
|
reader.onload = function () {
|
||||||
|
resolve(reader.result)
|
||||||
|
};
|
||||||
|
reader.onerror = function (error) {
|
||||||
|
console.log('Error: ', error);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -881,75 +939,106 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testeDownload(msg: MessageService) {
|
/* testeDownload(msg: MessageService) {
|
||||||
this.downloadFile = "";
|
this.downloadFile = "";
|
||||||
this.AttachmentsService.downloadFileAndStore(msg.file.guid);
|
this.AttachmentsService.downloadFileAndStore(msg.file.guid);
|
||||||
}
|
} */
|
||||||
|
|
||||||
|
|
||||||
downloadFileMsg(msg: MessageService) {
|
downloadFileMsg(msg: MessageService) {
|
||||||
console.log('FILE TYPE', msg.file.type)
|
msg.downloadFileMsg();
|
||||||
this.downloadFile = "";
|
}
|
||||||
//if (msg.file.type == "application/img") {
|
|
||||||
this.AttachmentsService.downloadFile(msg.file.guid).subscribe(async (event) => {
|
|
||||||
console.log('FILE TYPE 22', msg.file.guid)
|
|
||||||
var name = msg.file.guid;
|
|
||||||
|
|
||||||
if (event.type === HttpEventType.DownloadProgress) {
|
b64toBlob(b64Data, contentType) {
|
||||||
this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
contentType = contentType || '';
|
||||||
console.log(this.downloadProgess)
|
var sliceSize = 512;
|
||||||
console.log('FILE TYPE 33', msg.file.type)
|
b64Data = b64Data.replace(/^[^,]+,/, '');
|
||||||
} else if (event.type === HttpEventType.Response) {
|
b64Data = b64Data.replace(/\s/g, '');
|
||||||
if (msg.file.type == "application/img") {
|
var byteCharacters = window.atob(b64Data);
|
||||||
this.downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
var byteArrays = [];
|
||||||
} else {
|
|
||||||
//console.log('TRY THIS LIBRARY ',fromByteArray(event.body));
|
|
||||||
this.downloadFile = event.body;
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.attachments[0] = {
|
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
||||||
image_url: this.downloadFile,
|
var slice = byteCharacters.slice(offset, offset + sliceSize);
|
||||||
name: msg.attachments[0].name,
|
|
||||||
title: msg.attachments[0].title,
|
var byteNumbers = new Array(slice.length);
|
||||||
title_link_download: msg.attachments[0].title_link_download,
|
for (var i = 0; i < slice.length; i++) {
|
||||||
ts: msg.attachments[0].ts
|
byteNumbers[i] = slice.charCodeAt(i);
|
||||||
}
|
|
||||||
this.sqlservice.updateChatMsg(msg._id, this.downloadFile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
var byteArray = new Uint8Array(byteNumbers);
|
||||||
|
|
||||||
//}
|
byteArrays.push(byteArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
var blob = new Blob(byteArrays, { type: contentType });
|
||||||
|
return blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
testDownlod(msg: MessageService) {
|
openFile(pdfString, filename) {
|
||||||
this.AttachmentsService.downloadFileAndStore(msg.file.guid)
|
const blob = this.b64toBlob(pdfString, 'application/pdf')
|
||||||
|
let pathFile = ''
|
||||||
|
const fileName = filename
|
||||||
|
const contentFile = blob
|
||||||
|
if (this.platform.is('ios')) {
|
||||||
|
pathFile = this.file.documentsDirectory
|
||||||
|
} else {
|
||||||
|
pathFile = this.file.externalRootDirectory
|
||||||
|
}
|
||||||
|
console.log(pdfString)
|
||||||
|
console.log(pathFile)
|
||||||
|
console.log(contentFile)
|
||||||
|
this.file
|
||||||
|
.writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||||
|
.then(success => {
|
||||||
|
this.fileOpener
|
||||||
|
.open(pathFile + fileName, 'application/pdf')
|
||||||
|
.then(() => console.log('File is opened'))
|
||||||
|
.catch(e => console.log('Error opening file', e));
|
||||||
|
})
|
||||||
|
.catch(e => console.log('Error writing file', e))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async openPreview(msg) {
|
async openPreview(msg) {
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
|
|
||||||
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
||||||
this.downloadFile(msg)
|
this.downloadFileMsg(msg)
|
||||||
//this.testDownlod(msg)
|
//this.testDownlod(msg)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const modal = await this.modalController.create({
|
var str = msg.attachments[0].image_url;
|
||||||
component: ViewMediaPage,
|
str = str.substring(1, ((str.length) - 1));
|
||||||
cssClass: 'modal modal-desktop',
|
|
||||||
componentProps: {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
image: msg.attachments[0].image_url,
|
|
||||||
type: msg.file.type,
|
const modal = await this.modalController.create({
|
||||||
username: msg.u.name,
|
component: ViewMediaPage,
|
||||||
_updatedAt: msg._updatedAt
|
cssClass: 'modal modal-desktop',
|
||||||
}
|
componentProps: {
|
||||||
});
|
image: str,
|
||||||
modal.present();
|
type: msg.file.type,
|
||||||
|
username: msg.u.name,
|
||||||
|
_updatedAt: msg._updatedAt
|
||||||
|
}
|
||||||
|
});
|
||||||
|
modal.present();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.openFile(str, msg.attachments[0].name);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async audioPreview(msg) {
|
||||||
|
console.log(msg);
|
||||||
|
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
|
||||||
|
this.downloadFileMsg(msg)
|
||||||
|
} else { }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
imageSize(img) {
|
imageSize(img) {
|
||||||
var canvas = document.createElement('canvas');
|
var canvas = document.createElement('canvas');
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
|
|
||||||
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
|
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
|
||||||
<div class="schedule height-100">
|
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="schedule height-100">
|
||||||
<div class="schedule-header">
|
<div class="schedule-header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="schedule height-100">
|
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="schedule height-100">
|
||||||
<div class="schedule-header">
|
<div class="schedule-header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import { BackgroundService } from 'src/app/services/background.service';
|
|||||||
import { momentG } from 'src/plugin/momentG';
|
import { momentG } from 'src/plugin/momentG';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-events',
|
selector: 'app-events',
|
||||||
templateUrl: './events.page.html',
|
templateUrl: './events.page.html',
|
||||||
@@ -81,6 +83,8 @@ export class EventsPage implements OnInit {
|
|||||||
|
|
||||||
/* existingScreenOrientation: string; */
|
/* existingScreenOrientation: string; */
|
||||||
|
|
||||||
|
permissionList = new PermissionList();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private eventService: EventsService,
|
private eventService: EventsService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@@ -97,7 +101,8 @@ export class EventsPage implements OnInit {
|
|||||||
private networkconnection: NetworkConnectionService,
|
private networkconnection: NetworkConnectionService,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private storage: Storage
|
private storage: Storage,
|
||||||
|
public p: PermissionService,
|
||||||
) {
|
) {
|
||||||
/* this.existingScreenOrientation = this.screenOrientation.type;
|
/* this.existingScreenOrientation = this.screenOrientation.type;
|
||||||
console.log(this.existingScreenOrientation); */
|
console.log(this.existingScreenOrientation); */
|
||||||
@@ -213,7 +218,7 @@ export class EventsPage implements OnInit {
|
|||||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||||
|
|
||||||
const list = mdOficialEvents.concat(mdPessoalEvents);
|
const list = mdOficialEvents.concat(mdPessoalEvents);
|
||||||
|
|
||||||
this.addEventToDb(list);
|
this.addEventToDb(list);
|
||||||
this.listToPresent = list
|
this.listToPresent = list
|
||||||
|
|
||||||
|
|||||||
@@ -79,25 +79,25 @@
|
|||||||
|
|
||||||
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
||||||
<div class="option-desc"> <div>Responder ao PR</div> </div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Responder ao PR</div> </div>
|
||||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel mb-0" style="margin-bottom: 0px !important;" shape="round" >Executado</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Executado')" class="btn-cancel mb-0" style="margin-bottom: 0px !important;" shape="round" >Executado</button>
|
||||||
<!-- <div class="solid"></div> -->
|
<!-- <div class="solid"></div> -->
|
||||||
<div class="option-desc">Reencaminhar para Área jurídica</div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc">Reencaminhar para Área jurídica</div>
|
||||||
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
|
||||||
<!-- <div class="solid"></div> -->
|
<!-- <div class="solid"></div> -->
|
||||||
<div class="option-desc">Outras opções</div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc">Outras opções</div>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<!-- <div class="solid"></div> -->
|
<!-- <div class="solid"></div> -->
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||||
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||||
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
|||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despacho-pr',
|
selector: 'app-despacho-pr',
|
||||||
@@ -45,7 +46,8 @@ export class DespachoPrPage implements OnInit {
|
|||||||
intervenientes: any;
|
intervenientes: any;
|
||||||
cc: any = [];
|
cc: any = [];
|
||||||
|
|
||||||
constructor(private activateRoute: ActivatedRoute,
|
constructor(
|
||||||
|
private activateRoute: ActivatedRoute,
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
private attachmentsService: AttachmentsService,
|
private attachmentsService: AttachmentsService,
|
||||||
@@ -62,7 +64,8 @@ export class DespachoPrPage implements OnInit {
|
|||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private RouteService: RouteService
|
private RouteService: RouteService,
|
||||||
|
public p: PermissionService,
|
||||||
) {
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if (params["params"].SerialNumber) {
|
if (params["params"].SerialNumber) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="middle d-flex align-center flex-grow-1">
|
<div class="middle d-flex align-center flex-grow-1">
|
||||||
<ion-label class="title">{{ task.Folio}}</ion-label>
|
<ion-label class="title">{{ task.Folio}}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-icon" (click)="openOptions()">
|
<div class="div-icon" (click)="openOptions()" *ngIf="p.userPermission([p.permissionList.Agenda.access])">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { DespachoService } from 'src/app/Rules/despacho.service'
|
|||||||
import { Location } from '@angular/common'
|
import { Location } from '@angular/common'
|
||||||
import { fullTask } from 'src/app/models/dailyworktask.model';
|
import { fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
import { AttachmentList } from 'src/app/models/Excludetask';
|
import { AttachmentList } from 'src/app/models/Excludetask';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
|
|
||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
@@ -63,7 +63,7 @@ export class DespachoPage implements OnInit {
|
|||||||
private sqliteservice: SqliteService,
|
private sqliteservice: SqliteService,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
@@ -359,8 +359,8 @@ export class DespachoPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async generateDiploma(note:string, documents:any) {
|
async generateDiploma(note:string, documents:any) {
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialnumber,
|
"serialNumber": this.serialnumber,
|
||||||
"action": "Reencaminhar",
|
"action": "Reencaminhar",
|
||||||
"ActionTypeId": 99999839,
|
"ActionTypeId": 99999839,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
|
|||||||
+12
-12
@@ -90,26 +90,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="task && !p.userRole(['PR'])" class="aside-right flex-column height-100 overflow-y-auto">
|
<div class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<div class="option-desc"> <div>Enviar para o PR</div> </div>
|
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Enviar para o PR</div> </div>
|
||||||
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
|
<button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
|
||||||
<div class="option-desc"> <div>Solicitar revisão</div> </div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Solicitar revisão</div> </div>
|
||||||
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
||||||
<div class="option-desc"> <div>Outras opções</div> </div>
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) || p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Outras opções</div> </div>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
||||||
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
|
||||||
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
<button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="task && p.userRole(['PR'])" class="aside-right flex-column height-100 overflow-y-auto">
|
<!-- <div *ngIf="task && p.userRole(['PR'])" class="aside-right flex-column height-100 overflow-y-auto">
|
||||||
|
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
+6
-6
@@ -22,7 +22,7 @@ import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
|||||||
import { expedienteTask } from 'src/app/models/dailyworktask.model';
|
import { expedienteTask } from 'src/app/models/dailyworktask.model';
|
||||||
import { TaskService } from 'src/app/Rules/task.service';
|
import { TaskService } from 'src/app/Rules/task.service';
|
||||||
import { DocumentViewerPage } from 'src/app/modals/document-viewer/document-viewer.page';
|
import { DocumentViewerPage } from 'src/app/modals/document-viewer/document-viewer.page';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
this.onlinecheck = false;
|
this.onlinecheck = false;
|
||||||
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||||
console.log("expedient ditail", process)
|
console.log("expedient ditail", process)
|
||||||
|
|
||||||
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||||
var origina
|
var origina
|
||||||
if (process[0].originator === "undefined") {
|
if (process[0].originator === "undefined") {
|
||||||
@@ -173,7 +173,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
origina = JSON.parse(process[0].originator)
|
origina = JSON.parse(process[0].originator)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.task = {
|
this.task = {
|
||||||
"SerialNumber": process[0].serialNumber,
|
"SerialNumber": process[0].serialNumber,
|
||||||
"Folio": workflow.Subject,
|
"Folio": workflow.Subject,
|
||||||
@@ -191,7 +191,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
"AttachmentsProcessLastInstanceID": workflow.AttachmentsProcessLastInstanceID,
|
"AttachmentsProcessLastInstanceID": workflow.AttachmentsProcessLastInstanceID,
|
||||||
"InstanceID": workflow.InstanceID
|
"InstanceID": workflow.InstanceID
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fulltask = {
|
this.fulltask = {
|
||||||
Documents: JSON.parse(process[0].Documents),
|
Documents: JSON.parse(process[0].Documents),
|
||||||
actions: JSON.parse(process[0].actions),
|
actions: JSON.parse(process[0].actions),
|
||||||
@@ -209,11 +209,11 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
workflowInstanceID: process[0].workflowInstanceID,
|
workflowInstanceID: process[0].workflowInstanceID,
|
||||||
workflowName: process[0].workflowName,
|
workflowName: process[0].workflowName,
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div class="main-content d-flex height-100 border-t-radius">
|
<div class="main-content d-flex height-100 border-t-radius">
|
||||||
|
|
||||||
<!-- Aside left -->
|
<!-- Aside left -->
|
||||||
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
<div class="aside-wrapper d-flex flex-column width-md-40 flex-grow-1">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
<div class="title-container">
|
<div class="title-container">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<p class="text-center exp-card-content">{{ allProcessesList.length }} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content">{{ allProcessesList.length }} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column" *ngIf="loggeduser.Profile == 'MDGPR'" >
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
@@ -128,24 +128,24 @@
|
|||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente-hover.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente-hover.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'Pending'" src="assets/images/theme/gov/icons-expediente-pendente.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<p *ngIf="loggeduser.Profile == 'MDGPR'" class="text-center exp-card-title ">Pendentes</p>
|
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pendentes</p>
|
||||||
<p *ngIf="loggeduser.Profile == 'PR'" class="text-center exp-card-title ">Meus Pendentes</p>
|
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Meus Pendentes</p>
|
||||||
<p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDespachosPrPage(); selectedElement='DispatchesPr'" [class.active]="selectedElement == 'DispatchesPr'" class="box-hover exp-card d-md-flex flex-column justify-center" >
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) || p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDespachosPrPage(); selectedElement='DispatchesPr'" [class.active]="selectedElement == 'DispatchesPr'" class="box-hover exp-card d-md-flex flex-column justify-center" >
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente-hover.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente-hover.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DispatchesPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Despacho do Presidente da República</p>
|
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p>
|
||||||
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Despachos criados por mim</p>
|
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Despachos criados por mim</p>
|
||||||
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
|
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'" *ngIf="loggeduser.Profile == 'MDGPR'">
|
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Dispatches'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'Dispatches'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
||||||
@@ -163,8 +163,8 @@
|
|||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'RequestsForOpinion'" src="assets/images/theme/gov/icons-expediente-parecer-hover.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'RequestsForOpinion'" src="assets/images/theme/gov/icons-expediente-parecer-hover.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'RequestsForOpinion' " src="assets/images/theme/gov/icons-expediente-parecer.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'RequestsForOpinion' " src="assets/images/theme/gov/icons-expediente-parecer.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<p *ngIf="loggeduser.Profile == 'MDGPR'" class="text-center exp-card-title ">Pedidos de Parecer</p>
|
<p *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer</p>
|
||||||
<p *ngIf="loggeduser.Profile == 'PR'" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p>
|
<p *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="text-center exp-card-title ">Pedidos de Parecer solicitados por mim</p>
|
||||||
<p class="text-center exp-card-content">{{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content">{{pedidosstore.countparecer}} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
|
||||||
<div class="center-div">
|
<div class="center-div">
|
||||||
<div class="exp-card-icon">
|
<div class="exp-card-icon">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
||||||
@@ -208,31 +208,31 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR' ">Diplomas por Validar</p>
|
<p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Validar</p>
|
||||||
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'">Diplomas por Assinar</p>
|
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Assinar</p>
|
||||||
<p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
|
<p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
|
<div (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente-hover.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente-hover.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'MDGPR'">Diplomas assinados PR</p>
|
<p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas assinados PR</p>
|
||||||
<p class="text-center exp-card-title " *ngIf="loggeduser.Profile == 'PR'" >Diplomas</p>
|
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" >Diplomas</p>
|
||||||
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="loggeduser.Profile == 'PR'" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
|||||||
//import { NotificationsService } from 'src/app/services/notifications.service';
|
//import { NotificationsService } from 'src/app/services/notifications.service';
|
||||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
|
||||||
|
|
||||||
@@ -115,6 +115,9 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
|
|
||||||
customTaskPipe = new CustomTaskPipe()
|
customTaskPipe = new CustomTaskPipe()
|
||||||
|
|
||||||
|
permissions = {
|
||||||
|
Agenda: 530
|
||||||
|
}
|
||||||
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
||||||
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
|
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
|
||||||
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
|
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
|
||||||
@@ -125,7 +128,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
authService: AuthService,
|
authService: AuthService,
|
||||||
public p: PermissionService,
|
|
||||||
public waitForDomService: WaitForDomService,
|
public waitForDomService: WaitForDomService,
|
||||||
//private notificationsService: NotificationsService,
|
//private notificationsService: NotificationsService,
|
||||||
private despachoRule: DespachoService,
|
private despachoRule: DespachoService,
|
||||||
@@ -136,7 +138,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
private dataService: DataService,
|
private dataService: DataService,
|
||||||
private storage: Storage
|
private storage: Storage,
|
||||||
|
public p: PermissionService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
@@ -256,7 +259,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
let date = new Date(element.taskStartDate);
|
let date = new Date(element.taskStartDate);
|
||||||
date.setMonth(date.getMonth() + 1);
|
date.setMonth(date.getMonth() + 1);
|
||||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
|
||||||
let task = {
|
let task = {
|
||||||
"SerialNumber": element.serialNumber,
|
"SerialNumber": element.serialNumber,
|
||||||
"Folio": element.workflowInstanceDataFields.Subject,
|
"Folio": element.workflowInstanceDataFields.Subject,
|
||||||
@@ -274,11 +277,11 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
"Agenda": element.workflowInstanceDataFields.Agenda,
|
"Agenda": element.workflowInstanceDataFields.Agenda,
|
||||||
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
|
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
|
||||||
}
|
}
|
||||||
|
|
||||||
this.allProcessesList.push(task);
|
this.allProcessesList.push(task);
|
||||||
this.allProcessesList = removeDuplicate(this.allProcessesList);
|
this.allProcessesList = removeDuplicate(this.allProcessesList);
|
||||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||||
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -287,9 +290,9 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
let date = new Date(element.taskStartDate);
|
let date = new Date(element.taskStartDate);
|
||||||
date.setMonth(date.getMonth() + 1);
|
date.setMonth(date.getMonth() + 1);
|
||||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
|
||||||
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
||||||
|
|
||||||
let task = {
|
let task = {
|
||||||
"SerialNumber": element.serialNumber,
|
"SerialNumber": element.serialNumber,
|
||||||
"Folio": workflowInstanceDataFields.Subject,
|
"Folio": workflowInstanceDataFields.Subject,
|
||||||
@@ -306,11 +309,11 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
"Agenda": workflowInstanceDataFields.Agenda,
|
"Agenda": workflowInstanceDataFields.Agenda,
|
||||||
"customDate": this.setFormatDate(new Date(workflowInstanceDataFields.StartDate), new Date(workflowInstanceDataFields.EndDate), workflowInstanceDataFields.IsAllDayEvent),
|
"customDate": this.setFormatDate(new Date(workflowInstanceDataFields.StartDate), new Date(workflowInstanceDataFields.EndDate), workflowInstanceDataFields.IsAllDayEvent),
|
||||||
}
|
}
|
||||||
|
|
||||||
this.allProcessesList.push(task);
|
this.allProcessesList.push(task);
|
||||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||||
|
|
||||||
});
|
});
|
||||||
console.log("All process from db ", allprocess)
|
console.log("All process from db ", allprocess)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Reapreciar Deferimento'">
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Reapreciar Deferimento'">
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Deferimento'">
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Deferimento'">
|
||||||
@@ -110,14 +110,14 @@
|
|||||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button hidden (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button hidden (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button>
|
<button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente'">
|
<div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente'">
|
||||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
|
||||||
<button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
|
<button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" (click)="openForwardModal(task)" class="btn-cancel" shape="round" >Reencaminhar</button>
|
<button *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" (click)="openForwardModal(task)" class="btn-cancel" shape="round" >Reencaminhar</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
<button *ngIf="loggeduser.Profile == 'MDGPR'" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" class="buttons">
|
<div *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" class="buttons">
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import { PedidoService } from 'src/app/Rules/pedido.service';
|
|||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { DataService } from 'src/app/services/data.service';
|
import { DataService } from 'src/app/services/data.service';
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
|||||||
import { ThemeService } from 'src/app/services/theme.service';
|
import { ThemeService } from 'src/app/services/theme.service';
|
||||||
import { StorageService } from 'src/app/services/storage.service';
|
import { StorageService } from 'src/app/services/storage.service';
|
||||||
import { ChatService } from 'src/app/services/chat.service';
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
@@ -29,7 +31,8 @@ export class LoginPage implements OnInit {
|
|||||||
hasPin: boolean
|
hasPin: boolean
|
||||||
loginPreference: string
|
loginPreference: string
|
||||||
|
|
||||||
sessionStore = SessionStore
|
sessionStore = SessionStore;
|
||||||
|
permissionList = new PermissionList();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private notificatinsservice: NotificationsService,
|
private notificatinsservice: NotificationsService,
|
||||||
@@ -40,7 +43,8 @@ export class LoginPage implements OnInit {
|
|||||||
private clearStoreService: ClearStoreService,
|
private clearStoreService: ClearStoreService,
|
||||||
private changeProfileService: ChangeProfileService,
|
private changeProfileService: ChangeProfileService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private storageservice: StorageService
|
private storageservice: StorageService,
|
||||||
|
public permissionService: PermissionService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -101,26 +105,29 @@ export class LoginPage implements OnInit {
|
|||||||
// login to API successfully
|
// login to API successfully
|
||||||
if (attempt) {
|
if (attempt) {
|
||||||
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);
|
||||||
await this.authService.loginChat();
|
await this.authService.loginChat();
|
||||||
await this.authService.loginToChatWs()
|
await this.authService.loginToChatWs();
|
||||||
this.getToken();
|
this.getToken();
|
||||||
SessionStore.setInativity(true);
|
SessionStore.setInativity(true);
|
||||||
|
|
||||||
this.goback()
|
this.goback();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.clearStoreService.clear()
|
this.clearStoreService.clear();
|
||||||
SessionStore.delete()
|
SessionStore.delete();
|
||||||
window.localStorage.clear();
|
window.localStorage.clear();
|
||||||
|
|
||||||
await this.authService.SetSession(attempt, this.userattempt);
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
|
|
||||||
this.changeProfileService.run()
|
this.changeProfileService.run();
|
||||||
await this.authService.loginChat();
|
await this.authService.loginChat();
|
||||||
await this.authService.loginToChatWs()
|
await this.authService.loginToChatWs();
|
||||||
this.getToken();
|
this.getToken();
|
||||||
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -141,7 +148,16 @@ export class LoginPage implements OnInit {
|
|||||||
if(pathName) {
|
if(pathName) {
|
||||||
this.router.navigate([pathName]);
|
this.router.navigate([pathName]);
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['/home/events']);
|
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
||||||
|
this.router.navigate(['/home/events']);
|
||||||
|
}
|
||||||
|
else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||||
|
this.router.navigate(['/home/chat']);
|
||||||
|
}
|
||||||
|
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||||
|
alert('here')
|
||||||
|
this.router.navigate(['/home/publications']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,12 +56,12 @@
|
|||||||
</ion-content>
|
</ion-content>
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
<ion-toolbar class="footer-toolbar">
|
<ion-toolbar class="footer-toolbar">
|
||||||
<ion-buttons slot="start">
|
<ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.deletePost])" slot="start">
|
||||||
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
|
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
|
||||||
<ion-label>Eliminar</ion-label>
|
<ion-label>Eliminar</ion-label>
|
||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-buttons slot="end">
|
<ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.editPost])" slot="end">
|
||||||
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
|
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
|
||||||
<ion-label>Editar</ion-label>
|
<ion-label>Editar</ion-label>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
|||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication-detail',
|
selector: 'app-publication-detail',
|
||||||
@@ -31,7 +32,8 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
private RouteService: RouteService,
|
private RouteService: RouteService,
|
||||||
private sqliteservice: SqliteService,
|
private sqliteservice: SqliteService,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService ) {
|
public ThemeService: ThemeService,
|
||||||
|
public p:PermissionService ) {
|
||||||
|
|
||||||
this.publicationId = this.navParams.get('publicationId');
|
this.publicationId = this.navParams.get('publicationId');
|
||||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<ion-label class="title ">Acções Presidenciais</ion-label>
|
<ion-label class="title ">Acções Presidenciais</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-icon">
|
<div class="div-icon">
|
||||||
<button title="Adicionar nova ação presidencial" class="btn-no-color" (click)="AddPublicationFolder()">
|
<button *ngIf="p.userPermission([p.permissionList.Actions.create])" title="Adicionar nova ação presidencial" class="btn-no-color" (click)="AddPublicationFolder()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="icon-only" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="icon-only" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
@@ -92,14 +92,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item-options class="members-options" side="end">
|
<ion-item-options class="members-options" side="end">
|
||||||
<ion-item-option class="edit-option" (click)="editAction(evento.ProcessId)">
|
<ion-item-option *ngIf="p.userPermission([p.permissionList.Actions.edit])" class="edit-option" (click)="editAction(evento.ProcessId)">
|
||||||
<button class="btn-no-color">
|
<button class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
</ion-item-option>
|
</ion-item-option>
|
||||||
<ion-item-option class="delete-option" (click)="deleteAction(evento.ProcessId)">
|
<ion-item-option *ngIf="p.userPermission([p.permissionList.Actions.delete])" class="delete-option" (click)="deleteAction(evento.ProcessId)">
|
||||||
<button class="btn-no-color">
|
<button class="btn-no-color">
|
||||||
<ion-icon class="delete" name="trash-sharp"></ion-icon>
|
<ion-icon class="delete" name="trash-sharp"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
|||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -68,7 +69,8 @@ export class PublicationsPage implements OnInit {
|
|||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private storage: Storage
|
private storage: Storage,
|
||||||
|
public p: PermissionService,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||||
|
|||||||
+2
-2
@@ -61,12 +61,12 @@
|
|||||||
|
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
<ion-toolbar class="footer-toolbar">
|
<ion-toolbar class="footer-toolbar">
|
||||||
<ion-buttons slot="start">
|
<ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.deletePost])" slot="start">
|
||||||
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
|
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
|
||||||
<ion-label>Eliminar</ion-label>
|
<ion-label>Eliminar</ion-label>
|
||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-buttons slot="end">
|
<ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.editPost])" slot="end">
|
||||||
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
|
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
|
||||||
<ion-label>Editar</ion-label>
|
<ion-label>Editar</ion-label>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
+3
-1
@@ -10,6 +10,7 @@ import { Location } from '@angular/common';
|
|||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication-detail',
|
selector: 'app-publication-detail',
|
||||||
@@ -31,7 +32,8 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private RouteService: RouteService,
|
private RouteService: RouteService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
public p:PermissionService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<p class="item-content-detail">{{item.Detail}}</p>
|
<p class="item-content-detail">{{item.Detail}}</p>
|
||||||
<p class="item-content-date">{{item.DateBegin | date: 'dd-MM-yy | HH:mm'}}</p>
|
<p class="item-content-date">{{item.DateBegin | date: 'dd-MM-yy | HH:mm'}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions-icon cursor-pointer" (click)="AddPublication('2',item.ProcessId)">
|
<div *ngIf="p.userPermission([p.permissionList.Actions.createPost])" class="actions-icon cursor-pointer" (click)="AddPublication('2',item.ProcessId)">
|
||||||
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
|
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
|
||||||
@@ -33,7 +33,9 @@
|
|||||||
</ion-refresher> -->
|
</ion-refresher> -->
|
||||||
<div class="main-container background-white height-100 overflow-y-auto">
|
<div class="main-container background-white height-100 overflow-y-auto">
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-card *ngFor="let publication of getpublication let i = index">
|
<ion-card *ngFor="let publication of getpublication let i = index"
|
||||||
|
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||||
|
>
|
||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
<div class="post-img">
|
<div class="post-img">
|
||||||
<img [lazyLoad]="publication.FileBase64">
|
<img [lazyLoad]="publication.FileBase64">
|
||||||
@@ -57,10 +59,10 @@
|
|||||||
*ngFor="let publication of getpublication"
|
*ngFor="let publication of getpublication"
|
||||||
(click)="goToPublicationDetail(publication.DocumentId)"
|
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||||
>
|
>
|
||||||
|
|
||||||
<div class="post-img">
|
<div class="post-img">
|
||||||
<img [defaultImage]=defaultImage [lazyLoad]="publication.FileBase64">
|
<img [defaultImage]=defaultImage [lazyLoad]="publication.FileBase64">
|
||||||
|
|
||||||
<ng-template #imageLoaded>
|
<ng-template #imageLoaded>
|
||||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||||
<img [defaultImage]=defaultImage [lazyLoad]="publication.FileBase64">
|
<img [defaultImage]=defaultImage [lazyLoad]="publication.FileBase64">
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { BackgroundService } from 'src/app/services/background.service';
|
|||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { forkJoin } from 'rxjs';
|
import { forkJoin } from 'rxjs';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-publications',
|
selector: 'app-view-publications',
|
||||||
@@ -42,7 +43,8 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
private sqliteservice: SqliteService,
|
private sqliteservice: SqliteService,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private toastService: ToastService,) {
|
private toastService: ToastService,
|
||||||
|
public p: PermissionService,) {
|
||||||
|
|
||||||
this.item = new PublicationFolder();
|
this.item = new PublicationFolder();
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
@@ -259,7 +261,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
publicationArray.push(publicationlis);
|
publicationArray.push(publicationlis);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.publicationList = publicationArray;
|
this.publicationList = publicationArray;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
|||||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
import { RoomService } from './chat/room.service';
|
import { RoomService } from './chat/room.service';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
import { InitialsService } from './functions/initials.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -44,7 +45,8 @@ export class AuthService {
|
|||||||
private NfService:NfService,
|
private NfService:NfService,
|
||||||
private processesService: ProcessesService,
|
private processesService: ProcessesService,
|
||||||
private AttachmentsService: AttachmentsService,
|
private AttachmentsService: AttachmentsService,
|
||||||
private storage: Storage ) {
|
private storage: Storage,
|
||||||
|
private initialsService: InitialsService ) {
|
||||||
|
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
|
|
||||||
@@ -74,6 +76,8 @@ export class AuthService {
|
|||||||
|
|
||||||
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", '', this.opts).toPromise();
|
||||||
|
console.log(response);
|
||||||
|
|
||||||
if(saveSession) {
|
if(saveSession) {
|
||||||
this.SetSession(response, user)
|
this.SetSession(response, user)
|
||||||
}
|
}
|
||||||
@@ -94,6 +98,9 @@ export class AuthService {
|
|||||||
} else if(session.RoleID == 100000011) {
|
} else if(session.RoleID == 100000011) {
|
||||||
session.Profile = 'MDGPR'
|
session.Profile = 'MDGPR'
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
session.Profile = this.initialsService.getInitials(session.FullName);
|
||||||
|
}
|
||||||
|
|
||||||
session.Password = user.password
|
session.Password = user.password
|
||||||
session.RochetChatUser = user.username.split('@')[0]
|
session.RochetChatUser = user.username.split('@')[0]
|
||||||
@@ -124,7 +131,6 @@ export class AuthService {
|
|||||||
let responseChat = await this.httpService.post('login', postData).toPromise();
|
let responseChat = await this.httpService.post('login', postData).toPromise();
|
||||||
|
|
||||||
if(responseChat) {
|
if(responseChat) {
|
||||||
|
|
||||||
console.log('Login to Rocket chat OK', responseChat);
|
console.log('Login to Rocket chat OK', responseChat);
|
||||||
this.ValidatedUserChat = responseChat;
|
this.ValidatedUserChat = responseChat;
|
||||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||||
@@ -169,11 +175,15 @@ export class AuthService {
|
|||||||
try {
|
try {
|
||||||
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
|
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
|
||||||
message.file.guid = guid.path
|
message.file.guid = guid.path
|
||||||
|
|
||||||
|
console.log('========================================',guid)
|
||||||
// await this.storage.set(guid.path, message.file.image_url).then(() => {
|
// await this.storage.set(guid.path, message.file.image_url).then(() => {
|
||||||
// console.log('add picture to chat IMAGE SAVED')
|
// console.log('add picture to chat IMAGE SAVED')
|
||||||
// // message.getFileFromDb()
|
// // message.getFileFromDb()
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
message.downloadFileMsg()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.log('failed to upload to server', e)
|
console.log('failed to upload to server', e)
|
||||||
|
|||||||
@@ -47,13 +47,8 @@ export class ChatMethodsService {
|
|||||||
return this.chatService.sendMessage(body)
|
return this.chatService.sendMessage(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
deleteMessage(body) {
|
deleteMessage(body) {
|
||||||
return this.chatService.deleteMessage(body)
|
return this.chatService.deleteMessage(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,9 @@ import { ChatStorageService } from './chat-storage.service'
|
|||||||
import { ChatMethodsService } from './chat-methods.service'
|
import { ChatMethodsService } from './chat-methods.service'
|
||||||
import { MessageModel, DeleteMessageModel } from '../../models/beast-orm'
|
import { MessageModel, DeleteMessageModel } from '../../models/beast-orm'
|
||||||
import { AESEncrypt } from '../aesencrypt.service'
|
import { AESEncrypt } from '../aesencrypt.service'
|
||||||
|
import { HttpClient, HttpEventType } from '@angular/common/http';
|
||||||
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
|
import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -22,10 +25,10 @@ export class MessageService {
|
|||||||
msg = ''
|
msg = ''
|
||||||
rid = ''
|
rid = ''
|
||||||
ts = {}
|
ts = {}
|
||||||
|
|
||||||
u = {
|
u = {
|
||||||
name: '',
|
name: '',
|
||||||
username: '',
|
username: '',
|
||||||
_id: ""
|
_id: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +62,9 @@ export class MessageService {
|
|||||||
private WsChatService: WsChatService,
|
private WsChatService: WsChatService,
|
||||||
private ChatStorageService: ChatStorageService,
|
private ChatStorageService: ChatStorageService,
|
||||||
private ChatMethodsService: ChatMethodsService,
|
private ChatMethodsService: ChatMethodsService,
|
||||||
private AESEncrypt: AESEncrypt) {
|
private AESEncrypt: AESEncrypt,
|
||||||
|
private AttachmentsService: AttachmentsService,
|
||||||
|
private NetworkServiceService: NetworkServiceService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference , viewed = [], received = [], delate = false, delateRequest =false, }:Message) {
|
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference , viewed = [], received = [], delate = false, delateRequest =false, }:Message) {
|
||||||
@@ -74,17 +79,21 @@ export class MessageService {
|
|||||||
this._id = _id
|
this._id = _id
|
||||||
this._updatedAt = _updatedAt || new Date().getTime()
|
this._updatedAt = _updatedAt || new Date().getTime()
|
||||||
this.file = file
|
this.file = file
|
||||||
this.attachments = attachments
|
|
||||||
this.temporaryData = temporaryData
|
this.temporaryData = temporaryData
|
||||||
this.localReference = localReference || null
|
this.localReference = localReference || null
|
||||||
this.id = id
|
this.id = id
|
||||||
this.delate = delate
|
this.delate = delate
|
||||||
this.delateRequest = delateRequest
|
this.delateRequest = delateRequest
|
||||||
|
|
||||||
|
if(this.attachments?.length >= 1 && attachments?.length >= 1) {
|
||||||
|
this.attachments[0] = Object.assign(this.attachments[0], attachments[0])
|
||||||
|
} else {
|
||||||
|
this.attachments = attachments
|
||||||
|
}
|
||||||
|
|
||||||
this.viewed = [...new Set([...viewed,...this.viewed])];
|
this.viewed = [...new Set([...viewed,...this.viewed])];
|
||||||
this.received = [...new Set([...received,...this.received])];
|
this.received = [...new Set([...received,...this.received])];
|
||||||
|
|
||||||
|
|
||||||
if(!this.ts) {
|
if(!this.ts) {
|
||||||
this.offline = true
|
this.offline = true
|
||||||
this.messageSend = false
|
this.messageSend = false
|
||||||
@@ -102,7 +111,6 @@ export class MessageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(this.hasFile) {
|
if(this.hasFile) {
|
||||||
// this.getFileFromDb()
|
|
||||||
if(this.file.type != 'application/webtrix') {
|
if(this.file.type != 'application/webtrix') {
|
||||||
this.displayType = this.file.type.replace('application/','').toUpperCase()
|
this.displayType = this.file.type.replace('application/','').toUpperCase()
|
||||||
}
|
}
|
||||||
@@ -118,19 +126,6 @@ export class MessageService {
|
|||||||
return firstName + ' ' + lastName
|
return firstName + ' ' + lastName
|
||||||
}
|
}
|
||||||
|
|
||||||
// getFileFromDb() {
|
|
||||||
|
|
||||||
// if(this.hasFile) {
|
|
||||||
// if (this.file.guid) {
|
|
||||||
// this.storage.get(this.file.guid).then((image) => {
|
|
||||||
// if(image != null) {
|
|
||||||
// this.file.image_url = image
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
async send(): Promise<any> {
|
async send(): Promise<any> {
|
||||||
|
|
||||||
this.sendAttempt++;
|
this.sendAttempt++;
|
||||||
@@ -138,7 +133,7 @@ export class MessageService {
|
|||||||
if(!this.hasFile) {
|
if(!this.hasFile) {
|
||||||
|
|
||||||
const params = {roomId:this.rid, msg:this.msg, localReference: this.localReference}
|
const params = {roomId:this.rid, msg:this.msg, localReference: this.localReference}
|
||||||
|
|
||||||
await this.sendRequest(params)
|
await this.sendRequest(params)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -152,7 +147,7 @@ export class MessageService {
|
|||||||
|
|
||||||
this.uploadingFile = false
|
this.uploadingFile = false
|
||||||
|
|
||||||
if(uploadSuccessfully || this.hasSendAttachment == false) {
|
if(uploadSuccessfully) {
|
||||||
this.hasSendAttachment = true
|
this.hasSendAttachment = true
|
||||||
this.errorUploadingAttachment = false
|
this.errorUploadingAttachment = false
|
||||||
this.temporaryData = {}
|
this.temporaryData = {}
|
||||||
@@ -178,7 +173,7 @@ export class MessageService {
|
|||||||
return new Promise((resolve, reject)=>{
|
return new Promise((resolve, reject)=>{
|
||||||
reject(false)
|
reject(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -186,34 +181,40 @@ export class MessageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async sendRequest(params) {
|
async sendRequest(params) {
|
||||||
this.ChatMethodsService.send(params).subscribe(
|
|
||||||
(response: any) => {
|
|
||||||
const ChatMessage = response.message
|
|
||||||
this.messageSend = true
|
|
||||||
this.redefinedMessage(ChatMessage)
|
|
||||||
|
|
||||||
},
|
if(params?.attachments?.image_url) {
|
||||||
(error) => {
|
delete params?.attachments?.image_url
|
||||||
this.WsChatService.registerCallback({
|
}
|
||||||
type: 'reConnect',
|
|
||||||
funx: async ()=> {
|
|
||||||
|
|
||||||
this.WsChatService.send(params).then(({message, requestId}) => {
|
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
|
||||||
let ChatMessage = message.result
|
|
||||||
this.messageSend = true
|
this.WsChatService.send(params).then(
|
||||||
this.redefinedMessage(ChatMessage)
|
(ChatMessage: any) => {
|
||||||
|
ChatMessage = ChatMessage.message.result
|
||||||
})
|
|
||||||
return true
|
this.messageSend = true
|
||||||
}
|
this.redefinedMessage(ChatMessage)
|
||||||
})
|
}
|
||||||
}
|
)
|
||||||
)
|
|
||||||
|
} else {
|
||||||
|
this.WsChatService.registerCallback({
|
||||||
|
type: 'reConnect',
|
||||||
|
funx: async ()=> {
|
||||||
|
|
||||||
|
this.send()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async redefinedMessage(ChatMessage , update = true) {
|
async redefinedMessage(ChatMessage , update = true) {
|
||||||
ChatMessage = this.NfService.fix_updatedAt(ChatMessage)
|
ChatMessage = this.NfService.fix_updatedAt(ChatMessage)
|
||||||
|
|
||||||
const message = this.getChatObj()
|
const message = this.getChatObj()
|
||||||
|
|
||||||
ChatMessage = Object.assign(message, ChatMessage)
|
ChatMessage = Object.assign(message, ChatMessage)
|
||||||
@@ -222,11 +223,37 @@ export class MessageService {
|
|||||||
await this.save()
|
await this.save()
|
||||||
}
|
}
|
||||||
|
|
||||||
async downloadFileMsg() {
|
downloadFileMsg() {
|
||||||
const result = await this.NfService.beforeSendAttachment(this)
|
|
||||||
if(result) {
|
|
||||||
|
|
||||||
}
|
let downloadFile = "";
|
||||||
|
this.AttachmentsService.downloadFile(this.file.guid).subscribe(async (event) => {
|
||||||
|
|
||||||
|
if (event.type === HttpEventType.DownloadProgress) {
|
||||||
|
|
||||||
|
} else if (event.type === HttpEventType.Response) {
|
||||||
|
if (this.file.type == "application/img") {
|
||||||
|
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
||||||
|
} else if (this.file.type === 'application/pdf') {
|
||||||
|
|
||||||
|
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
||||||
|
console.log(downloadFile)
|
||||||
|
} else if (this.file.type == 'application/audio') {
|
||||||
|
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.attachments[0] = {
|
||||||
|
image_url: downloadFile,
|
||||||
|
name: this.attachments[0].name,
|
||||||
|
title: this.attachments[0].title,
|
||||||
|
title_link: downloadFile,
|
||||||
|
title_link_download: this.attachments[0].title_link_download,
|
||||||
|
ts: this.attachments[0].ts
|
||||||
|
}
|
||||||
|
|
||||||
|
// save the changes to the storage
|
||||||
|
this.save()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,8 +268,7 @@ export class MessageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async delateDB() {
|
async delateDB() {
|
||||||
|
|
||||||
// alert('delete data')
|
|
||||||
const message = await MessageModel.get({_id: this._id})
|
const message = await MessageModel.get({_id: this._id})
|
||||||
await message.delete()
|
await message.delete()
|
||||||
|
|
||||||
@@ -261,8 +287,8 @@ export class MessageService {
|
|||||||
return {
|
return {
|
||||||
channels: this.channels,
|
channels: this.channels,
|
||||||
mentions: this.mentions,
|
mentions: this.mentions,
|
||||||
//msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.RochetChatUser),
|
//msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.RochetChatUser),
|
||||||
msg:this.msg,
|
msg:this.msg,
|
||||||
rid: this.rid,
|
rid: this.rid,
|
||||||
ts: this.ts,
|
ts: this.ts,
|
||||||
u: this.u,
|
u: this.u,
|
||||||
@@ -294,6 +320,7 @@ export class MessageService {
|
|||||||
|
|
||||||
async save() {
|
async save() {
|
||||||
const message = this.getChatObj()
|
const message = this.getChatObj()
|
||||||
|
console.log(message);
|
||||||
|
|
||||||
await MessageModel.update(message)
|
await MessageModel.update(message)
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import { ChatMethodsService } from './chat-methods.service'
|
|||||||
import { DeleteMessageModel, MessageModel } from '../../models/beast-orm'
|
import { DeleteMessageModel, MessageModel } from '../../models/beast-orm'
|
||||||
import { AESEncrypt } from '../aesencrypt.service'
|
import { AESEncrypt } from '../aesencrypt.service'
|
||||||
import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'src/app/models/message.model';
|
import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'src/app/models/message.model';
|
||||||
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
|
import { ConnectionStatus, NetworkServiceService} from 'src/app/services/network-service.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -75,18 +77,17 @@ export class RoomService {
|
|||||||
private NfService: NfService,
|
private NfService: NfService,
|
||||||
private ChatStorageService: ChatStorageService,
|
private ChatStorageService: ChatStorageService,
|
||||||
private ChatMethodsService: ChatMethodsService,
|
private ChatMethodsService: ChatMethodsService,
|
||||||
private AESEncrypt: AESEncrypt
|
private AESEncrypt: AESEncrypt,
|
||||||
|
private AttachmentsService: AttachmentsService,
|
||||||
|
private NetworkServiceService: NetworkServiceService
|
||||||
) {
|
) {
|
||||||
this.NativeNotificationService.askForPermission()
|
this.NativeNotificationService.askForPermission()
|
||||||
|
|
||||||
// this.restoreMessageFromDB()
|
|
||||||
|
|
||||||
this.WsChatService.getUserStatus((d) => {
|
this.WsChatService.getUserStatus((d) => {
|
||||||
|
|
||||||
const userId = d.fields.args[0][0]
|
const userId = d.fields.args[0][0]
|
||||||
const statusNum = d.fields.args[0][2]
|
const statusNum = d.fields.args[0][2]
|
||||||
const statusText = this.statusNumberToText(statusNum)
|
const statusText = this.statusNumberToText(statusNum)
|
||||||
//
|
|
||||||
|
|
||||||
if(this.members?.map) {
|
if(this.members?.map) {
|
||||||
const membersIds = this.members.map((user)=> user._id)
|
const membersIds = this.members.map((user)=> user._id)
|
||||||
@@ -143,7 +144,7 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setData({members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt), _updatedAt }) {
|
setData({members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), _updatedAt }) {
|
||||||
this.customFields = customFields
|
this.customFields = customFields
|
||||||
this.id = id
|
this.id = id
|
||||||
this.name = name
|
this.name = name
|
||||||
@@ -236,7 +237,6 @@ export class RoomService {
|
|||||||
|
|
||||||
const args = message.fields.args
|
const args = message.fields.args
|
||||||
|
|
||||||
// alert(JSON.stringify(args))
|
|
||||||
|
|
||||||
|
|
||||||
if (typeof args[1] != 'object') {
|
if (typeof args[1] != 'object') {
|
||||||
@@ -269,7 +269,12 @@ export class RoomService {
|
|||||||
|
|
||||||
|
|
||||||
getRoomMembersIds(): string[] {
|
getRoomMembersIds(): string[] {
|
||||||
return this.members.map((user)=> user._id)
|
try {
|
||||||
|
return this.members.map((user)=> user._id)
|
||||||
|
} catch(error) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getAllMemberThatIsNotOffline(): string[] {
|
getAllMemberThatIsNotOffline(): string[] {
|
||||||
@@ -337,7 +342,6 @@ export class RoomService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async receiveMessageDelete() {
|
async receiveMessageDelete() {
|
||||||
|
|
||||||
this.WsChatService.updateRoomEventss(
|
this.WsChatService.updateRoomEventss(
|
||||||
@@ -357,37 +361,42 @@ export class RoomService {
|
|||||||
* @description delete message in the view
|
* @description delete message in the view
|
||||||
* @param id message ID
|
* @param id message ID
|
||||||
*/
|
*/
|
||||||
async deleteMessage(id) {
|
async deleteMessage(_id) {
|
||||||
await this.messages.forEach(async(message, index) => {
|
|
||||||
if(message._id == id) {
|
const id = _id
|
||||||
|
|
||||||
this.messages.splice(index, 1)
|
|
||||||
|
|
||||||
|
|
||||||
if (SessionStore.user.RochetChatUser == message.u.username) {
|
for (let i =0; i <= this.messages.length; i++) {
|
||||||
|
|
||||||
|
if(this.messages[i]?._id == id ) {
|
||||||
|
|
||||||
|
|
||||||
|
if (SessionStore.user.RochetChatUser == this.messages[i]?.u?.username) {
|
||||||
const allMemberThatIsOffline = this.getAllMemberThatIsOffline()
|
const allMemberThatIsOffline = this.getAllMemberThatIsOffline()
|
||||||
|
|
||||||
await DeleteMessageModel.create({
|
DeleteMessageModel.create({
|
||||||
messageId: message._id,
|
messageId: this.messages[i]._id,
|
||||||
rid: message.rid,
|
rid: this.messages[i].rid,
|
||||||
ts: message.ts,
|
ts: this.messages[i].ts,
|
||||||
u: message.u,
|
u: this.messages[i].u,
|
||||||
needToReceiveBy: allMemberThatIsOffline
|
needToReceiveBy: allMemberThatIsOffline
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
message.delateStatusFalse()
|
this.messages[i]?.delateDB()
|
||||||
message.delateDB()
|
this.messages.splice(i, 1)
|
||||||
|
|
||||||
//Get previous last message from room
|
//Get previous last message from room
|
||||||
const previousLastMessage = this.messages.slice(-1)[0];
|
const previousLastMessage = this.messages.slice(-1)[0];
|
||||||
|
|
||||||
this.lastMessage = previousLastMessage;
|
this.lastMessage = previousLastMessage;
|
||||||
this.calDateDuration(previousLastMessage._updatedAt)
|
this.calDateDuration(previousLastMessage._updatedAt)
|
||||||
this.sortRoomList()
|
this.sortRoomList()
|
||||||
|
|
||||||
|
return true
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// console.log(_id,'==',this.messages[i]?._id, false)
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,39 +420,31 @@ export class RoomService {
|
|||||||
|
|
||||||
async sendDeleteRequest(msgId) {
|
async sendDeleteRequest(msgId) {
|
||||||
|
|
||||||
const message = this.messages.find((e)=>e._id = msgId)
|
const message = this.messages.find((e)=>e._id == msgId)
|
||||||
message.delateStatusFalse()
|
await message.delateStatusFalse()
|
||||||
|
|
||||||
this.ChatMethodsService.deleteMessage({_id:msgId, msgId:msgId, roomId:message.rid}).subscribe(
|
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
|
||||||
(response: any) => {
|
|
||||||
|
this.WsChatService.deleteMessage(msgId).then(async() => {
|
||||||
message.delateRequest = true
|
message.delateRequest = true
|
||||||
message.save()
|
await message.save()
|
||||||
this.deleteMessage(msgId)
|
this.deleteMessage(msgId)
|
||||||
},
|
})
|
||||||
(response) => {
|
|
||||||
|
|
||||||
if (response.error.error.startsWith('No message found with the id of')) {
|
} else {
|
||||||
// alert('not found')
|
this.WsChatService.registerCallback({
|
||||||
this.deleteMessage(msgId)
|
type: 'reConnect',
|
||||||
} else {
|
funx: async ()=> {
|
||||||
// this.deleteMessage(DeletedMessageId)
|
|
||||||
this.WsChatService.registerCallback({
|
this.sendDeleteRequest(msgId)
|
||||||
type: 'reConnect',
|
return true
|
||||||
funx: async ()=> {
|
|
||||||
|
|
||||||
this.sendDeleteRequest(msgId)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description sen text message
|
* @description sen text message
|
||||||
*/
|
*/
|
||||||
@@ -610,7 +611,7 @@ export class RoomService {
|
|||||||
|
|
||||||
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
||||||
|
|
||||||
console.log('load chatHistory', JSON.stringify(chatHistory))
|
// console.log('load chatHistory', JSON.stringify(chatHistory))
|
||||||
|
|
||||||
const messagesId = this.messages.map((message)=> message._id)
|
const messagesId = this.messages.map((message)=> message._id)
|
||||||
|
|
||||||
@@ -666,7 +667,7 @@ export class RoomService {
|
|||||||
message = this.fix_updatedAt(message)
|
message = this.fix_updatedAt(message)
|
||||||
|
|
||||||
|
|
||||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt)
|
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||||
wewMessage.setData(message)
|
wewMessage.setData(message)
|
||||||
wewMessage.loadHistory = this.hasLoadHistory
|
wewMessage.loadHistory = this.hasLoadHistory
|
||||||
|
|
||||||
@@ -694,8 +695,6 @@ export class RoomService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async ChatMessageIsPresentInTheView(ChatMessage:ChatMessageInterface) {
|
async ChatMessageIsPresentInTheView(ChatMessage:ChatMessageInterface) {
|
||||||
let foundIndex;
|
let foundIndex;
|
||||||
|
|
||||||
@@ -725,7 +724,7 @@ export class RoomService {
|
|||||||
async prepareCreate({message, save = true}): Promise<MessageService> {
|
async prepareCreate({message, save = true}): Promise<MessageService> {
|
||||||
message = this.fix_updatedAt(message)
|
message = this.fix_updatedAt(message)
|
||||||
|
|
||||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt)
|
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||||
wewMessage.setData(message)
|
wewMessage.setData(message)
|
||||||
wewMessage.loadHistory = this.hasLoadHistory
|
wewMessage.loadHistory = this.hasLoadHistory
|
||||||
|
|
||||||
@@ -737,7 +736,7 @@ export class RoomService {
|
|||||||
|
|
||||||
simplePrepareMessage(message) {
|
simplePrepareMessage(message) {
|
||||||
message = this.fix_updatedAt(message)
|
message = this.fix_updatedAt(message)
|
||||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt)
|
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||||
wewMessage.setData(message)
|
wewMessage.setData(message)
|
||||||
wewMessage.loadHistory = this.hasLoadHistory
|
wewMessage.loadHistory = this.hasLoadHistory
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import { AuthService } from '../auth.service';
|
|||||||
import { ChatStorageService } from './chat-storage.service'
|
import { ChatStorageService } from './chat-storage.service'
|
||||||
import { ChatMethodsService } from './chat-methods.service'
|
import { ChatMethodsService } from './chat-methods.service'
|
||||||
import { AESEncrypt } from '../aesencrypt.service'
|
import { AESEncrypt } from '../aesencrypt.service'
|
||||||
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
|
import { NetworkServiceService} from 'src/app/services/network-service.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -55,7 +57,9 @@ export class WsChatMethodsService {
|
|||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private ChatStorageService: ChatStorageService,
|
private ChatStorageService: ChatStorageService,
|
||||||
private ChatMethodsService:ChatMethodsService,
|
private ChatMethodsService:ChatMethodsService,
|
||||||
private AESEncrypt: AESEncrypt
|
private AESEncrypt: AESEncrypt,
|
||||||
|
private AttachmentsService:AttachmentsService,
|
||||||
|
private NetworkServiceService: NetworkServiceService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||||
@@ -158,7 +162,10 @@ export class WsChatMethodsService {
|
|||||||
|
|
||||||
} catch(e){}
|
} catch(e){}
|
||||||
|
|
||||||
this.sortRoomList()
|
setTimeout(()=>{
|
||||||
|
this.sortRoomList()
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAllRooms () {
|
async getAllRooms () {
|
||||||
@@ -202,7 +209,11 @@ export class WsChatMethodsService {
|
|||||||
console.log('save rooms', rooms)
|
console.log('save rooms', rooms)
|
||||||
await this.storage.set('Rooms', rooms);
|
await this.storage.set('Rooms', rooms);
|
||||||
|
|
||||||
this.sortRoomList()
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.sortRoomList()
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
this.loadingWholeList = false
|
this.loadingWholeList = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,7 +316,7 @@ export class WsChatMethodsService {
|
|||||||
|
|
||||||
// create room
|
// create room
|
||||||
if(!this.roomExist(roomId)) {
|
if(!this.roomExist(roomId)) {
|
||||||
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt)
|
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||||
room.setData(setData)
|
room.setData(setData)
|
||||||
room.receiveMessage()
|
room.receiveMessage()
|
||||||
room.getAllUsers = this.getUsers
|
room.getAllUsers = this.getUsers
|
||||||
|
|||||||
@@ -728,7 +728,7 @@ export class WsChatService {
|
|||||||
this.wsMsgQueue[requestId] = {message, requestId, loginRequired}
|
this.wsMsgQueue[requestId] = {message, requestId, loginRequired}
|
||||||
} else {
|
} else {
|
||||||
let messageStr = JSON.stringify(message)
|
let messageStr = JSON.stringify(message)
|
||||||
console.log('messageStr', messageStr)
|
// console.log('messageStr', messageStr)
|
||||||
|
|
||||||
this.socket.send(messageStr)
|
this.socket.send(messageStr)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { InitialsService } from './initials.service';
|
||||||
|
|
||||||
|
describe('InitialsService', () => {
|
||||||
|
let service: InitialsService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(InitialsService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class InitialsService {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
getInitials(name:string){
|
||||||
|
let names = name.split(' '),
|
||||||
|
initials = names[0].substring(0, 1).toUpperCase();
|
||||||
|
if (names.length > 1) {
|
||||||
|
initials += names[names.length - 1].substring(0, 1).toUpperCase();
|
||||||
|
}
|
||||||
|
return initials;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { NetworkServiceService } from './network-service.service';
|
||||||
|
|
||||||
|
describe('NetworkServiceService', () => {
|
||||||
|
let service: NetworkServiceService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(NetworkServiceService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { ToastController, Platform } from '@ionic/angular';
|
||||||
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
|
import { Network } from '@ionic-native/network/ngx'
|
||||||
|
|
||||||
|
|
||||||
|
export enum ConnectionStatus {
|
||||||
|
Online,
|
||||||
|
Offline
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class NetworkServiceService {
|
||||||
|
private status: BehaviorSubject<ConnectionStatus> = new BehaviorSubject(ConnectionStatus.Offline);
|
||||||
|
|
||||||
|
constructor(private network: Network, private toastController: ToastController, private plt: Platform) {
|
||||||
|
this.plt.ready().then(() => {
|
||||||
|
this.initializeNetworkEvents();
|
||||||
|
let status = this.network.type !== 'none' ? ConnectionStatus.Online : ConnectionStatus.Offline;
|
||||||
|
this.status.next(status);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public initializeNetworkEvents() {
|
||||||
|
|
||||||
|
this.network.onDisconnect().subscribe(() => {
|
||||||
|
if (this.status.getValue() === ConnectionStatus.Online) {
|
||||||
|
this.updateNetworkStatus(ConnectionStatus.Offline);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.network.onConnect().subscribe(() => {
|
||||||
|
if (this.status.getValue() === ConnectionStatus.Offline) {
|
||||||
|
this.updateNetworkStatus(ConnectionStatus.Online);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async updateNetworkStatus(status: ConnectionStatus) {
|
||||||
|
this.status.next(status);
|
||||||
|
|
||||||
|
let connection = status == ConnectionStatus.Offline ? 'Offline' : 'Online';
|
||||||
|
let toast = this.toastController.create({
|
||||||
|
message: `You are now ${connection}`,
|
||||||
|
duration: 3000,
|
||||||
|
position: 'bottom'
|
||||||
|
});
|
||||||
|
toast.then(toast => toast.present());
|
||||||
|
}
|
||||||
|
|
||||||
|
public onNetworkChange(): Observable<ConnectionStatus> {
|
||||||
|
return this.status.asObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public getCurrentNetworkStatus(): ConnectionStatus {
|
||||||
|
return this.status.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -86,86 +86,86 @@ export class NotificationsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
requestPermissions() {
|
requestPermissions() {
|
||||||
// PushNotifications.requestPermissions().then(result => {
|
PushNotifications.requestPermissions().then(result => {
|
||||||
// if (result.receive === 'granted') {
|
if (result.receive === 'granted') {
|
||||||
// // Register with Apple / Google to receive push via APNS/FCM
|
// Register with Apple / Google to receive push via APNS/FCM
|
||||||
// PushNotifications.register();
|
PushNotifications.register();
|
||||||
// } else {
|
} else {
|
||||||
// // Show some error
|
// Show some error
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getAndpostToken(username) {
|
getAndpostToken(username) {
|
||||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
// console.log('Notifications not supported')
|
console.log('Notifications not supported')
|
||||||
// } else {
|
} else {
|
||||||
// const geturl = environment.apiURL + 'notifications/token';
|
const geturl = environment.apiURL + 'notifications/token';
|
||||||
// PushNotifications.addListener('registration',
|
PushNotifications.addListener('registration',
|
||||||
// (token: Token) => {
|
(token: Token) => {
|
||||||
// console.log('token: ', token.value)
|
console.log('token: ', token.value)
|
||||||
// this.storageService.store(username, token.value);
|
this.storageService.store(username, token.value);
|
||||||
// this.storageService.get(username).then(value => {
|
this.storageService.get(username).then(value => {
|
||||||
// console.log('STORAGE TOKEN', value)
|
console.log('STORAGE TOKEN', value)
|
||||||
// this.storageService.get(AuthConnstants.USER).then(res => {
|
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||||
// console.log('USERID', res);
|
console.log('USERID', res);
|
||||||
// const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||||
// const body = {
|
const body = {
|
||||||
// UserId: res.UserId,
|
UserId: res.UserId,
|
||||||
// TokenId: token.value,
|
TokenId: token.value,
|
||||||
// Status: 1,
|
Status: 1,
|
||||||
// Service: 1
|
Service: 1
|
||||||
// };
|
};
|
||||||
|
|
||||||
// this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||||
// console.log('TOKEN USER MIDLE', data);
|
console.log('TOKEN USER MIDLE', data);
|
||||||
// }, (error) => {
|
}, (error) => {
|
||||||
// console.log('Post token to backend', error)
|
console.log('Post token to backend', error)
|
||||||
// })
|
})
|
||||||
// });
|
});
|
||||||
|
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
registrationError() {
|
registrationError() {
|
||||||
// PushNotifications.addListener('registrationError',
|
PushNotifications.addListener('registrationError',
|
||||||
// (error: any) => {
|
(error: any) => {
|
||||||
// console.log('Error on registration: ' + JSON.stringify(error));
|
console.log('Error on registration: ' + JSON.stringify(error));
|
||||||
// }
|
}
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onReciveForeground() {
|
onReciveForeground() {
|
||||||
// PushNotifications.addListener('pushNotificationReceived',
|
PushNotifications.addListener('pushNotificationReceived',
|
||||||
// (notification: PushNotificationSchema) => {
|
(notification: PushNotificationSchema) => {
|
||||||
// console.log('Push received: ' + JSON.stringify(notification));
|
console.log('Push received: ' + JSON.stringify(notification));
|
||||||
// this.DataArray.push(notification)
|
this.DataArray.push(notification)
|
||||||
// console.log("On ReceiveNotification", this.DataArray)
|
console.log("On ReceiveNotification", this.DataArray)
|
||||||
// this.storageService.store("Notifications", this.DataArray)
|
this.storageService.store("Notifications", this.DataArray)
|
||||||
// this.eventtrigger.publishSomeData({
|
this.eventtrigger.publishSomeData({
|
||||||
// notification: "recive"
|
notification: "recive"
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onReciveBackground() {
|
onReciveBackground() {
|
||||||
// PushNotifications.addListener('pushNotificationActionPerformed',
|
PushNotifications.addListener('pushNotificationActionPerformed',
|
||||||
// (notification: ActionPerformed) => {
|
(notification: ActionPerformed) => {
|
||||||
// console.log('Push action performed: ' + JSON.stringify(notification));
|
console.log('Push action performed: ' + JSON.stringify(notification));
|
||||||
// /* this.DataArray.push(notification.notification)
|
/* this.DataArray.push(notification.notification)
|
||||||
// console.log("On ReceiveNotification", this.DataArray)
|
console.log("On ReceiveNotification", this.DataArray)
|
||||||
// this.storageService.store("Notifications", this.DataArray)
|
this.storageService.store("Notifications", this.DataArray)
|
||||||
// this.eventtrigger.publishSomeData({
|
this.eventtrigger.publishSomeData({
|
||||||
// notification: "recive"
|
notification: "recive"
|
||||||
// }) */
|
}) */
|
||||||
// this.notificatinsRoutes(notification)
|
this.notificatinsRoutes(notification)
|
||||||
// }
|
}
|
||||||
// );
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
tempClearArray() {
|
tempClearArray() {
|
||||||
@@ -175,51 +175,51 @@ export class NotificationsService {
|
|||||||
|
|
||||||
notificatinsRoutes = (notification) => {
|
notificatinsRoutes = (notification) => {
|
||||||
|
|
||||||
// console.log('Push action performed 2222: ' + JSON.stringify(notification.data));
|
console.log('Push action performed 2222: ' + JSON.stringify(notification.data));
|
||||||
|
|
||||||
// if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
|
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
|
||||||
// console.log("Id Lenght", notification.notification.data.IdObject.length)
|
console.log("Id Lenght", notification.notification.data.IdObject.length)
|
||||||
// this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda']));
|
this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda']));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") {
|
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") {
|
||||||
// this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") {
|
else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") {
|
||||||
// //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda']));
|
//this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda']));
|
||||||
// this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda']));
|
this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda']));
|
||||||
|
|
||||||
// } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") {
|
} else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") {
|
||||||
|
|
||||||
// this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true }));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true }));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") {
|
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") {
|
||||||
|
|
||||||
// this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") {
|
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") {
|
||||||
|
|
||||||
// this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") {
|
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") {
|
||||||
|
|
||||||
// this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") {
|
else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") {
|
||||||
// this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject]));
|
this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject]));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") {
|
else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") {
|
||||||
// this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject]));
|
this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject]));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") {
|
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") {
|
||||||
// this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") {
|
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") {
|
||||||
|
|
||||||
// this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||||
// }
|
}
|
||||||
// else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") {
|
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") {
|
||||||
// this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
|
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { PermissionService } from './worker/permission.service';
|
import { PermissionService } from './permission.service';
|
||||||
|
|
||||||
describe('PermissionService', () => {
|
describe('PermissionService', () => {
|
||||||
let service: PermissionService;
|
let service: PermissionService;
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { PermissionList } from '../models/permission/permissionList';
|
||||||
|
import { SessionStore } from '../store/session.service';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class PermissionService {
|
||||||
|
|
||||||
|
permissionList = new PermissionList();
|
||||||
|
SessionStore = SessionStore
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
userRole(args) {
|
||||||
|
|
||||||
|
if(!Array.isArray(args)) {
|
||||||
|
args = [args]
|
||||||
|
}
|
||||||
|
|
||||||
|
return args.includes(this.SessionStore.user.Profile)
|
||||||
|
}
|
||||||
|
|
||||||
|
userPermission(args) {
|
||||||
|
if(!Array.isArray(args)) {
|
||||||
|
args = [args]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for(let permission of (this.SessionStore.user.UserPermissions || [])) {
|
||||||
|
if (args.includes(permission)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
role(args: any) {
|
||||||
|
|
||||||
|
let UserRoleIsValid = this.userRole(args)
|
||||||
|
|
||||||
|
return {
|
||||||
|
permissionAnyOf(role) {
|
||||||
|
|
||||||
|
if(!Array.isArray(role)) {
|
||||||
|
role = [role]
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!UserRoleIsValid) { return false }
|
||||||
|
|
||||||
|
return true
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AttachmentsService } from '../attachments.service';
|
import { AttachmentsService } from '../attachments.service';
|
||||||
import { EventsService } from '../events.service';
|
import { EventsService } from '../events.service';
|
||||||
import { PermissionService } from '../worker/permission.service';
|
import { PermissionService } from '../permission.service';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ export class EventService {
|
|||||||
|
|
||||||
|
|
||||||
create({body, calendar}) {
|
create({body, calendar}) {
|
||||||
|
|
||||||
|
|
||||||
if(this.p.userRole(['PR'])) {
|
if(this.p.userRole(['PR'])) {
|
||||||
return this.eventService.postEventPr(body, calendar)
|
return this.eventService.postEventPr(body, calendar)
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { SessionStore } from '../../store/session.service';
|
|
||||||
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class PermissionService {
|
|
||||||
|
|
||||||
SessionStore = SessionStore
|
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
userRole(args) {
|
|
||||||
|
|
||||||
if(!Array.isArray(args)) {
|
|
||||||
args = [args]
|
|
||||||
}
|
|
||||||
|
|
||||||
return args.includes(this.SessionStore.user.Profile)
|
|
||||||
}
|
|
||||||
|
|
||||||
role(args: any) {
|
|
||||||
|
|
||||||
let UserRoleIsValid = this.userRole(args)
|
|
||||||
|
|
||||||
return {
|
|
||||||
permissionAnyOf(role) {
|
|
||||||
|
|
||||||
if(!Array.isArray(role)) {
|
|
||||||
role = [role]
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!UserRoleIsValid) {return false }
|
|
||||||
|
|
||||||
return true
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -60,66 +60,75 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="msg.file && msg.delate == false">
|
<div *ngIf="msg.file">
|
||||||
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.file.type != 'application/meeting'" >
|
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.file.type != 'application/meeting'" >
|
||||||
<div *ngIf="msg.file.type != 'application/meeting'">
|
<div *ngIf="msg.file.type != 'application/meeting'">
|
||||||
<div class="message-item-options d-flex justify-content-end">
|
<div class="message-item-options d-flex justify-content-end">
|
||||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
||||||
<mat-menu #beforeMenu="matMenu" xPosition="before">
|
<mat-menu #beforeMenu="matMenu" xPosition="before">
|
||||||
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
|
<button (click)="deleteMessage(msg._id)" class="menuButton">Apagar mensagem</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<ion-label>{{msg.u.name}}</ion-label>
|
<ion-label>{{msg.u.name}}</ion-label>
|
||||||
<span class="time">{{msg.duration}}</span>
|
<span class="time">{{msg.duration}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="message">
|
<div class="message">
|
||||||
<div *ngIf="msg.attachments" class="message-attachments">
|
<div *ngIf="msg.attachments" class="message-attachments">
|
||||||
<div *ngFor="let file of msg.attachments">
|
<div *ngFor="let file of msg.attachments">
|
||||||
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)">
|
<div *ngIf="msg.file.type == 'application/img' && !msg.attachments[0].image_url">
|
||||||
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
|
NOT UPLOADED
|
||||||
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
</div>
|
||||||
</div>
|
<div *ngIf="msg.file.type == 'application/img' &&
|
||||||
<div *ngIf="msg.file.type != 'application/img'">
|
msg.attachments[0].image_url" (click)="openPreview(msg)">
|
||||||
<div *ngIf="msg.file.type != 'application/audio'" class="file add-attachment-bg-color">
|
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
|
||||||
<div (click)="openPreview(msg)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
||||||
<span *ngIf="msg.file.type">
|
</div>
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
<div *ngIf="msg.file.type != 'application/img'">
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
<div *ngIf="msg.file.type != 'application/audio'" class="file add-attachment-bg-color">
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
|
<div (click)="openPreview(msg)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
||||||
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
<span *ngIf="msg.file.type">
|
||||||
</span>
|
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||||
<ion-label class="file-title">{{file.title}}</ion-label>
|
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
|
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
|
||||||
|
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||||
|
</span>
|
||||||
|
<ion-label class="file-title">{{file.title}}</ion-label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div (click)="audioPreview(msg)" class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && !file.title_link">
|
||||||
|
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||||
|
<ion-icon name="mic-outline" class="file-icon"></ion-icon>
|
||||||
|
<ion-label>{{file.title}}</ion-label>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
</ion-item>
|
||||||
|
</div>
|
||||||
|
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
|
||||||
|
<audio [src]="file.title_link|safehtml" preload="metadata" controls controlsList="nodownload noplaybackrate"></audio>
|
||||||
|
</div>
|
||||||
|
<div class="file-details-optional add-attachment-bg-color">
|
||||||
|
<ion-label *ngIf="msg.file">
|
||||||
|
<span *ngIf="file.description">{{file.description}}</span>
|
||||||
|
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
||||||
|
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
||||||
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio'">
|
|
||||||
<audio [src]="file.title_link|safehtml" preload="metadata" controls controlsList="nodownload noplaybackrate"></audio>
|
|
||||||
</div>
|
|
||||||
<div class="file-details-optional add-attachment-bg-color">
|
|
||||||
<ion-label *ngIf="msg.file">
|
|
||||||
<span *ngIf="file.description">{{file.description}}</span>
|
|
||||||
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
|
||||||
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
|
||||||
</ion-label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
{{last ? scrollToBottom() : ''}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||||
|
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||||
|
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||||
|
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
||||||
|
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
|
||||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
|
||||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
|
||||||
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
|
||||||
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="msg.file && msg.delate == true">
|
|
||||||
Apagou a mensagem
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="msg.t == 'r'" class="info-text">
|
<div *ngIf="msg.t == 'r'" class="info-text">
|
||||||
<ion-label>Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
<ion-label>Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
allowTyping = true;
|
allowTyping = true;
|
||||||
storedFileNames = [];
|
storedFileNames = [];
|
||||||
lastAudioRecorded = '';
|
lastAudioRecorded = '';
|
||||||
audioRecorded:any = "";
|
audioRecorded: any = "";
|
||||||
audioDownloaded:any = "";
|
audioDownloaded: any = "";
|
||||||
durationDisplay = '';
|
durationDisplay = '';
|
||||||
duration = 0;
|
duration = 0;
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
|
|
||||||
this.showAvatar = false
|
this.showAvatar = false
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
this.scrollToBottomClicked()
|
this.scrollToBottomClicked()
|
||||||
this.showAvatar = true
|
this.showAvatar = true
|
||||||
}, 50)
|
}, 50)
|
||||||
@@ -152,10 +152,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
console.log(this.roomId);
|
|
||||||
this.loggedUser = this.loggedUserChat;
|
this.loggedUser = this.loggedUserChat;
|
||||||
|
|
||||||
this.loggedUser=this.loggedUserChat;
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.getRoomInfo();
|
this.getRoomInfo();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -263,7 +260,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFile(fileName?:any){
|
async getFile(fileName?: any) {
|
||||||
const audioFile = await Filesystem.readFile({
|
const audioFile = await Filesystem.readFile({
|
||||||
path: fileName,
|
path: fileName,
|
||||||
directory: Directory.Data
|
directory: Directory.Data
|
||||||
@@ -274,20 +271,23 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadFiles() {
|
async loadFiles() {
|
||||||
|
try {
|
||||||
|
this.storage.get('fileName').then((fileName) => {
|
||||||
|
this.lastAudioRecorded = fileName;
|
||||||
|
})
|
||||||
|
|
||||||
|
this.storage.get('recordData').then((recordData) => {
|
||||||
|
console.log(recordData);
|
||||||
|
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||||
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) { }
|
||||||
|
|
||||||
this.storage.get('fileName').then((fileName) => {
|
|
||||||
this.lastAudioRecorded = fileName;
|
|
||||||
})
|
|
||||||
|
|
||||||
this.storage.get('recordData').then((recordData) => {
|
|
||||||
console.log(recordData);
|
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
startRecording() {
|
startRecording() {
|
||||||
@@ -317,8 +317,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
//console.log(recordData);
|
//console.log(recordData);
|
||||||
const fileName = new Date().getTime() + ".mp3";
|
const fileName = new Date().getTime() + ".mp3";
|
||||||
//Save file
|
//Save file
|
||||||
this.storage.set('fileName',fileName);
|
this.storage.set('fileName', fileName);
|
||||||
this.storage.set('recordData',result).then(() => {
|
this.storage.set('recordData', result).then(() => {
|
||||||
console.log('Audio recorded saved');
|
console.log('Audio recorded saved');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -328,7 +328,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteRecording(){
|
async deleteRecording() {
|
||||||
this.storage.remove('fileName');
|
this.storage.remove('fileName');
|
||||||
this.storage.remove('recordData');
|
this.storage.remove('recordData');
|
||||||
|
|
||||||
@@ -417,41 +417,64 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
this.wsChatMethodsService.getGroupRoom(this.roomId).send({})
|
this.wsChatMethodsService.getGroupRoom(this.roomId).send({})
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendAudio(fileName) {
|
base64toBlob(base64Data, contentType) {
|
||||||
|
contentType = contentType || '';
|
||||||
|
var sliceSize = 1024;
|
||||||
|
var byteCharacters = atob(base64Data);
|
||||||
|
var bytesLength = byteCharacters.length;
|
||||||
|
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||||
|
var byteArrays = new Array(slicesCount);
|
||||||
|
|
||||||
|
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||||
|
var begin = sliceIndex * sliceSize;
|
||||||
|
var end = Math.min(begin + sliceSize, bytesLength);
|
||||||
|
|
||||||
|
var bytes = new Array(end - begin);
|
||||||
|
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||||
|
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||||
|
}
|
||||||
|
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||||
|
}
|
||||||
|
return new Blob(byteArrays, { type: contentType });
|
||||||
|
}
|
||||||
|
|
||||||
|
async sendAudio(fileName) {
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
let audioFile;
|
||||||
this.storage.get('recordData').then((recordData) => {
|
this.storage.get('recordData').then((recordData) => {
|
||||||
console.log(recordData);
|
console.log(recordData);
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
audioFile = recordData;
|
||||||
this.audioRecorded = recordData.value.recordDataBase64;
|
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||||
|
this.audioRecorded = recordData?.value?.recordDataBase64;
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Converting base64 to blob
|
||||||
|
const encodedData = btoa(this.audioRecorded);
|
||||||
|
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||||
|
console.log(blob)
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("blobFile", blob);
|
||||||
|
|
||||||
|
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||||
|
file: {
|
||||||
|
"type": "application/audio",
|
||||||
|
"msDuration": audioFile.value.msDuration,
|
||||||
|
"mimeType": audioFile.value.mimeType,
|
||||||
|
},
|
||||||
|
attachments: [{
|
||||||
|
"title": fileName,
|
||||||
|
"title_link_download": true,
|
||||||
|
"type": "audio"
|
||||||
|
}],
|
||||||
|
temporaryData: formData
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Converting base64 to blob
|
|
||||||
const base64Response = await fetch(this.audioRecorded);
|
|
||||||
const blob = await base64Response.blob();
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("blobFile", blob);
|
|
||||||
|
|
||||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
|
||||||
file: {
|
|
||||||
"type": "application/audio",
|
|
||||||
/* "guid": '', */
|
|
||||||
},
|
|
||||||
attachments: [{
|
|
||||||
"title": fileName ,
|
|
||||||
"title_link": this.audioRecorded,
|
|
||||||
"title_link_download": true,
|
|
||||||
"type": "file"
|
|
||||||
}],
|
|
||||||
temporaryData: formData
|
|
||||||
})
|
|
||||||
this.deleteRecording();
|
this.deleteRecording();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMessage(msgId: string) {
|
deleteMessage(msgId: string) {
|
||||||
@@ -701,7 +724,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
//const imageData = await this.fileToBase64Service.convert(file)
|
//const imageData = await this.fileToBase64Service.convert(file)
|
||||||
//console.log('ADDFILECHAT', imageData)
|
//console.log('ADDFILECHAT', imageData)
|
||||||
|
|
||||||
const response = await fetch('data:image/jpeg;base64,'+ file.base64String!);
|
const response = await fetch('data:image/jpeg;base64,' + file.base64String!);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
@@ -714,8 +737,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
},
|
},
|
||||||
temporaryData: formData,
|
temporaryData: formData,
|
||||||
attachments: [{
|
attachments: [{
|
||||||
"title": file.path ,
|
"title": file.path,
|
||||||
"image_url": 'data:image/jpeg;base64,' +file.base64String,
|
"image_url": 'data:image/jpeg;base64,' + file.base64String,
|
||||||
"text": "description",
|
"text": "description",
|
||||||
"title_link_download": false,
|
"title_link_download": false,
|
||||||
}]
|
}]
|
||||||
@@ -729,7 +752,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
const image = await this.CameraService.takePicture();
|
const image = await this.CameraService.takePicture();
|
||||||
await this.fileService.saveImage(image)
|
await this.fileService.saveImage(image)
|
||||||
const lastphoto: any = await this.fileService.loadFiles();
|
const lastphoto: any = await this.fileService.loadFiles();
|
||||||
const { capturedImage, capturedImageTitle} = await this.fileService.loadFileData(lastphoto);
|
const { capturedImage, capturedImageTitle } = await this.fileService.loadFileData(lastphoto);
|
||||||
|
|
||||||
const base64 = await fetch(capturedImage);
|
const base64 = await fetch(capturedImage);
|
||||||
const blob = await base64.blob();
|
const blob = await base64.blob();
|
||||||
@@ -742,7 +765,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
"guid": ''
|
"guid": ''
|
||||||
},
|
},
|
||||||
attachments: [{
|
attachments: [{
|
||||||
"title": capturedImageTitle ,
|
"title": capturedImageTitle,
|
||||||
"image_url": capturedImage,
|
"image_url": capturedImage,
|
||||||
"text": "description",
|
"text": "description",
|
||||||
"title_link_download": false,
|
"title_link_download": false,
|
||||||
@@ -773,13 +796,13 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then(async res=>{
|
modal.onDidDismiss().then(async res => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
|
|
||||||
if(data.selected) {
|
if (data.selected) {
|
||||||
|
|
||||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||||
file:{
|
file: {
|
||||||
"name": res.data.selected.Assunto,
|
"name": res.data.selected.Assunto,
|
||||||
"type": "application/webtrix",
|
"type": "application/webtrix",
|
||||||
"ApplicationId": res.data.selected.ApplicationType,
|
"ApplicationId": res.data.selected.ApplicationType,
|
||||||
@@ -805,7 +828,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async addFileToChatMobile(types: typeof FileType[] ) {
|
async addFileToChatMobile(types: typeof FileType[]) {
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
|
||||||
const file = await Camera.getPhoto({
|
const file = await Camera.getPhoto({
|
||||||
@@ -818,7 +841,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
//const imageData = await this.fileToBase64Service.convert(file)
|
//const imageData = await this.fileToBase64Service.convert(file)
|
||||||
//console.log('ADDFILECHAT', imageData)
|
//console.log('ADDFILECHAT', imageData)
|
||||||
|
|
||||||
const response = await fetch('data:image/jpeg;base64,'+ file.base64String!);
|
const response = await fetch('data:image/jpeg;base64,' + file.base64String!);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
@@ -831,8 +854,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
},
|
},
|
||||||
temporaryData: formData,
|
temporaryData: formData,
|
||||||
attachments: [{
|
attachments: [{
|
||||||
"title": file.path ,
|
"title": file.path,
|
||||||
"image_url": 'data:image/jpeg;base64,' +file.base64String,
|
"image_url": 'data:image/jpeg;base64,' + file.base64String,
|
||||||
"text": "description",
|
"text": "description",
|
||||||
"title_link_download": false,
|
"title_link_download": false,
|
||||||
}]
|
}]
|
||||||
@@ -841,39 +864,38 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async addFileToChat(types: typeof FileType[] ) {
|
async addFileToChat(types: typeof FileType[]) {
|
||||||
|
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
|
||||||
const file: any = await this.fileService.getFileFromDevice(types);
|
const file: any = await this.fileService.getFileFromDevice(types);
|
||||||
console.log('Add file', file)
|
console.log('Add file', file)
|
||||||
/* const imageData = await this.fileToBase64Service.convert(file).then((filee) => {
|
|
||||||
console.log('Add file', filee)
|
|
||||||
}) */
|
|
||||||
const blob = new Blob([file],{type: file.type})
|
|
||||||
console.log('Add file', blob)
|
|
||||||
|
|
||||||
const formData = new FormData();
|
if (file.type == "application/pdf") {
|
||||||
formData.append("blobFile", blob);
|
|
||||||
|
const blob = new Blob([file], { type: file.type })
|
||||||
|
console.log('Add file', blob)
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("blobFile", blob);
|
||||||
|
|
||||||
let pdfBase64;
|
|
||||||
this.blobToBase64(blob).then(res => {
|
|
||||||
console.log('Base64 pdf', res);
|
|
||||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||||
file: {
|
file: {
|
||||||
"type": file.type,
|
"type": file.type,
|
||||||
"guid": '',
|
"guid": '',
|
||||||
},
|
},
|
||||||
attachments: [{
|
attachments: [{
|
||||||
"title": file.name ,
|
"title": file.name,
|
||||||
"name": file.name ,
|
"name": file.name,
|
||||||
"image_url": res,
|
/* "image_url": res, */
|
||||||
// "text": "description",
|
// "text": "description",
|
||||||
"title_link_download": false,
|
"title_link_download": false,
|
||||||
}],
|
}],
|
||||||
temporaryData: formData
|
temporaryData: formData
|
||||||
})
|
})
|
||||||
});
|
} else {
|
||||||
|
console.log('File type invalid')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -932,7 +954,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then( async (res) => {
|
modal.onDidDismiss().then(async (res) => {
|
||||||
console.log(res['data']);
|
console.log(res['data']);
|
||||||
const roomId = this.roomId;
|
const roomId = this.roomId;
|
||||||
|
|
||||||
@@ -971,54 +993,24 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
|
|
||||||
|
|
||||||
downloadFileMsg(msg: MessageService) {
|
downloadFileMsg(msg: MessageService) {
|
||||||
console.log('FILE TYPE', msg.file.type)
|
msg.downloadFileMsg()
|
||||||
this.downloadFile = "";
|
|
||||||
if (msg.file.type == "application/img") {
|
|
||||||
this.AttachmentsService.downloadFile(msg.file.guid).subscribe(async (event) => {
|
|
||||||
console.log('FILE TYPE 22', msg.file.guid)
|
|
||||||
var name = msg.file.guid;
|
|
||||||
|
|
||||||
if (event.type === HttpEventType.DownloadProgress) {
|
|
||||||
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
|
||||||
console.log('FILE TYPE 33', msg.file.type)
|
|
||||||
} else if (event.type === HttpEventType.Response) {
|
|
||||||
if (msg.file.type == "application/img") {
|
|
||||||
this.downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
|
||||||
} else if (msg.file.type === 'application/pdf') {
|
|
||||||
|
|
||||||
this.downloadFile = event.body;
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.attachments[0] = {
|
|
||||||
image_url: this.downloadFile,
|
|
||||||
name: msg.attachments[0].name,
|
|
||||||
title: msg.attachments[0].title,
|
|
||||||
title_link_download: msg.attachments[0].title_link_download,
|
|
||||||
ts: msg.attachments[0].ts
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.storage.set(msg.file.guid, this.downloadFile).then(() => {
|
|
||||||
console.log('IMAGE SAVED')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async openPreview(msg) {
|
async openPreview(msg) {
|
||||||
|
|
||||||
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '' ) {
|
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
||||||
this.downloadFileMsg(msg)
|
this.downloadFileMsg(msg)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
var str = msg.attachments[0].image_url;
|
||||||
|
str = str.substring(1, ((str.length) - 1));
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: ViewMediaPage,
|
component: ViewMediaPage,
|
||||||
cssClass: 'modal modal-desktop',
|
cssClass: 'modal modal-desktop',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
image: msg.attachments[0].image_url,
|
image: str,
|
||||||
type: msg.file.type,
|
type: msg.file.type,
|
||||||
username: msg.u.name,
|
username: msg.u.name,
|
||||||
_updatedAt: msg._updatedAt
|
_updatedAt: msg._updatedAt
|
||||||
@@ -1029,5 +1021,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async audioPreview(msg) {
|
||||||
|
console.log(msg);
|
||||||
|
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
|
||||||
|
this.downloadFileMsg(msg)
|
||||||
|
} else { }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
<div class="messages" #scrollMe>
|
<div class="messages" #scrollMe>
|
||||||
<div class="messages-list-item-wrapper container-width-100"
|
<div class="messages-list-item-wrapper container-width-100"
|
||||||
*ngFor="let msg of wsChatMethodsService.getDmRoom(roomId).messages; let last = last">
|
*ngFor="let msg of wsChatMethodsService.getDmRoom(roomId).messages; index as i; let last = last">
|
||||||
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45' *ngIf="msg.msg !=''">
|
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45' *ngIf="msg.msg !=''">
|
||||||
<div class="message-item-options d-flex justify-content-end">
|
<div class="message-item-options d-flex justify-content-end">
|
||||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
|
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
|
||||||
@@ -49,12 +49,12 @@
|
|||||||
<span class="time">{{msg.duration}}</span>
|
<span class="time">{{msg.duration}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-space-between">
|
<div class="d-flex justify-space-between">
|
||||||
|
|
||||||
<ion-label *ngIf="msg.delate == false" class="flex-0">{{msg.msg}}</ion-label>
|
<ion-label *ngIf="msg.delate == false" class="flex-0">{{msg.msg}} </ion-label>
|
||||||
<ion-label *ngIf="msg.delate == true" class="flex-0">Apagou a mensagem</ion-label>
|
<ion-label *ngIf="msg.delate == true" class="flex-0">Apagou a mensagem</ion-label>
|
||||||
|
|
||||||
<ion-label class="float-status-all float-status" >
|
<ion-label class="float-status-all float-status" >
|
||||||
|
|
||||||
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
@@ -84,7 +84,6 @@
|
|||||||
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)" dfsdvsvs>
|
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)" dfsdvsvs>
|
||||||
<img src={{msg.attachments[0].image_url}} alt="image">
|
<img src={{msg.attachments[0].image_url}} alt="image">
|
||||||
<ion-label class="float-status-all float-status" >
|
<ion-label class="float-status-all float-status" >
|
||||||
|
|
||||||
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
@@ -109,7 +108,15 @@
|
|||||||
<ion-label class="file-title">{{file.title}}</ion-label>
|
<ion-label class="file-title">{{file.title}}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio'">
|
<div (click)="audioPreview(msg)" class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && !file.title_link">
|
||||||
|
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||||
|
<ion-icon name="mic-outline" class="file-icon"></ion-icon>
|
||||||
|
<ion-label>{{file.title}}</ion-label>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||||
|
</ion-item>
|
||||||
|
</div>
|
||||||
|
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
|
||||||
<audio [src]="file.title_link|safehtml" preload="metadata" class="flex-grow-1" controls controlsList="nodownload noplaybackrate"></audio>
|
<audio [src]="file.title_link|safehtml" preload="metadata" class="flex-grow-1" controls controlsList="nodownload noplaybackrate"></audio>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-details-optional add-attachment-bg-color">
|
<div class="file-details-optional add-attachment-bg-color">
|
||||||
@@ -119,7 +126,7 @@
|
|||||||
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ion-label class="float-status-all float-status" >
|
<ion-label class="float-status-all float-status" >
|
||||||
|
|
||||||
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
@@ -133,28 +140,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-meeting" *ngIf="msg.file.type == 'application/meeting'">
|
<div class="info-meeting" *ngIf="msg.file.type == 'application/meeting'">
|
||||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
|
||||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal">
|
<ion-label *ngIf="msg.delate == true" class="info-meeting-small">Apagou a mensagem</ion-label><br />
|
||||||
|
|
||||||
|
|
||||||
|
<ion-label *ngIf="msg.delate == false" class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||||
|
<button *ngIf="msg.delate == false" (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal">
|
||||||
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
|
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
|
||||||
</button><br />
|
</button><br />
|
||||||
<ion-label class="info-meeting-medium">
|
<ion-label *ngIf="msg.delate == false" class="info-meeting-medium">
|
||||||
<ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a
|
<ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a
|
||||||
{{showDateDuration(msg.file.end_date)}}
|
{{showDateDuration(msg.file.end_date)}}
|
||||||
</ion-label><br />
|
</ion-label><br />
|
||||||
<ion-label class="info-meeting-medium">
|
<ion-label *ngIf="msg.delate == false" class="info-meeting-medium">
|
||||||
<ion-icon></ion-icon>
|
<ion-icon></ion-icon>
|
||||||
<ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}
|
<ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}
|
||||||
</ion-label><br />
|
</ion-label><br />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="msg.file && msg.delate == true">
|
|
||||||
Apagou a mensagem
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||||
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||||
<ion-icon name="chevron-down"></ion-icon>
|
<ion-icon name="chevron-down"></ion-icon>
|
||||||
@@ -165,7 +174,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<ion-footer (click)="wsChatMethodsService.getDmRoom(roomId).sendReadMessage()">
|
<ion-footer (click)="wsChatMethodsService.getDmRoom(roomId).sendReadMessage()">
|
||||||
|
|
||||||
<div class="typing" *ngIf="wsChatMethodsService.getDmRoom(roomId).otherUserType == true" >
|
<div class="typing" *ngIf="wsChatMethodsService.getDmRoom(roomId).otherUserType == true" >
|
||||||
<ngx-letters-avatar *ngIf="showAvatar"
|
<ngx-letters-avatar *ngIf="showAvatar"
|
||||||
[avatarName]= "wsChatMethodsService.getDmRoom(roomId).name"
|
[avatarName]= "wsChatMethodsService.getDmRoom(roomId).name"
|
||||||
|
|||||||
@@ -227,6 +227,13 @@
|
|||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chat-icon-download{
|
||||||
|
font-size: 95px;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 4px;
|
||||||
|
border: 1px solid red;
|
||||||
|
}
|
||||||
|
|
||||||
.type-message{
|
.type-message{
|
||||||
display: flex;
|
display: flex;
|
||||||
border: 1px solid #ebebeb;
|
border: 1px solid #ebebeb;
|
||||||
@@ -329,3 +336,8 @@ display: block;
|
|||||||
.typing ngx-letters-avatar {
|
.typing ngx-letters-avatar {
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.div-do-audio{
|
||||||
|
border: 1px solid red !important;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.serv
|
|||||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service'
|
import { WsChatService } from 'src/app/services/chat/ws-chat.service'
|
||||||
import { MessageService } from 'src/app/services/chat/message.service';
|
import { MessageService } from 'src/app/services/chat/message.service';
|
||||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
|
|
||||||
import { CameraService } from 'src/app/services/camera.service';
|
import { CameraService } from 'src/app/services/camera.service';
|
||||||
import { FileType } from 'src/app/models/fileType';
|
import { FileType } from 'src/app/models/fileType';
|
||||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
@@ -77,7 +76,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
scrollToBottomBtn = false;
|
scrollToBottomBtn = false;
|
||||||
longPressActive = false;
|
longPressActive = false;
|
||||||
frameUrl: any;
|
frameUrl: any;
|
||||||
downloadFile: any;
|
downloadFile: string;
|
||||||
massages: MessageService[] = []
|
massages: MessageService[] = []
|
||||||
|
|
||||||
showAvatar = true;
|
showAvatar = true;
|
||||||
@@ -86,8 +85,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
allowTyping = true;
|
allowTyping = true;
|
||||||
storedFileNames = [];
|
storedFileNames = [];
|
||||||
lastAudioRecorded = '';
|
lastAudioRecorded = '';
|
||||||
audioRecorded:any = "";
|
audioRecorded: any = "";
|
||||||
audioDownloaded:any = "";
|
audioDownloaded: any = "";
|
||||||
durationDisplay = '';
|
durationDisplay = '';
|
||||||
duration = 0;
|
duration = 0;
|
||||||
|
|
||||||
@@ -239,7 +238,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFile(fileName?:any){
|
async getFile(fileName?: any) {
|
||||||
const audioFile = await Filesystem.readFile({
|
const audioFile = await Filesystem.readFile({
|
||||||
path: fileName,
|
path: fileName,
|
||||||
directory: Directory.Data
|
directory: Directory.Data
|
||||||
@@ -250,24 +249,35 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadFiles() {
|
async loadFiles() {
|
||||||
|
try {
|
||||||
|
this.storage.get('fileName').then((fileName) => {
|
||||||
|
this.lastAudioRecorded = fileName;
|
||||||
|
})
|
||||||
|
|
||||||
|
this.storage.get('recordData').then((recordData) => {
|
||||||
|
console.log(recordData);
|
||||||
|
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||||
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) { }
|
||||||
|
|
||||||
this.storage.get('fileName').then((fileName) => {
|
|
||||||
this.lastAudioRecorded = fileName;
|
|
||||||
})
|
|
||||||
|
|
||||||
this.storage.get('recordData').then((recordData) => {
|
this.storage.get('recordData').then((recordData) => {
|
||||||
console.log(recordData);
|
console.log(recordData);
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
if (recordData.value.recordDataBase64.includes('data:audio')) {
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
startRecording() {
|
startRecording() {
|
||||||
console.log('Recording');
|
|
||||||
|
|
||||||
if (this.recording) {
|
if (this.recording) {
|
||||||
return;
|
return;
|
||||||
@@ -293,8 +303,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
//console.log(recordData);
|
//console.log(recordData);
|
||||||
const fileName = new Date().getTime() + ".mp3";
|
const fileName = new Date().getTime() + ".mp3";
|
||||||
//Save file
|
//Save file
|
||||||
this.storage.set('fileName',fileName);
|
this.storage.set('fileName', fileName);
|
||||||
this.storage.set('recordData',result).then(() => {
|
this.storage.set('recordData', result).then(() => {
|
||||||
console.log('Audio recorded saved');
|
console.log('Audio recorded saved');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -304,7 +314,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteRecording(){
|
async deleteRecording() {
|
||||||
this.storage.remove('fileName');
|
this.storage.remove('fileName');
|
||||||
this.storage.remove('recordData');
|
this.storage.remove('recordData');
|
||||||
|
|
||||||
@@ -354,81 +364,92 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
|
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendAudio(fileName) {
|
|
||||||
|
|
||||||
|
async sendAudio(fileName) {
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
let audioFile;
|
let audioFile;
|
||||||
this.storage.get('recordData').then((recordData) => {
|
this.storage.get('recordData').then((recordData) => {
|
||||||
console.log(recordData);
|
console.log(recordData);
|
||||||
audioFile = recordData;
|
audioFile = recordData;
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
|
||||||
|
if (recordData.value.recordDataBase64.includes('data:audio')) {
|
||||||
this.audioRecorded = recordData.value.recordDataBase64;
|
this.audioRecorded = recordData.value.recordDataBase64;
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
|
||||||
}
|
}
|
||||||
|
//Converting base64 to blob
|
||||||
|
const encodedData = btoa(this.audioRecorded);
|
||||||
|
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||||
|
console.log(blob)
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("blobFile", blob);
|
||||||
|
|
||||||
|
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||||
|
file: {
|
||||||
|
"type": "application/audio",
|
||||||
|
"msDuration": audioFile.value.msDuration,
|
||||||
|
"mimeType": audioFile.value.mimeType,
|
||||||
|
},
|
||||||
|
attachments: [{
|
||||||
|
"title": fileName,
|
||||||
|
"title_link_download": true,
|
||||||
|
"type": "audio"
|
||||||
|
}],
|
||||||
|
temporaryData: formData
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Converting base64 to blob
|
|
||||||
const base64Response = await fetch(this.audioRecorded);
|
|
||||||
const blob = await base64Response.blob();
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("blobFile", blob);
|
|
||||||
|
|
||||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
|
||||||
file: {
|
|
||||||
"type": "application/audio",
|
|
||||||
/* "guid": '', */
|
|
||||||
"msDuration":audioFile.value.msDuration,
|
|
||||||
"mimeType":audioFile.value.mimeType,
|
|
||||||
},
|
|
||||||
attachments: [{
|
|
||||||
"title": fileName ,
|
|
||||||
"title_link": this.audioRecorded,
|
|
||||||
"title_link_download": true,
|
|
||||||
"type": "audio"
|
|
||||||
}],
|
|
||||||
temporaryData: formData
|
|
||||||
})
|
|
||||||
this.deleteRecording();
|
this.deleteRecording();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMessage(msgId: string, msg:MessageService) {
|
|
||||||
|
|
||||||
msg.delateStatusFalse()
|
deleteMessage(msgId: string, msg: MessageService) {
|
||||||
this.wsChatMethodsService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
|
this.wsChatMethodsService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
|
||||||
|
if (msg.file.type == "application/webtrix") {
|
||||||
}
|
|
||||||
|
|
||||||
async viewDocument(msg: any, url?: string) {
|
|
||||||
if (msg.file.type == "application/img") {
|
|
||||||
let response: any = await this.AttachmentsService.getFile(msg.file.guid).toPromise();
|
|
||||||
console.log(response);
|
|
||||||
alert(response);
|
|
||||||
|
|
||||||
//this.openPreview(msg);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (msg.file.type == "application/webtrix") {
|
|
||||||
this.openViewDocumentModal(msg.file);
|
this.openViewDocumentModal(msg.file);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log('PDF CLICK', msg)
|
console.log('PDF CLICK', msg)
|
||||||
|
var str = msg.attachments[0].image_url;
|
||||||
|
str = str.substring(1, ((str.length) - 1));
|
||||||
|
|
||||||
|
const encodedData = btoa(str);
|
||||||
/* let fullUrl;
|
/* let fullUrl;
|
||||||
fullUrl = "https://gabinetedigitalchat.dyndns.info" + url;
|
fullUrl = "https://gabinetedigitalchat.dyndns.info" + url;
|
||||||
//fullUrl = "http://www.africau.edu/images/default/sample.pdf";
|
//fullUrl = "http://www.africau.edu/images/default/sample.pdf";
|
||||||
|
|
||||||
this.frameUrl = fullUrl; */
|
this.frameUrl = fullUrl; */
|
||||||
let file = new Blob([msg.attachments[0].image_url], { type: 'application/pdf' });
|
let file = this.base64toBlob(encodedData, 'application/pdf')
|
||||||
let fileURL = URL.createObjectURL(file)
|
let fileURL = URL.createObjectURL(file)
|
||||||
|
console.log('PDF CLICK', fileURL)
|
||||||
window.open(fileURL);
|
window.open(fileURL);
|
||||||
|
|
||||||
// this.chatService.getDocumentDetails(fullUrl);
|
// this.chatService.getDocumentDetails(fullUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base64toBlob(base64Data, contentType) {
|
||||||
|
contentType = contentType || '';
|
||||||
|
var sliceSize = 1024;
|
||||||
|
var byteCharacters = atob(base64Data);
|
||||||
|
var bytesLength = byteCharacters.length;
|
||||||
|
var slicesCount = Math.ceil(bytesLength / sliceSize);
|
||||||
|
var byteArrays = new Array(slicesCount);
|
||||||
|
|
||||||
|
for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
|
||||||
|
var begin = sliceIndex * sliceSize;
|
||||||
|
var end = Math.min(begin + sliceSize, bytesLength);
|
||||||
|
|
||||||
|
var bytes = new Array(end - begin);
|
||||||
|
for (var offset = begin, i = 0; offset < end; ++i, ++offset) {
|
||||||
|
bytes[i] = byteCharacters[offset].charCodeAt(0);
|
||||||
|
}
|
||||||
|
byteArrays[sliceIndex] = new Uint8Array(bytes);
|
||||||
|
}
|
||||||
|
return new Blob(byteArrays, { type: contentType });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async openViewDocumentModal(file: any) {
|
async openViewDocumentModal(file: any) {
|
||||||
let task = {
|
let task = {
|
||||||
@@ -747,19 +768,18 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
const file: any = await this.fileService.getFileFromDevice(types);
|
const file: any = await this.fileService.getFileFromDevice(types);
|
||||||
|
|
||||||
console.log('Add file', file)
|
if (file.type == "application/pdf") {
|
||||||
/* const imageData = await this.fileToBase64Service.convert(file).then((filee) => {
|
|
||||||
console.log('Add file', filee)
|
|
||||||
}) */
|
|
||||||
const blob = new Blob([file], { type: file.type })
|
|
||||||
console.log('Add file', blob)
|
|
||||||
|
|
||||||
const formData = new FormData();
|
console.log('Add file', file)
|
||||||
formData.append("blobFile", blob);
|
/* const imageData = await this.fileToBase64Service.convert(file).then((filee) => {
|
||||||
|
console.log('Add file', filee)
|
||||||
|
}) */
|
||||||
|
const blob = new Blob([file], { type: file.type })
|
||||||
|
console.log('Add file', blob)
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("blobFile", blob);
|
||||||
|
|
||||||
let pdfBase64;
|
|
||||||
this.blobToBase64(blob).then(res => {
|
|
||||||
//console.log('Base64 pdf', res);
|
|
||||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||||
file: {
|
file: {
|
||||||
"type": file.type,
|
"type": file.type,
|
||||||
@@ -774,7 +794,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}],
|
}],
|
||||||
temporaryData: formData
|
temporaryData: formData
|
||||||
})
|
})
|
||||||
});
|
|
||||||
|
} else {
|
||||||
|
console.log('File type invalid')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -882,54 +905,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
|
|
||||||
downloadFileMsg(msg: MessageService) {
|
downloadFileMsg(msg: MessageService) {
|
||||||
console.log('FILE TYPE', msg.file.type)
|
msg.downloadFileMsg()
|
||||||
this.downloadFile = "";
|
|
||||||
//if (msg.file.type == "application/img") {
|
|
||||||
this.AttachmentsService.downloadFile(msg.file.guid).subscribe(async (event) => {
|
|
||||||
console.log('FILE TYPE 22', msg.file.guid)
|
|
||||||
var name = msg.file.guid;
|
|
||||||
|
|
||||||
if (event.type === HttpEventType.DownloadProgress) {
|
|
||||||
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
|
||||||
console.log('FILE TYPE 33', msg.file.type)
|
|
||||||
} else if (event.type === HttpEventType.Response) {
|
|
||||||
if (msg.file.type == "application/img") {
|
|
||||||
this.downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
|
||||||
} else if (msg.file.type === 'application/pdf') {
|
|
||||||
|
|
||||||
this.downloadFile = event.body;
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.attachments[0] = {
|
|
||||||
image_url: this.downloadFile,
|
|
||||||
name: msg.attachments[0].name,
|
|
||||||
title: msg.attachments[0].title,
|
|
||||||
title_link_download: msg.attachments[0].title_link_download,
|
|
||||||
ts: msg.attachments[0].ts
|
|
||||||
}
|
|
||||||
|
|
||||||
// save the changes to the storage
|
|
||||||
msg.save()
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_arrayBufferToBase64( buffer ) {
|
|
||||||
var binary = '';
|
|
||||||
var bytes = new Uint8Array( buffer );
|
|
||||||
var len = bytes.byteLength;
|
|
||||||
for (var i = 0; i < len; i++) {
|
|
||||||
binary += String.fromCharCode( bytes[ i ] );
|
|
||||||
}
|
|
||||||
return window.btoa( binary );
|
|
||||||
}
|
|
||||||
|
|
||||||
pdfPreview() {
|
pdfPreview() {
|
||||||
const options: DocumentViewerOptions = {
|
const options: DocumentViewerOptions = {
|
||||||
title: 'My App'
|
title: 'My App'
|
||||||
@@ -937,14 +915,45 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
DocumentViewer.viewDocument
|
DocumentViewer.viewDocument
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async audioPreview(msg) {
|
||||||
|
console.log(msg);
|
||||||
|
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
|
||||||
|
this.downloadFileMsg(msg)
|
||||||
|
} else { }
|
||||||
|
}
|
||||||
|
|
||||||
async openPreview(msg) {
|
async openPreview(msg) {
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
|
|
||||||
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
||||||
this.downloadFileMsg(msg)
|
this.downloadFileMsg(msg)
|
||||||
|
|
||||||
|
|
||||||
|
/* } else if (msg.file.type === "application/pdf") {
|
||||||
|
|
||||||
|
|
||||||
|
console.log(str);
|
||||||
|
const win = window.open("", "_blank");
|
||||||
|
let html = '';
|
||||||
|
|
||||||
|
html += '<html>';
|
||||||
|
html += '<body style="margin:0!important">';
|
||||||
|
html += '<iframe width="100%" height="100%" src="' + str + '" type="application/pdf" />';
|
||||||
|
html += '</body>';
|
||||||
|
html += '</html>';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
win.document.write(html);
|
||||||
|
}, 0); */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//this.viewDocument(msg, msg.attachments.image_url)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
var str = msg.attachments[0].image_url;
|
||||||
|
str = str.substring(1, ((str.length) - 1));
|
||||||
|
|
||||||
/* if(msg.file.type === "application/pdf") {
|
/* if(msg.file.type === "application/pdf") {
|
||||||
this.viewDocument(msg, msg.attachments.image_url)
|
this.viewDocument(msg, msg.attachments.image_url)
|
||||||
} else { */
|
} else { */
|
||||||
@@ -952,7 +961,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
component: ViewMediaPage,
|
component: ViewMediaPage,
|
||||||
cssClass: 'modal modal-desktop',
|
cssClass: 'modal modal-desktop',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
image: msg.attachments[0].image_url,
|
image: str,
|
||||||
type: msg.file.type,
|
type: msg.file.type,
|
||||||
username: msg.u.name,
|
username: msg.u.name,
|
||||||
_updatedAt: msg._updatedAt
|
_updatedAt: msg._updatedAt
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
<div class="d-flex flex-1 pr-20 pl-50">
|
<div class="d-flex flex-1 pr-20 pl-50">
|
||||||
|
|
||||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
|
<div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
|
||||||
[class.active]="locationPathname() == '/home/events'">
|
[class.active]="locationPathname() == '/home/events'">
|
||||||
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-active-black.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-active-black.svg'></ion-icon>
|
||||||
@@ -76,7 +76,9 @@
|
|||||||
<span>Início</span>
|
<span>Início</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')"
|
<!-- *ngIf="p.userPermission([permissionList.Agenda])" -->
|
||||||
|
|
||||||
|
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')"
|
||||||
[class.active]="locationPathname() == '/home/agenda'">
|
[class.active]="locationPathname() == '/home/agenda'">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-agenda-inactive.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-agenda-inactive.svg'></ion-icon>
|
||||||
@@ -85,7 +87,9 @@
|
|||||||
<span>Agenda</span>
|
<span>Agenda</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')"
|
<!-- *ngIf="p.userPermission([permissionList.Gabinete])" -->
|
||||||
|
|
||||||
|
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')"
|
||||||
[class.active]="locationPathname() == '/home/gabinete-digital'">
|
[class.active]="locationPathname() == '/home/gabinete-digital'">
|
||||||
|
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon>
|
||||||
@@ -94,7 +98,9 @@
|
|||||||
<span>Gabinete</span>
|
<span>Gabinete</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')"
|
<!-- *ngIf="p.userPermission([permissionList.Actions])" -->
|
||||||
|
|
||||||
|
<div *ngIf="p.userPermission([permissionList.Actions.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')"
|
||||||
[class.active]="locationPathname() == '/home/publications'">
|
[class.active]="locationPathname() == '/home/publications'">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-a-es-inactive.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-a-es-inactive.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-a-es-inactive.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-a-es-inactive.svg'></ion-icon>
|
||||||
@@ -102,7 +108,9 @@
|
|||||||
<span>Acções</span>
|
<span>Acções</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')"
|
<!-- *ngIf="p.userPermission([permissionList.Chat])" -->
|
||||||
|
|
||||||
|
<div *ngIf="p.userPermission([permissionList.Chat.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')"
|
||||||
[class.active]="locationPathname() == '/home/chat'">
|
[class.active]="locationPathname() == '/home/chat'">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ import { LoginUserRespose } from 'src/app/models/user.model';
|
|||||||
import { ProfilePage } from 'src/app/modals/profile/profile.page';
|
import { ProfilePage } from 'src/app/modals/profile/profile.page';
|
||||||
import { StorageService } from '../../services/storage.service';
|
import { StorageService } from '../../services/storage.service';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
//import { NotificationsService } from '../../services/notifications.service';
|
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { EventTrigger } from '../../services/eventTrigger.service';
|
import { EventTrigger } from '../../services/eventTrigger.service';
|
||||||
import { ThemeService } from '../../services/theme.service';
|
import { ThemeService } from '../../services/theme.service';
|
||||||
import { interval } from 'rxjs';
|
import { interval } from 'rxjs';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
@@ -29,6 +30,7 @@ export class HeaderPage implements OnInit {
|
|||||||
notificationLength: 0;
|
notificationLength: 0;
|
||||||
SessionStore = SessionStore
|
SessionStore = SessionStore
|
||||||
check: boolean;
|
check: boolean;
|
||||||
|
permissionList = new PermissionList();
|
||||||
|
|
||||||
production = environment.production
|
production = environment.production
|
||||||
|
|
||||||
@@ -41,7 +43,8 @@ export class HeaderPage implements OnInit {
|
|||||||
//private notificationsService: NotificationsService,
|
//private notificationsService: NotificationsService,
|
||||||
private eventrigger: EventTrigger,
|
private eventrigger: EventTrigger,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
public RouteService: RouteService
|
public RouteService: RouteService,
|
||||||
|
public p: PermissionService,
|
||||||
) {
|
) {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
router.events.subscribe((val) => {
|
router.events.subscribe((val) => {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
|
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
|
||||||
<button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
|
<button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
|
||||||
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
|
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
|
||||||
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
|
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
|||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-deploma-options',
|
selector: 'app-deploma-options',
|
||||||
@@ -23,7 +24,8 @@ export class DeplomaOptionsPage implements OnInit {
|
|||||||
fulltask: any
|
fulltask: any
|
||||||
|
|
||||||
|
|
||||||
constructor(public popoverController: PopoverController,
|
constructor(
|
||||||
|
public popoverController: PopoverController,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
@@ -31,7 +33,8 @@ export class DeplomaOptionsPage implements OnInit {
|
|||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private deplomaService: DeplomaService,
|
private deplomaService: DeplomaService,
|
||||||
private RouteService: RouteService) {
|
private RouteService: RouteService,
|
||||||
|
public p: PermissionService,) {
|
||||||
this.serialNumber = this.navParams.get('serialNumber');
|
this.serialNumber = this.navParams.get('serialNumber');
|
||||||
this.task = this.navParams.get('task');
|
this.task = this.navParams.get('task');
|
||||||
this.fulltask = this.navParams.get('fulltask');
|
this.fulltask = this.navParams.get('fulltask');
|
||||||
@@ -138,7 +141,7 @@ export class DeplomaOptionsPage implements OnInit {
|
|||||||
modal.onDidDismiss();
|
modal.onDidDismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async askSignature(note:string, documents:any) {
|
async askSignature(note:string, documents:any) {
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
@@ -162,7 +165,7 @@ export class DeplomaOptionsPage implements OnInit {
|
|||||||
loader.remove()
|
loader.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async sign(note:string, documents:any) {
|
async sign(note:string, documents:any) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||||
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/
|
|||||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
import { customTask, fullTask } from 'src/app/models/dailyworktask.model';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { Location } from '@angular/common'
|
import { Location } from '@angular/common'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
@@ -35,7 +35,7 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private RouteService: RouteService,
|
private RouteService: RouteService,
|
||||||
) {
|
) {
|
||||||
this.task = this.navParams.get('task')
|
this.task = this.navParams.get('task')
|
||||||
this.fulltask = this.navParams.get('fulltask')
|
this.fulltask = this.navParams.get('fulltask')
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
this.toastService._badRequest('Processo não encontrado')
|
this.toastService._badRequest('Processo não encontrado')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async distartExpedientModal(){
|
async distartExpedientModal(){
|
||||||
this.popoverController.dismiss();
|
this.popoverController.dismiss();
|
||||||
console.log(this.fulltask);
|
console.log(this.fulltask);
|
||||||
@@ -98,7 +98,7 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
cssClass: 'discart-expedient-modal',
|
cssClass: 'discart-expedient-modal',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then(res=>{
|
modal.onDidDismiss().then(res=>{
|
||||||
if(res['data']=='close'){
|
if(res['data']=='close'){
|
||||||
@@ -127,7 +127,7 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss();
|
modal.onDidDismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
async openDelegarModal(task: any) {
|
async openDelegarModal(task: any) {
|
||||||
this.popoverController.dismiss();
|
this.popoverController.dismiss();
|
||||||
let classs;
|
let classs;
|
||||||
@@ -157,8 +157,8 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async generateDiploma(note:string, documents:any){
|
async generateDiploma(note:string, documents:any){
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
"action": "Reencaminhar",
|
"action": "Reencaminhar",
|
||||||
"ActionTypeId": 99999839,
|
"ActionTypeId": 99999839,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
@@ -198,20 +198,20 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
cssClass: classs,
|
cssClass: classs,
|
||||||
backdropDismiss: true
|
backdropDismiss: true
|
||||||
});
|
});
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
|
|
||||||
modal.onDidDismiss().then(async (res) => {
|
modal.onDidDismiss().then(async (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if(res.data) {
|
if(res.data) {
|
||||||
|
|
||||||
const DocumentToSave = res.data.documents.map((e) => {
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
return {
|
return {
|
||||||
ApplicationId: e.ApplicationType,
|
ApplicationId: e.ApplicationType,
|
||||||
SourceId: e.Id,
|
SourceId: e.Id,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let docs = {
|
let docs = {
|
||||||
ProcessInstanceID: "",
|
ProcessInstanceID: "",
|
||||||
Attachments: DocumentToSave,
|
Attachments: DocumentToSave,
|
||||||
@@ -235,11 +235,11 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
this.goBack();
|
this.goBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async arquivar(note:string, documents:any) {
|
async arquivar(note:string, documents:any) {
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
"action": "Arquivo",
|
"action": "Arquivo",
|
||||||
"ActionTypeId": 95,
|
"ActionTypeId": 95,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
@@ -259,14 +259,14 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
} finally {
|
} finally {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async executado(note:string, documents:any){
|
async executado(note:string, documents:any){
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
"action": "Conhecimento",
|
"action": "Conhecimento",
|
||||||
"ActionTypeId": 104,
|
"ActionTypeId": 104,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
@@ -290,10 +290,10 @@ export class DespachosOptionsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async reexecutar(note:string, documents:any){
|
async reexecutar(note:string, documents:any){
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
"action": "Reexecutar",
|
"action": "Reexecutar",
|
||||||
"ActionTypeId": 100000010,
|
"ActionTypeId": 100000010,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
|
|||||||
@@ -9,27 +9,27 @@
|
|||||||
<div class="width-100">
|
<div class="width-100">
|
||||||
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
||||||
<div class="flex-grow-1 width-50 pr-10">
|
<div class="flex-grow-1 width-50 pr-10">
|
||||||
<button class="btn-cancel desk" shape="round"> Responder ao PR </button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Responder ao PR </button>
|
||||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||||
<button class="btn-cancel desk" shape="round"> Reencaminhar para Área jurídica </button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Reencaminhar para Área jurídica </button>
|
||||||
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" shape="round" >Gerar Diploma</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" shape="round" >Gerar Diploma</button>
|
||||||
<button class="btn-cancel desk" shape="round"> Outras opções </button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Outras opções </button>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-grow-1 width-50 pl-10">
|
<div class="flex-grow-1 width-50 pl-10">
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<!-- <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> -->
|
<!-- <button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button> -->
|
||||||
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
|
||||||
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||||
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="cancle()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/
|
|||||||
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { Location } from '@angular/common'
|
import { Location } from '@angular/common'
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
|
||||||
@@ -36,11 +36,11 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
private RouteService: RouteService,
|
private RouteService: RouteService,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
|
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.profile = "mdgpr";
|
this.profile = "mdgpr";
|
||||||
|
|
||||||
this.activatedRoute.queryParams.subscribe(params => {
|
this.activatedRoute.queryParams.subscribe(params => {
|
||||||
@@ -86,7 +86,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
console.log(res['data']);
|
console.log(res['data']);
|
||||||
if(res['data']=='openDiscart') {
|
if(res['data']=='openDiscart') {
|
||||||
console.log('open discart');
|
console.log('open discart');
|
||||||
|
|
||||||
this.distartExpedientModal();
|
this.distartExpedientModal();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -108,7 +108,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
this.toastService._badRequest('Processo não encontrado')
|
this.toastService._badRequest('Processo não encontrado')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async distartExpedientModal() {
|
async distartExpedientModal() {
|
||||||
this.popoverController.dismiss();
|
this.popoverController.dismiss();
|
||||||
console.log(this.fulltask);
|
console.log(this.fulltask);
|
||||||
@@ -122,7 +122,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
cssClass: 'discart-expedient-modal',
|
cssClass: 'discart-expedient-modal',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then(res=>{
|
modal.onDidDismiss().then(res=>{
|
||||||
if(res['data']=='close'){
|
if(res['data']=='close'){
|
||||||
@@ -132,7 +132,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
this.openMenu(); */
|
this.openMenu(); */
|
||||||
}
|
}
|
||||||
this.popoverController.dismiss('close')
|
this.popoverController.dismiss('close')
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
modal.onDidDismiss()
|
modal.onDidDismiss()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async openDelegarModal(task: any) {
|
async openDelegarModal(task: any) {
|
||||||
this.popoverController.dismiss();
|
this.popoverController.dismiss();
|
||||||
let classs;
|
let classs;
|
||||||
@@ -187,8 +187,8 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async generateDiploma(note:string, documents:any) {
|
async generateDiploma(note:string, documents:any) {
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
"action": "Reencaminhar",
|
"action": "Reencaminhar",
|
||||||
"ActionTypeId": 99999839,
|
"ActionTypeId": 99999839,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
@@ -227,22 +227,22 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
cssClass: classs,
|
cssClass: classs,
|
||||||
backdropDismiss: true
|
backdropDismiss: true
|
||||||
});
|
});
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
|
|
||||||
modal.onDidDismiss().then(async (res) => {
|
modal.onDidDismiss().then(async (res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if(res.data){
|
if(res.data){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const DocumentToSave = res.data.documents.map((e) => {
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
return {
|
return {
|
||||||
ApplicationId: e.ApplicationType,
|
ApplicationId: e.ApplicationType,
|
||||||
SourceId: e.Id,
|
SourceId: e.Id,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let docs = {
|
let docs = {
|
||||||
ProcessInstanceID: "",
|
ProcessInstanceID: "",
|
||||||
Attachments: DocumentToSave,
|
Attachments: DocumentToSave,
|
||||||
@@ -259,15 +259,15 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
else if(actionName == 'Reexecução') {
|
else if(actionName == 'Reexecução') {
|
||||||
await this.reexecutar(res.data.note, docs);
|
await this.reexecutar(res.data.note, docs);
|
||||||
}
|
}
|
||||||
else if(actionName == 'Concluido') {
|
else if(actionName == 'Concluido') {
|
||||||
await this.concluir(res.data.note, docs);
|
await this.concluir(res.data.note, docs);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.goBack();
|
this.goBack();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async concluir(note:string, documents:any){
|
async concluir(note:string, documents:any){
|
||||||
@@ -297,8 +297,8 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async arquivar(note:string, documents:any){
|
async arquivar(note:string, documents:any){
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
"action": "Arquivo",
|
"action": "Arquivo",
|
||||||
"ActionTypeId": 95,
|
"ActionTypeId": 95,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
@@ -323,8 +323,8 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
async executado(note:string, documents:any){
|
async executado(note:string, documents:any){
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
"action": "Conhecimento",
|
"action": "Conhecimento",
|
||||||
"ActionTypeId": 104,
|
"ActionTypeId": 104,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
@@ -347,10 +347,10 @@ export class DespachosPrOptionsPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async reexecutar(note:string, documents:any){
|
async reexecutar(note:string, documents:any){
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": this.serialNumber,
|
"serialNumber": this.serialNumber,
|
||||||
"action": "Reexecutar",
|
"action": "Reexecutar",
|
||||||
"ActionTypeId": 100000010,
|
"ActionTypeId": 100000010,
|
||||||
"dataFields": {
|
"dataFields": {
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { TaskService } from 'src/app/Rules/task.service'
|
import { TaskService } from 'src/app/Rules/task.service'
|
||||||
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-event-details-documents-options',
|
selector: 'app-event-details-documents-options',
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="task">
|
<div *ngIf="task">
|
||||||
<div *ngIf="loggeduser.Profile =='MDGPR' " class="buttons">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="buttons">
|
||||||
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
|
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Aprovar</button>
|
||||||
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||||
<button (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento</button>
|
<button (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documento</button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="loggeduser.Profile =='PR' " class="buttons">
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="buttons">
|
||||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="distartExpedientModal('descartar')" full class="btn-cancel" shape="round" >Descartar</button>
|
<button (click)="distartExpedientModal('descartar')" full class="btn-cancel" shape="round" >Descartar</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { Location } from '@angular/common'
|
import { Location } from '@angular/common'
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-opts-expediente-pr',
|
selector: 'app-opts-expediente-pr',
|
||||||
@@ -51,7 +52,8 @@ export class OptsExpedientePrPage implements OnInit {
|
|||||||
private animationController: AnimationController,
|
private animationController: AnimationController,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private RouteService: RouteService,
|
private RouteService: RouteService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
public p: PermissionService,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|||||||
@@ -6,27 +6,27 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="width-100">
|
<div class="width-100">
|
||||||
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
<div class="d-flex width-100">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<button class="btn-cancel desk" shape="round"> Enviar para o PR </button>
|
<button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="btn-cancel desk" shape="round"> Enviar para o PR </button>
|
||||||
<button (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
|
<button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
|
||||||
<button class="btn-cancel desk" shape="round"> Solicitar revisão </button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Solicitar revisão </button>
|
||||||
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
|
||||||
<button class="btn-cancel desk" shape="round">Outras opções </button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) || p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="btn-cancel desk" shape="round">Outras opções </button>
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
||||||
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
|
||||||
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
<button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
<!-- <div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||||
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { TaskService } from 'src/app/Rules/task.service'
|
import { TaskService } from 'src/app/Rules/task.service'
|
||||||
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
import { ExpedienteService } from 'src/app/Rules/expediente.service';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<!-- <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> -->
|
<!-- <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> -->
|
||||||
<button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button>
|
<button (click)="openAddNoteModal('Solicitar Reapreciação')" class="btn-cancel" shape="round" >Solicitar Reapreciação</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
<div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente' ">
|
<div *ngIf="task.WorkflowName == 'Pedido de Parecer' || task.WorkflowName == 'Pedido de Parecer do Presidente' ">
|
||||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
|
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Parecer'">
|
||||||
<button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
|
<button (click)="openDarParecer(task)" class="btn-cancel" shape="round" >Dar o meu Parecer</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'">Iniciar Conversa</button>
|
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'">Iniciar Conversa</button>
|
||||||
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||||
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||||
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/
|
|||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { DataService } from 'src/app/services/data.service';
|
import { DataService } from 'src/app/services/data.service';
|
||||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {PopoverController } from '@ionic/angular';
|
import {PopoverController } from '@ionic/angular';
|
||||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-searched-document-options',
|
selector: 'app-searched-document-options',
|
||||||
|
|||||||
+2
-2
@@ -56,12 +56,12 @@
|
|||||||
</ion-content>
|
</ion-content>
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
<ion-toolbar class="footer-toolbar width-md-100 px-md-20">
|
<ion-toolbar class="footer-toolbar width-md-100 px-md-20">
|
||||||
<ion-buttons slot="start">
|
<ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.deletePost])" slot="start">
|
||||||
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
|
<button class="btn-delete" fill="clear" color="#ffe0e0" (click)="deletePost()">
|
||||||
<ion-label>Eliminar</ion-label>
|
<ion-label>Eliminar</ion-label>
|
||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-buttons slot="end">
|
<ion-buttons *ngIf="p.userPermission([p.permissionList.Actions.editPost])" slot="end">
|
||||||
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
|
<button class="btn-ok" fill="clear" color="#fff" (click)="editPost('3')">
|
||||||
<ion-label>Editar</ion-label>
|
<ion-label>Editar</ion-label>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user