pull from developer-prod made

This commit is contained in:
Eudes Inácio
2023-11-29 16:06:56 +01:00
109 changed files with 2301 additions and 702 deletions
+1
View File
@@ -97,3 +97,4 @@ src/app/pipes/process.service.ts
src/app/domain src/app/domain
_src/ _src/
-src -src
plugin copy
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="AngularRewrite" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
+1 -1
View File
@@ -1,4 +1,4 @@
// / <reference types="@capacitor/local-notifications" />
// / <reference types="@capacitor/push-notifications" /> // / <reference types="@capacitor/push-notifications" />
// / <reference types="@capacitor/splash-screen" /> // / <reference types="@capacitor/splash-screen" />
+45 -14
View File
@@ -1,28 +1,44 @@
workflows: workflows:
ios-native-workflow: ios-workflow:
name: iOS Native name: iOS Workflow
instance_type: mac_mini_m1 max_build_duration: 120
integrations: integrations:
app_store_connect: GabineteDigital app_store_connect: 433YAF3YWG
environment: environment:
ios_signing: ios_signing:
distribution_type: app_store distribution_type: app_store
bundle_identifier: com.gpr.gabinetedigital.teste bundle_identifier: com.gpr.gabinetedigital.teste
vars: vars:
BUNDLE_ID: "com.gpr.gabinetedigital.teste" APP_STORE_APPLE_ID: 1664747447
APP_STORE_APPLE_ID: DV5P2ZCAPJ XCODE_WORKSPACE: "platforms/ios/App.app.xcworkspace"
xcode: latest XCODE_SCHEME: "App.app"
cocoapods: default
scripts: scripts:
- name: Install CocoaPods dependencies - name: Install npm dependencies for Ionic Capacitor project
script: | script: |
pod install npm install
- name: Set up provisioning profiles settings on Xcode project - name: Cocoapods installation
script: xcode-project use-profiles script: |
cd ios/App && pod install
- name: Update dependencies and copy web assets to native project
script: |
# if you don't need to update native dependencies, use this:
# npx cap copyapp
#
# to update native dependencies, use this command:
npx cap sync
- name: Set up code signing settings on Xcode project
script: |
xcode-project use-profiles
- name: Increment build number
script: |
cd $CM_BUILD_DIR/ios/App
LATEST_BUILD_NUMBER=$(app-store-connect get-latest-app-store-build-number "$APP_STORE_APPLE_ID")
agvtool new-version -all $(($LATEST_BUILD_NUMBER + 1))
- name: Build ipa for distribution - name: Build ipa for distribution
script: | script: |
cd $CM_BUILD_DIR/ios/App
xcode-project build-ipa \ xcode-project build-ipa \
--workspace "$CM_BUILD_DIR/$XCODE_WORKSPACE" \ --workspace "$XCODE_WORKSPACE" \
--scheme "$XCODE_SCHEME" --scheme "$XCODE_SCHEME"
artifacts: artifacts:
- build/ios/ipa/*.ipa - build/ios/ipa/*.ipa
@@ -30,7 +46,22 @@ workflows:
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app - $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM - $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
publishing: publishing:
email:
recipients:
- romavicdosanjoskc@gmail.com
notify:
success: true
failure: false
app_store_connect: app_store_connect:
auth: integration auth: integration
# Configuration related to TestFlight (optional)
# Note: This action is performed during post-processing.
submit_to_testflight: true submit_to_testflight: true
beta_groups: # Specify the names of beta tester groups that will get access to the build once it has passed beta review.
- group name 1
- group name 2
# Configuration related to App Store (optional)
# Note: This action is performed during post-processing.
submit_to_app_store: false submit_to_app_store: false
+8 -8
View File
@@ -189,7 +189,7 @@
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
5B7AACB22ECDCEAA343DC840 /* [CP] Copy Pods Resources */ = { 5B7AACB22ECDCEAA343DC840 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 8;
files = ( files = (
); );
inputPaths = ( inputPaths = (
@@ -197,14 +197,14 @@
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */ = { 6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 8;
files = ( files = (
); );
inputPaths = ( inputPaths = (
@@ -215,14 +215,14 @@
outputPaths = ( outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt", "$(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */ = { 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 8;
files = ( files = (
); );
inputPaths = ( inputPaths = (
@@ -230,7 +230,7 @@
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
@@ -390,7 +390,7 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 63; CURRENT_PROJECT_VERSION = 65;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
INFOPLIST_FILE = App/Info.plist; INFOPLIST_FILE = App/Info.plist;
@@ -419,7 +419,7 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 63; CURRENT_PROJECT_VERSION = 65;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
INFOPLIST_FILE = App/Info.plist; INFOPLIST_FILE = App/Info.plist;
+54
View File
@@ -128,6 +128,7 @@
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"date-fns": "^2.17.0", "date-fns": "^2.17.0",
"depd": "^2.0.0", "depd": "^2.0.0",
"dompurify": "^3.0.6",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"duration": "^0.2.2", "duration": "^0.2.2",
"faker": "^5.5.3", "faker": "^5.5.3",
@@ -164,6 +165,7 @@
"rocket.chat.realtime.api.rxjs": "^2.1.1", "rocket.chat.realtime.api.rxjs": "^2.1.1",
"rxjs": "~6.6.3", "rxjs": "~6.6.3",
"rxjs-compat": "^6.6.7", "rxjs-compat": "^6.6.7",
"sanitize-filename-ts": "^1.0.2",
"send-intent": "^5.0.0", "send-intent": "^5.0.0",
"sharp": "^0.30.7", "sharp": "^0.30.7",
"socket.io-client": "^2.3.0", "socket.io-client": "^2.3.0",
@@ -14702,6 +14704,11 @@
"url": "https://github.com/fb55/domhandler?sponsor=1" "url": "https://github.com/fb55/domhandler?sponsor=1"
} }
}, },
"node_modules/dompurify": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.6.tgz",
"integrity": "sha512-ilkD8YEnnGh1zJ240uJsW7AzE+2qpbOUYjacomn3AvJ6J4JhKGSZ2nh4wUIXPZrEPppaCLx5jFe8T89Rk8tQ7w=="
},
"node_modules/domutils": { "node_modules/domutils": {
"version": "2.8.0", "version": "2.8.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
@@ -33190,6 +33197,14 @@
"which": "bin/which" "which": "bin/which"
} }
}, },
"node_modules/sanitize-filename-ts": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/sanitize-filename-ts/-/sanitize-filename-ts-1.0.2.tgz",
"integrity": "sha512-bON2VOJoappmaBHlnxvBNk5R7HkUAsirf5m1M5Kz15uZykDGbHfGPCQNcEQKR8HrQhgh9CmQ6Xe9y71yM9ywkw==",
"dependencies": {
"truncate-utf8-bytes": "^1.0.2"
}
},
"node_modules/sass": { "node_modules/sass": {
"version": "1.36.0", "version": "1.36.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.36.0.tgz", "resolved": "https://registry.npmjs.org/sass/-/sass-1.36.0.tgz",
@@ -35724,6 +35739,14 @@
"resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz",
"integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw=="
}, },
"node_modules/truncate-utf8-bytes": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz",
"integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==",
"dependencies": {
"utf8-byte-length": "^1.0.1"
}
},
"node_modules/ts-jest": { "node_modules/ts-jest": {
"version": "27.1.5", "version": "27.1.5",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz",
@@ -41686,6 +41709,11 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/utf8-byte-length": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz",
"integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA=="
},
"node_modules/util": { "node_modules/util": {
"version": "0.11.1", "version": "0.11.1",
"resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz",
@@ -54703,6 +54731,11 @@
"domelementtype": "^2.2.0" "domelementtype": "^2.2.0"
} }
}, },
"dompurify": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.6.tgz",
"integrity": "sha512-ilkD8YEnnGh1zJ240uJsW7AzE+2qpbOUYjacomn3AvJ6J4JhKGSZ2nh4wUIXPZrEPppaCLx5jFe8T89Rk8tQ7w=="
},
"domutils": { "domutils": {
"version": "2.8.0", "version": "2.8.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
@@ -68985,6 +69018,14 @@
} }
} }
}, },
"sanitize-filename-ts": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/sanitize-filename-ts/-/sanitize-filename-ts-1.0.2.tgz",
"integrity": "sha512-bON2VOJoappmaBHlnxvBNk5R7HkUAsirf5m1M5Kz15uZykDGbHfGPCQNcEQKR8HrQhgh9CmQ6Xe9y71yM9ywkw==",
"requires": {
"truncate-utf8-bytes": "^1.0.2"
}
},
"sass": { "sass": {
"version": "1.36.0", "version": "1.36.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.36.0.tgz", "resolved": "https://registry.npmjs.org/sass/-/sass-1.36.0.tgz",
@@ -70933,6 +70974,14 @@
"resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz",
"integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw=="
}, },
"truncate-utf8-bytes": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz",
"integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==",
"requires": {
"utf8-byte-length": "^1.0.1"
}
},
"ts-jest": { "ts-jest": {
"version": "27.1.5", "version": "27.1.5",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz",
@@ -75594,6 +75643,11 @@
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
"integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ=="
}, },
"utf8-byte-length": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz",
"integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA=="
},
"util": { "util": {
"version": "0.11.1", "version": "0.11.1",
"resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz",
+2
View File
@@ -142,6 +142,7 @@
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"date-fns": "^2.17.0", "date-fns": "^2.17.0",
"depd": "^2.0.0", "depd": "^2.0.0",
"dompurify": "^3.0.6",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"duration": "^0.2.2", "duration": "^0.2.2",
"faker": "^5.5.3", "faker": "^5.5.3",
@@ -178,6 +179,7 @@
"rocket.chat.realtime.api.rxjs": "^2.1.1", "rocket.chat.realtime.api.rxjs": "^2.1.1",
"rxjs": "~6.6.3", "rxjs": "~6.6.3",
"rxjs-compat": "^6.6.7", "rxjs-compat": "^6.6.7",
"sanitize-filename-ts": "^1.0.2",
"send-intent": "^5.0.0", "send-intent": "^5.0.0",
"sharp": "^0.30.7", "sharp": "^0.30.7",
"socket.io-client": "^2.3.0", "socket.io-client": "^2.3.0",
+4 -3
View File
@@ -90,6 +90,7 @@ import { PopupQuestionPipe } from './modals/popup-question.pipe';
import '@teamhive/capacitor-video-recorder'; import '@teamhive/capacitor-video-recorder';
import { tokenInterceptor } from './interceptors/token.interceptors'; import { tokenInterceptor } from './interceptors/token.interceptors';
import { InputFilterDirective } from './services/directives/input-filter.directive';
// import { ServiceWorkerModule } from '@angular/service-worker'; // import { ServiceWorkerModule } from '@angular/service-worker';
// import { AngularFireModule } from '@angular/fire'; // import { AngularFireModule } from '@angular/fire';
@@ -119,7 +120,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
SentrySibling.init SentrySibling.init
); );
@NgModule({ @NgModule({
declarations: [AppComponent, PopupQuestionPipe], declarations: [AppComponent, PopupQuestionPipe, InputFilterDirective],
imports: [BrowserModule, imports: [BrowserModule,
CommonModule, CommonModule,
FormsModule, FormsModule,
@@ -173,8 +174,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
EditorModule, EditorModule,
// options // options
DeplomaOptionsPageModule, DeplomaOptionsPageModule,
CreateProcessPageModule CreateProcessPageModule,
], ],
entryComponents: [ entryComponents: [
DiplomaOptionsPage, DiplomaOptionsPage,
@@ -216,6 +216,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
DocumentViewer, DocumentViewer,
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
tokenInterceptor tokenInterceptor
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA] schemas: [CUSTOM_ELEMENTS_SCHEMA]
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { MiddlewareRemoteDatasourcecService } from './middleware-remote-datasourcec.service';
describe('MiddlewareRemoteDatasourcecService', () => {
let service: MiddlewareRemoteDatasourcecService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(MiddlewareRemoteDatasourcecService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,17 @@
import { Injectable } from '@angular/core';
import { SessionStore } from "src/app/store/session.service"
import { MiddlewareServiceService } from "src/app/shared/API/middleware/middleware-service.service"
@Injectable({
providedIn: 'root'
})
export class MiddlewareRemoteDatasourcecService {
constructor(
private MiddlewareServiceService: MiddlewareServiceService,
) {}
refreshToken() {
const refreshToken = SessionStore.user.Authorization
return this.MiddlewareServiceService.refreshToken(refreshToken)
}
}
+2
View File
@@ -413,6 +413,8 @@ const routes: Routes = [
canActivate: [InactivityGuard] canActivate: [InactivityGuard]
}, },
{ path: '**', redirectTo: '/', pathMatch: 'full' },
]; ];
@NgModule({ @NgModule({
+4
View File
@@ -22,6 +22,8 @@ import { UserSession } from '../models/user.model';
import { PermissionList } from '../models/permission/permissionList'; import { PermissionList } from '../models/permission/permissionList';
import { SendIntent } from "send-intent"; import { SendIntent } from "send-intent";
// import { ChunkService } from "src/app/services/stream/chunk.service"
// import { StreamService } from "src/app/services/stream/stream.service"
import { Plugins } from '@capacitor/core'; import { Plugins } from '@capacitor/core';
import { NewActionPage } from '../pages/publications/new-action/new-action.page'; import { NewActionPage } from '../pages/publications/new-action/new-action.page';
import { PublicationsPage } from '../pages/publications/publications.page'; import { PublicationsPage } from '../pages/publications/publications.page';
@@ -104,6 +106,8 @@ export class HomePage implements OnInit {
private modalController: ModalController, private modalController: ModalController,
private zone: NgZone private zone: NgZone
// private ChunkService: ChunkService,
// private StreamService: StreamService
) { ) {
if (SessionStore.exist) { if (SessionStore.exist) {
this.user = SessionStore.user; this.user = SessionStore.user;
@@ -62,14 +62,14 @@
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div> </div>
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom "> <div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom || validateField ">
<mat-form-field <mat-form-field
floatLabel="never" floatLabel="never"
appearance="fill" appearance="fill"
class="width-100 d-block" class="width-100 d-block"
appearance="none"> appearance="none">
<mat-select [(ngModel)]="selectedTypes" placeholder="Selecione o tipo de assunto*"> <mat-select [multiple]="false" [(ngModel)]="selectedTypes" placeholder="{{placeholderSubject}}">
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option> <mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@@ -63,6 +63,7 @@ export class CreateProcessPage implements OnInit {
loadedAttachments: any; loadedAttachments: any;
subjectTypes: any; subjectTypes: any;
selectedTypes: string[] = []; selectedTypes: string[] = [];
placeholderSubject: string;
postData: Despacho; postData: Despacho;
dispatchFolder: Folder; dispatchFolder: Folder;
@@ -125,7 +126,13 @@ export class CreateProcessPage implements OnInit {
this.postData = new Despacho(); this.postData = new Despacho();
this.participants = this.participants = new Array(); this.participants = this.participants = new Array();
//Initialize SubjectTypes Array with the value "Indefinido" //Initialize SubjectTypes Array with the value "Indefinido"
this.selectedTypes = ['99999850']; if(this.loggeduser.Profile == 'PR') {
this.selectedTypes = ['99999850'];
this.placeholderSubject = 'Indefinido'
} else {
this.placeholderSubject = 'Selecione o tipo de assunto*'
}
let NumberPDPP; let NumberPDPP;
@@ -179,9 +186,9 @@ export class CreateProcessPage implements OnInit {
ngOnInit() { ngOnInit() {
console.log('crete process') console.log('crete process')
this.getSubjectType(); this.getSubjectType();
setTimeout(() => { /* setTimeout(() => {
this.selectedTypes = ['99999850']; this.selectedTypes = ['99999850'];
}, 500); }, 500); */
this.taskDate = new Date(this.task.taskStartDate); this.taskDate = new Date(this.task.taskStartDate);
@@ -420,7 +427,7 @@ export class CreateProcessPage implements OnInit {
AttachmentList: docs AttachmentList: docs
} }
/* if (this.postData.DispatchFolder.Message) { */ /* if (this.postData.DispatchFolder.Message) { */
try { try {
await this.despachoService.createDespacho(this.postData).toPromise(); await this.despachoService.createDespacho(this.postData).toPromise();
await this.despachoService.CompleteTask({ serialNumber: this.task.serialNumber, note: this.dispatchFolder.Message }).toPromise(); await this.despachoService.CompleteTask({ serialNumber: this.task.serialNumber, note: this.dispatchFolder.Message }).toPromise();
@@ -432,7 +439,7 @@ export class CreateProcessPage implements OnInit {
} finally { } finally {
loader.remove(); loader.remove();
} }
/* } /* }
else { else {
this.validateField = true; this.validateField = true;
this.toastService._badRequest('Por favor adicione uma descrição'); this.toastService._badRequest('Por favor adicione uma descrição');
@@ -223,7 +223,7 @@ export class DocumentDetailPage implements OnInit {
backdropDismiss: false backdropDismiss: false
}); });
modal.onDidDismiss().then(res=>{ modal.onDidDismiss().then(res => {
//this.RouteService.goBack(); //this.RouteService.goBack();
}, (error) => { }, (error) => {
console.log(error) console.log(error)
@@ -331,7 +331,7 @@
</div> </div>
</div> </div>
<div *ngIf="loggeduser.Profile != 'PR'" class="aside-righ flex-grow-1"> <div class="aside-righ flex-grow-1">
<app-empty-container <app-empty-container
[texto]="emptyTextDescription" [texto]="emptyTextDescription"
*ngIf="!showAttendees" *ngIf="!showAttendees"
@@ -22,6 +22,7 @@ import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -75,8 +76,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
taskParticipants: EventPerson[] = []; taskParticipants: EventPerson[] = [];
taskParticipantsCc: EventPerson[] = []; taskParticipantsCc: EventPerson[] = [];
taskDocId:string; taskDocId: string;
loadedAttachments:any; loadedAttachments: any;
attachments: SearchList[] = []; attachments: SearchList[] = [];
@@ -85,24 +86,26 @@ export class DocumentSetUpMeetingPage implements OnInit {
postData: Event; postData: Event;
formLocationSatus: boolean = false; formLocationSatus: boolean = false;
showAttendees= false; showAttendees = false;
loggeduser: LoginUserRespose; loggeduser: LoginUserRespose;
emptyTextDescription = "Selecionar intervenientes"; emptyTextDescription = "Selecionar intervenientes";
document: SearchFolderDetails | SearchDocumentDetails | any; document: SearchFolderDetails | SearchDocumentDetails | any;
subject: string; subject: string;
docs:any[] = []; docs: any[] = [];
eventPipe = new EventPipe() eventPipe = new EventPipe()
CalendarName; CalendarName;
CalendarNameShow = true CalendarNameShow = true
CalendarNamesOptions CalendarNamesOptions
testeFormDefaul = "Eudes" testeFormDefaul = "Eudes"
environment = environment environment = environment
eventPersons: EventPerson[];
contacts: EventPerson[];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
private router:Router, private router: Router,
private navParams: NavParams, private navParams: NavParams,
authService: AuthService, authService: AuthService,
private toastService: ToastService, private toastService: ToastService,
@@ -111,40 +114,72 @@ export class DocumentSetUpMeetingPage implements OnInit {
public ThemeService: ThemeService, public ThemeService: ThemeService,
public _eventService: EventsService, public _eventService: EventsService,
private httpErroHandle: HttpErrorHandle, private httpErroHandle: HttpErrorHandle,
public TaskService: TaskService public TaskService: TaskService,
private contactsService: ContactsService,
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.document = this.navParams.get('document') this.document = this.navParams.get('document')
if(Array.isArray(this.document)) { if (Array.isArray(this.document)) {
const E = this.document
this.document = []
E.forEach((e) => {
this.document.push({
ApplicationId: e.ApplicationId || e.ApplicationType,
Source: 1,
SourceId: e.DocId || e.docID || e.docId || e.SourceId || e.Id,
SourceName: e.Assunto || e.attachments,
DocDate: e.CreateDate,
Data: e.Data,
Assunto: e.Description,
...e
})
})
} else if (this.document) {
const E = this.document
this.document = []
this.document.push({
ApplicationId: E.ApplicationId || E.ApplicationType,
Source: 1,
SourceId: E.DocId || E.docID || E.docId || E.SourceId || E.Id,
SourceName: E.Assunto || E.attachments,
DocDate: E.CreateDate,
Data: E.Data,
Assunto: E.Description,
...E
})
} else {
this.document = []
}
if (Array.isArray(this.document)) {
this.attachments = this.document this.attachments = this.document
} else { } else {
this.attachments = [this.document] this.attachments = [this.document]
} }
this.document = []
this.subject = this.navParams.get('subject') this.subject = this.navParams.get('subject')
this.postData = new Event(); this.postData = new Event();
this.postData.Body ={ BodyType : "1", Text : ""}; this.postData.Body = { BodyType: "1", Text: "" };
this.postData.Subject = this.subject this.postData.Subject = this.subject
this.postData.CalendarName = "Oficial"; this.postData.CalendarName = "Oficial";
this.postData.Category = 'Reunião' this.postData.Category = 'Reunião'
if(!this.CalendarName) { if (!this.CalendarName) {
if(this._eventService.calendarNamesAry.includes('Meu calendario')) { if (this._eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario'; this.CalendarName = 'Meu calendario';
} else { } else {
this.CalendarName = this._eventService.calendarNamesAry[0] this.CalendarName = this._eventService.calendarNamesAry[0]
} }
} }
if(this.taskParticipants.length == 0) { if (this.taskParticipants.length == 0) {
this.taskParticipants = [ this.taskParticipants = [
// { // {
// EmailAddress: SessionStore.user.Email, // EmailAddress: SessionStore.user.Email,
@@ -163,6 +198,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.adding = "intervenient"; this.adding = "intervenient";
this.setDefaultTime() this.setDefaultTime()
this.getRecurrenceTypes(); this.getRecurrenceTypes();
this.fetchContacts("")
} }
@@ -172,15 +208,15 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
myInterval = setInterval(() => { myInterval = setInterval(() => {
document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => { document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => {
if(e) { if (e) {
e.disabled = true; e.disabled = true;
} }
}) })
}, 1000); }, 1000);
getRecurrenceTypes() { getRecurrenceTypes() {
this.calendarService.getRecurrenceTypes().subscribe( res=> { this.calendarService.getRecurrenceTypes().subscribe(res => {
this.recurringTypes = res; this.recurringTypes = res;
}); });
} }
@@ -191,13 +227,13 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
setStartDate() { setStartDate() {
if(!this.postData.StartDate) { if (!this.postData.StartDate) {
this.postData.StartDate = this.roundTimeQuarterHour(); this.postData.StartDate = this.roundTimeQuarterHour();
} }
} }
setEndDate() { setEndDate() {
if(!this.postData.EndDate) { if (!this.postData.EndDate) {
this.postData.EndDate = this.roundTimeQuarterHourPlus15(this.postData.StartDate); this.postData.EndDate = this.roundTimeQuarterHourPlus15(this.postData.StartDate);
} }
} }
@@ -207,11 +243,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
runValidation() { runValidation() {
this.validateFrom = true this.validateFrom = true
} }
get dateValid() { get dateValid() {
return new Date(this.postData.StartDate).getTime() < new Date(this.postData.EndDate).getTime() ? 'ok': null return new Date(this.postData.StartDate).getTime() < new Date(this.postData.EndDate).getTime() ? 'ok' : null
} }
injectValidation() { injectValidation() {
@@ -227,7 +263,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
CalendarName: new FormControl(this.postData.CalendarName, [ CalendarName: new FormControl(this.postData.CalendarName, [
// Validators.required // Validators.required
]), ]),
Date: new FormControl( (this.dateValid), [ Date: new FormControl((this.dateValid), [
Validators.required Validators.required
]), ]),
participantes: new FormControl(this.taskParticipants, [ participantes: new FormControl(this.taskParticipants, [
@@ -248,7 +284,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.CalendarNameShow = true this.CalendarNameShow = true
if(this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
this.CalendarNamesOptions = ['Oficial', 'Pessoal'] this.CalendarNamesOptions = ['Oficial', 'Pessoal']
@@ -269,33 +305,14 @@ export class DocumentSetUpMeetingPage implements OnInit {
async saveTask() { async saveTask() {
if(this.loggeduser.Profile == 'MDGPR') { if (this.loggeduser.Profile == 'MDGPR') {
this.injectValidation() this.injectValidation()
this.runValidation() this.runValidation()
if(this.Form.invalid) return false if (this.Form.invalid) return false
} }
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc); let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
if(this.document.Documents) {
this.document.Documents.forEach((e)=> {
this.docs.push({
ApplicationId: e.ApplicationId || e.ApplicationType,
Source: 1,
SourceId: e.DocId || e.docID || e.docId || e.SourceId || e.Id,
SourceName: e.Assunto
})
})
}
else{
this.docs.push({
ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
Source: 1,
SourceId: this.document.DocId || this.document.docID || this.document.docId || this.document.SourceId || this.document.Id,
SourceName: this.document.Assunto
})
}
let postEvent = { let postEvent = {
EventId: '', EventId: '',
Subject: this.postData.Subject, Subject: this.postData.Subject,
@@ -318,10 +335,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
Type: this.EventRecurrenceType, Type: this.EventRecurrenceType,
LastOccurrence: this.Occurrence, LastOccurrence: this.Occurrence,
}, },
// Attachments: this.docs, Attachments: this.attachments,
} }
const laoder = this.toastService.loading() const laoder = this.toastService.loading();
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => { this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
laoder.remove(); laoder.remove();
@@ -330,7 +348,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
}, (error) => { }, (error) => {
laoder.remove(); laoder.remove();
this.httpErroHandle.httpStatusHandle(error) this.httpErroHandle.httpStatusHandle(error)
}, ()=>{ }, () => {
laoder.remove(); laoder.remove();
}); });
@@ -340,10 +358,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.adding = "intervenient"; this.adding = "intervenient";
if(window.innerWidth <= 801){ if (window.innerWidth <= 801) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: AttendeesPageModal, component: AttendeesPageModal,
componentProps: { componentProps: {
adding: this.adding, adding: this.adding,
taskParticipants: this.taskParticipants, taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc taskParticipantsCc: this.taskParticipantsCc
@@ -354,7 +372,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
if(data) { if (data) {
data = data['data']; data = data['data'];
const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendees: EventPerson[] = data['taskParticipants'];
@@ -378,10 +396,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.adding = "CC"; this.adding = "CC";
if(window.innerWidth <= 800) { if (window.innerWidth <= 800) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: AttendeesPageModal, component: AttendeesPageModal,
componentProps: { componentProps: {
adding: this.adding, adding: this.adding,
taskParticipants: this.taskParticipants, taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc taskParticipantsCc: this.taskParticipantsCc
@@ -394,7 +412,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
if(data){ if (data) {
data = data['data']; data = data['data'];
const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendees: EventPerson[] = data['taskParticipants'];
@@ -424,30 +442,30 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
}); });
modal.onDidDismiss().then((res)=> { modal.onDidDismiss().then((res) => {
if(res){ if (res) {
const data = res.data; const data = res.data;
this.attachments.push(data.selected); this.attachments.push(data.selected);
} }
}, (error) => { }, (error) => {
console.log(error) console.log(error)
}); });
await modal.present(); await modal.present();
} }
removeAttachment(index: number) { removeAttachment(index: number) {
this.attachments = this.attachments.filter( (e, i) => index != i); this.attachments = this.attachments.filter((e, i) => index != i);
} }
validateFormInputs() { validateFormInputs() {
let formLocation = this.postData.Location.trim(); let formLocation = this.postData.Location.trim();
if(!this.postData.Location && formLocation.length <= 0){ if (!this.postData.Location && formLocation.length <= 0) {
this.formLocationSatus = true; this.formLocationSatus = true;
} }
} }
selectedCalendarId () { selectedCalendarId() {
if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') { if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') {
return this._eventService.calendarNamesType[this.CalendarName]['OficialId'] return this._eventService.calendarNamesType[this.CalendarName]['OficialId']
@@ -461,7 +479,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
} }
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) { dynamicSetIntervenient({ taskParticipants, taskParticipantsCc }) {
this.taskParticipants = taskParticipants; this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc; this.taskParticipantsCc = taskParticipantsCc;
} }
@@ -484,7 +502,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
const minutes = date.getMinutes(); const minutes = date.getMinutes();
date.setSeconds(0); date.setSeconds(0);
if(minutes % 15 != 0) { if (minutes % 15 != 0) {
if (minutes > 45) { if (minutes > 45) {
date.setMinutes(60) date.setMinutes(60)
@@ -501,10 +519,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
return date return date
} }
roundTimeQuarterHourPlus15(date:Date) { roundTimeQuarterHourPlus15(date: Date) {
const _date = new Date(date); const _date = new Date(date);
const minutes = _date .getMinutes(); const minutes = _date.getMinutes();
_date .setMinutes(minutes + 15) _date.setMinutes(minutes + 15)
return _date return _date
} }
@@ -512,5 +530,34 @@ export class DocumentSetUpMeetingPage implements OnInit {
return this._eventService.calendarRole.includes(str); return this._eventService.calendarRole.includes(str);
} }
async fetchContacts(filter: string) {
if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
});
result.splice(index, 1);
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
console.log('Attendes Email', this.contacts)
}
);
}
}
} }
@@ -61,16 +61,16 @@
<div class="d-flex align-center flex-column" (click)="takePicture()"> <div class="d-flex align-center flex-column" (click)="takePicture()">
<div *ngIf="profilePicture == '' "> <div *ngIf="profilePicture == '' ">
<ion-icon <img
*ngIf="SessionStore.user.RoleDescription != 'Presidente da República' && SessionStore.user.RoleDescription != 'Ministro e Director do Gabinete do PR' && SessionStore.user.RoleDescription != 'Secretário Geral' "
class="profile-pic" src="assets/images/theme/gov/icons-profile.svg"></ion-icon>
<img *ngIf="SessionStore.user.RoleDescription == 'Presidente da República' " class="profile-pic" class="profile-pic" src="assets/images/theme/gov/icons-profile.svg">
<!-- <img *ngIf="SessionStore.user.RoleDescription == 'Presidente da República' " class="profile-pic"
src='assets/images/presidente.png'> src='assets/images/presidente.png'>
<img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' " <img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' "
class="profile-pic" src='assets/images/ministro.png'> class="profile-pic" src='assets/images/ministro.png'>
<img *ngIf="SessionStore.user.RoleDescription == 'Secretário Geral' " class="profile-pic" <img *ngIf="SessionStore.user.RoleDescription == 'Secretário Geral' " class="profile-pic"
src='assets/images/secretaria_geral.png'> src='assets/images/secretaria_geral.png'> -->
</div> </div>
<div *ngIf="profilePicture != '' "> <div *ngIf="profilePicture != '' ">
@@ -135,7 +135,7 @@
</div> </div>
</div> </div>
</div> --> </div>
</div> </div>
@@ -44,8 +44,12 @@ export class EditProfilePage implements OnInit {
} }
getProfilpictureFromStorage() { getProfilpictureFromStorage() {
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => { this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
console.log(picture) if(picture) {
this.profilePicture = picture this.profilePicture = picture
} else {
this.profilePicture = "";
}
/* console.log(picture) */
}).catch((error) => { }).catch((error) => {
this.profilePicture = ""; this.profilePicture = "";
}) })
+6 -6
View File
@@ -37,18 +37,18 @@
<ion-header class=" bg-blue ion-no-border"> <ion-header class=" bg-blue ion-no-border">
<div class="profile-content"> <div class="profile-content">
<div class="d-flex align-center"> <div class="d-flex align-center flex-column">
<div *ngIf="profilePicture == ''" class="profile-pic"> <div *ngIf="profilePicture == ''">
<ion-icon *ngIf="SessionStore.user.RoleDescription != 'Presidente da República' && SessionStore.user.RoleDescription != 'Ministro e Director do Gabinete do PR' && SessionStore.user.RoleDescription != 'Secretário Geral' " class="profile-pic" <img
src="assets/images/theme/gov/icons-profile.svg"></ion-icon> class="profile-pic" src="assets/images/theme/gov/icons-profile.svg">
<img *ngIf="SessionStore.user.RoleDescription == 'Presidente da República' " class="profile-pic" <!-- <img *ngIf="SessionStore.user.RoleDescription == 'Presidente da República' " class="profile-pic"
src='assets/images/presidente.png'> src='assets/images/presidente.png'>
<img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-pic" <img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-pic"
src='assets/images/ministro.png'> src='assets/images/ministro.png'>
<img *ngIf="SessionStore.user.RoleDescription == 'Secretário Geral' " class="profile-pic" <img *ngIf="SessionStore.user.RoleDescription == 'Secretário Geral' " class="profile-pic"
src='assets/images/secretaria_geral.png'> src='assets/images/secretaria_geral.png'> -->
</div> </div>
<div *ngIf="profilePicture != ''" class="profile-pic"> <div *ngIf="profilePicture != ''" class="profile-pic">
+6 -2
View File
@@ -99,8 +99,12 @@ export class ProfilePage implements OnInit {
getProfilpicture() { getProfilpicture() {
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => { this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
console.log(picture) if(picture) {
this.profilePicture = picture this.profilePicture = picture
} else {
this.profilePicture = "";
}
/* console.log(picture) */
}).catch((error ) => { }).catch((error ) => {
this.profilePicture = ""; this.profilePicture = "";
}) })
@@ -125,7 +125,7 @@ export class ViewDocumentPage implements OnInit {
} }
async openBookMeetingModal() { async openBookMeetingModal() {
console.log('this.Document', this.Document) console.log('this.Document----------', this.Document)
let classs; let classs;
if( window.innerWidth < 701) { if( window.innerWidth < 701) {
classs = 'book-meeting-modal modal modal-desktop' classs = 'book-meeting-modal modal modal-desktop'
@@ -164,6 +164,8 @@ export class ViewDocumentPage implements OnInit {
classs = 'modal modal-desktop showAsideOptions' classs = 'modal modal-desktop showAsideOptions'
} }
// check passing // check passing
console.log('this.Document----------openExpedientActionsModal', this.Document)
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ExpedientTaskModalPage, component: ExpedientTaskModalPage,
componentProps: { componentProps: {
+4
View File
@@ -110,3 +110,7 @@ models.register({
version: 14, version: 14,
models: [PublicationDetailsModel, ActionModel, PublicationFolderModel] models: [PublicationDetailsModel, ActionModel, PublicationFolderModel]
}) })
window["MessageModel"] = MessageModel
+2 -1
View File
@@ -3,5 +3,6 @@ export class EventPerson{
Name: string; Name: string;
IsRequired: boolean; IsRequired: boolean;
UserType: string; UserType: string;
IsPR: boolean IsPR: boolean;
RoleDescription: string;
} }
+20 -13
View File
@@ -215,24 +215,30 @@
</div> </div>
<div class="timeline-wrapper flex-grow-1 height-100" > <div class="timeline-wrapper flex-grow-1 height-100" >
<div class="height-100"> <div class="height-100">
<div class="timeline-container height-100 d-flex pt-10 pl-20 filter-{{segment}}" > <div class="timeline-container height-100 d-flex pt-10 pl-20 filter-{{segment}} flex-column" >
<div class="timeline-date align-center" *ngIf="isSelectedDayHasEvent && hasEventToday">
<span >Hoje,&nbsp;</span> {{ timelineDate }}
</div>
<div class="ss-timeline timeline-mobile flex-grow-1 pr-10 text-black height-100 width-100 overflow-y-auto" > <div class="ss-timeline timeline-mobile flex-grow-1 pr-10 text-black height-100 width-100 overflow-y-auto" >
<div class="timeline-date align-center" *ngIf="isSelectedDayHasEvent && hasEventToday">
<span >Hoje,&nbsp;</span> {{ timelineDate }}
</div>
<div *ngFor="let events of TimelineMDList | keyvalue; " > <div *ngFor="let year of TimelineMDList " >
<!-- {{year.yearInfo.yearName}} -->
<div *ngFor="let month of year.months " class="header-day" >
<!-- {{ month.monthInfo.monthName | json }} -->
<!-- <hr> -->
<div class="EventListBox-container" > <div *ngFor="let day of month.days " class="EventListBox-container" >
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
{{ TimelineDay(events.key)}} <div style="text-transform: capitalize; display: inline;">{{ viewTitle }}</div>
</div>
<div *ngFor="let event of events.value" class="EventListBox mb-10" > <div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
{{ day.daysInfo.dayName }} <div style="text-transform: capitalize; display: inline;">{{month.monthInfo.monthName}}</div>
</div>
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)" <div *ngFor="let event of day.events " class="EventListBox mb-10" >
*ngIf="viewEventMonth <= dateMonth(event) "> <div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
>
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent"> <div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
@@ -258,10 +264,11 @@
<div class="font-13 calendar-owner"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'">{{SessionStore.user.FullName}} </div> <div class="font-13 calendar-owner"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'">{{SessionStore.user.FullName}} </div>
<ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template> <ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
+4 -5
View File
@@ -875,13 +875,12 @@ $font-size: rem(15);
font-weight: bold !important; font-weight: bold !important;
} }
.ss-timeline > :nth-child(2) .dayShow { .header-day .dayShow:nth-child(1) {
display: none; display: none !important;
} }
.ss-timeline > :nth-child(1) .dayShow {
margin-top: 0px !important;
}
.calendar-options { .calendar-options {
position: relative; position: relative;
+132 -80
View File
@@ -105,7 +105,7 @@ export class AgendaPage implements OnInit {
selectedEvent: Event; selectedEvent: Event;
selectedEventId: string | number; selectedEventId: string | number;
selectedEventCalendarId : string | number; selectedEventCalendarId: string | number;
postEvent: any; postEvent: any;
// temporary data // temporary data
@@ -213,7 +213,7 @@ export class AgendaPage implements OnInit {
} else if (this.loggeduser.Profile == 'PR') { } else if (this.loggeduser.Profile == 'PR') {
this.profile = "pr"; this.profile = "pr";
} else { } else {
if(this.eventService.usersCalendarIds.length >= 2) { if (this.eventService.usersCalendarIds.length >= 2) {
this.profile = "mdgpr"; this.profile = "mdgpr";
} else if (this.eventService.hasOwnCalendar) { } else if (this.eventService.hasOwnCalendar) {
this.profile = "mdgpr"; this.profile = "mdgpr";
@@ -270,9 +270,20 @@ export class AgendaPage implements OnInit {
this.segment = "Combinado"; this.segment = "Combinado";
} }
if (realoadCounter != 0) { if (realoadCounter != 0) {
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
this.updateEventListBox()
} }
this.calendar.currentDate = new Date();
try {
this.myCal.update();
this.myCal.loadEvents();
this.onDropDownScrollWeal()
} catch (e) { }
this.updateEventListBox()
realoadCounter++; realoadCounter++;
this.weekToShow() this.weekToShow()
} }
@@ -298,8 +309,8 @@ export class AgendaPage implements OnInit {
let weekNum = 0; let weekNum = 0;
function Week(a) { function Week(a) {
for(let b of a.querySelectorAll('td')) { for (let b of a.querySelectorAll('td')) {
if(!b.className.includes('text-muted')) { if (!b.className.includes('text-muted')) {
weekNum++; weekNum++;
return true return true
} }
@@ -309,18 +320,18 @@ export class AgendaPage implements OnInit {
const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight
const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr'); const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr');
for (let week of weeks as any ){ for (let week of weeks as any) {
Week(week) Week(week)
} }
this.showCalendar = true this.showCalendar = true
this.listBoxService.height = (weekNum * dayBoxHeight) +'px' this.listBoxService.height = (weekNum * dayBoxHeight) + 'px'
if(dayBoxHeight == 0) { if (dayBoxHeight == 0) {
this.weekToShow() this.weekToShow()
} }
} catch (e) { } catch (e) {
setTimeout(()=> { setTimeout(() => {
this.weekToShow() this.weekToShow()
}, 100) }, 100)
} }
@@ -328,8 +339,8 @@ export class AgendaPage implements OnInit {
} }
setCalendarByDefault() { setCalendarByDefault() {
if(!this.CalendarName) { if (!this.CalendarName) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) { if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario'; this.CalendarName = 'Meu calendario';
} else { } else {
this.CalendarName = this.eventService.calendarNamesAry[0] this.CalendarName = this.eventService.calendarNamesAry[0]
@@ -410,13 +421,16 @@ export class AgendaPage implements OnInit {
onDropDownScrollWeal() { onDropDownScrollWeal() {
setTimeout(() => { try {
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
setTimeout(() => { setTimeout(() => {
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[1].scrollIntoView({ behavior: 'smooth', block: 'center' }); document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300) setTimeout(() => {
}, 10) document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[1].scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300)
}, 10)
} catch (error) {
console.log(error)
}
} }
@@ -424,10 +438,23 @@ export class AgendaPage implements OnInit {
this.eventSelectedDate2 = ev.selectedTime; this.eventSelectedDate2 = ev.selectedTime;
} }
currentMoth = {
rangeStartDate: null,
rangeEndDate: null
}
onRangeChanged(ev: { startTime: Date, endTime: Date }) { onRangeChanged(ev: { startTime: Date, endTime: Date }) {
this.rangeStartDate = ev.startTime; this.rangeStartDate = ev.startTime;
this.rangeEndDate = ev.endTime; this.rangeEndDate = ev.endTime;
if (this.currentMoth.rangeEndDate == null) {
this.currentMoth = {
rangeStartDate: ev.startTime,
rangeEndDate: ev.endTime
}
}
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
@@ -555,7 +582,7 @@ export class AgendaPage implements OnInit {
loadRangeEvents(startTime: Date, endTime: Date) { loadRangeEvents(startTime: Date, endTime: Date) {
this.weekToShow() this.weekToShow()
if(!this.eventService.hasAnyCalendar) { if (!this.eventService.hasAnyCalendar) {
return false return false
} }
@@ -565,9 +592,9 @@ export class AgendaPage implements OnInit {
this.showLoader = true; this.showLoader = true;
const index = `${startTime}${endTime}` const index = `${startTime}${endTime}`
if(!this.loadRequest[index]) { if (!this.loadRequest[index]) {
this.loadRequest[index] = {startTime, endTime} this.loadRequest[index] = { startTime, endTime }
this.loadRequestHistory[index] = {lastTimeUpdate: new Date()} this.loadRequestHistory[index] = { lastTimeUpdate: new Date() }
this.loadRangeEventRun(startTime, endTime) this.loadRangeEventRun(startTime, endTime)
} else { } else {
@@ -582,7 +609,7 @@ export class AgendaPage implements OnInit {
loadRangeEventRun(startTime: Date, endTime: Date) { loadRangeEventRun(startTime: Date, endTime: Date) {
if(SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) { if (SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
return false return false
} }
@@ -604,16 +631,16 @@ export class AgendaPage implements OnInit {
} }
let load = 0; let load = 0;
for ( const selectedCalendar of selectedCalendarIds) { for (const selectedCalendar of selectedCalendarIds) {
this.eventService.getEventsByCalendarId(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59'), selectedCalendar.CalendarId).then((response: any) => { this.eventService.getEventsByCalendarId(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59'), selectedCalendar.CalendarId).then((response: any) => {
let label; let label;
if(SessionStore.user.Profile == 'PR') { if (SessionStore.user.Profile == 'PR') {
label = "pr" label = "pr"
} else if(SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) { } else if (SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
label = 'md' label = 'md'
} else { } else {
label = "pr" label = "pr"
@@ -632,7 +659,7 @@ export class AgendaPage implements OnInit {
this.deleteLoadRangeEvent(startTime, endTime); this.deleteLoadRangeEvent(startTime, endTime);
load++ load++
if(load == selectedCalendarIds.length) { if (load == selectedCalendarIds.length) {
this.showLoader = false; this.showLoader = false;
} }
@@ -645,9 +672,9 @@ export class AgendaPage implements OnInit {
selectedAgenda = {} selectedAgenda = {}
getSelectedAgendaCalendars () { getSelectedAgendaCalendars() {
if(this.CalendarName == 'PR+MDGPR') { if (this.CalendarName == 'PR+MDGPR') {
let result = this.SessionStore.user.OwnerCalendars let result = this.SessionStore.user.OwnerCalendars
@@ -658,46 +685,46 @@ export class AgendaPage implements OnInit {
return result.concat(join) return result.concat(join)
} else { } else {
const calendar = this.eventService.calendarNamesType[this.CalendarName]; const calendar = this.eventService.calendarNamesType[this.CalendarName];
let Oficial = calendar?.['OficialId'] let Oficial = calendar?.['OficialId']
let Pessoal = calendar?.['PessoalId'] let Pessoal = calendar?.['PessoalId']
if(Oficial && Pessoal) { if (Oficial && Pessoal) {
return [ return [
{ {
CalendarId : Oficial, CalendarId: Oficial,
OwnerId: calendar.OwnerId, OwnerId: calendar.OwnerId,
CalendarName: calendar.CalendarName CalendarName: calendar.CalendarName
}, },
{ {
OwnerId: calendar.OwnerId, OwnerId: calendar.OwnerId,
CalendarId : Pessoal, CalendarId: Pessoal,
CalendarName: calendar.CalendarName CalendarName: calendar.CalendarName
}
]
} else if (Oficial) {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId: Oficial,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
}
} else {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId: Pessoal,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
} }
]
} else if (Oficial) {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId : Oficial,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
} }
} else {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId : Pessoal,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
}
}
} }
@@ -710,11 +737,26 @@ export class AgendaPage implements OnInit {
const selectedCalendarIds = this.getSelectedAgendaCalendars(); const selectedCalendarIds = this.getSelectedAgendaCalendars();
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds) this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) const year = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
this.TimelineMDList = year
const selectedDay = momentG(this.eventSelectedDate, 'dd', 'pt'); const yearName = momentG(new Date(this.eventSelectedDate), 'yyyy')
if(this.TimelineMDList[selectedDay]) { const monthName = momentG(new Date(this.eventSelectedDate), 'MMMM')
this.hasEventToday = true const dayName = momentG(new Date(this.eventSelectedDate), 'dd')
let YearIndex = year.findIndex( x => x.yearInfo.yearName == yearName)
if(YearIndex == 0) {
let MonthNameIndex = year[YearIndex].months.findIndex( x => x.monthInfo.monthName == monthName)
if(MonthNameIndex == 0) {
let DayNameIndex = year[YearIndex].months[MonthNameIndex].days.findIndex( x => x.daysInfo.dayName == dayName)
if(DayNameIndex == 0) {
this.hasEventToday = true
} else {
this.hasEventToday = false
}
} else {
this.hasEventToday = false
}
} else { } else {
this.hasEventToday = false this.hasEventToday = false
} }
@@ -742,10 +784,7 @@ export class AgendaPage implements OnInit {
} catch (e) { } } catch (e) { }
this.updateEventListBox() this.updateEventListBox()
} else { } else { }
}
} }
@@ -884,7 +923,7 @@ export class AgendaPage implements OnInit {
this.myCal.loadEvents(); this.myCal.loadEvents();
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
} }
} catch (error) { } catch (error) {
} }
@@ -899,7 +938,7 @@ export class AgendaPage implements OnInit {
let navigationExtras: NavigationExtras = { queryParams: { CalendarId } } let navigationExtras: NavigationExtras = { queryParams: { CalendarId } }
this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras); this.router.navigate(['/home/agenda/', eventId, 'agenda'], navigationExtras);
} }
@@ -914,13 +953,13 @@ export class AgendaPage implements OnInit {
this.postEvent = data.event; this.postEvent = data.event;
this.mobileComponent.showEditEvent = true; this.mobileComponent.showEditEvent = true;
} else if(data.type == 'delete') { } else if (data.type == 'delete') {
} }
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
setTimeout(()=>{ setTimeout(() => {
this.onCurrentChanged(this.eventSelectedDate) this.onCurrentChanged(this.eventSelectedDate)
}, 500) }, 500)
@@ -1129,10 +1168,8 @@ export class AgendaPage implements OnInit {
// THIS LINE // THIS LINE
this.updateEventListBox(); this.updateEventListBox();
} }
shoeEventDay(events: any[]) { shoeEventDay(events: any[]) {
if (this.segment == 'Combinado') { if (this.segment == 'Combinado') {
@@ -1150,3 +1187,18 @@ export class AgendaPage implements OnInit {
} }
} }
function endOfMonth(myDate) {
let date = new Date(myDate);
date.setDate(1); // Avoids edge cases on the 31st day of some months
date.setMonth(date.getMonth() + 1);
date.setDate(0);
date.setHours(23);
date.setMinutes(59);
date.setSeconds(59);
return date;
}
const addDays = 5;
const endDateRange = endOfMonth(new Date(5))
endDateRange.setDate(endDateRange.getDate() + addDays)
@@ -18,6 +18,7 @@ import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service' import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { ContactsService } from 'src/app/services/contacts.service'; import { ContactsService } from 'src/app/services/contacts.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: { parse: {
@@ -98,7 +99,8 @@ export class EditEventPage implements OnInit {
private router: Router, private router: Router,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle, private httpErrorHandle: HttpErrorHandle,
private contactsService: ContactsService private contactsService: ContactsService,
private domSanitazerService: DomSanitizerService
) { ) {
/* this.postEvent = new Event(); */ /* this.postEvent = new Event(); */
@@ -363,6 +365,9 @@ export class EditEventPage implements OnInit {
} }
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ) */;
this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ) */;
this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ) */;
this.postEvent.EventRecurrence.Type = this.selectedRecurringType; this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
@@ -22,6 +22,8 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: { parse: {
@@ -93,6 +95,9 @@ export class NewEventPage implements OnInit {
roomId: string; roomId: string;
globalEnd = new Date('1999') globalEnd = new Date('1999')
environment = environment environment = environment
eventPersons: EventPerson[];
contacts: EventPerson[];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
@@ -105,7 +110,9 @@ export class NewEventPage implements OnInit {
private chatMethodService: ChatMethodsService, private chatMethodService: ChatMethodsService,
private hhtpErrorHandle: HttpErrorHandle, private hhtpErrorHandle: HttpErrorHandle,
private processeService: ProcessesService, private processeService: ProcessesService,
public TaskService: TaskService public TaskService: TaskService,
private contactsService: ContactsService,
private domSanitazerService: DomSanitizerService
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.postEvent = new Event(); this.postEvent = new Event();
@@ -196,6 +203,7 @@ export class NewEventPage implements OnInit {
this.checkRoleInArray() this.checkRoleInArray()
this.changeAgenda() this.changeAgenda()
this.fetchContacts("")
} }
ngOnDestroy() { ngOnDestroy() {
@@ -407,6 +415,9 @@ export class NewEventPage implements OnInit {
} }
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this.postEvent.Subject = this.domSanitazerService.sanitizeInput(this.postEvent.Subject);
this.postEvent.Location = this.domSanitazerService.sanitizeInput(this.postEvent.Location);
this.postEvent.Body.Text = this.domSanitazerService.sanitizeInput(this.postEvent.Body.Text);
let eventId: any; let eventId: any;
@@ -831,4 +842,33 @@ export class NewEventPage implements OnInit {
return toAproveObject; return toAproveObject;
} }
async fetchContacts(filter: string) {
if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
});
result.splice(index, 1);
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
console.log('Attendes Email', this.contacts)
}
);
}
}
} }
@@ -11,7 +11,7 @@
<div class="title-content d-flex justify-between width-100 mb-10"> <div class="title-content d-flex justify-between width-100 mb-10">
<div class="left d-flex"> <div class="left d-flex">
<button class="btn-no-color d-flex align-center" (click)="goBack()"> <button class="btn-no-color d-flex align-center" (click)="goBack()">
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-calendar-arrow-left.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-calendar-arrow-left.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-calendar-arrow-left.svg'></ion-icon>
</button> </button>
@@ -40,7 +40,6 @@
<i class="far fa-clock font-15"></i> <i class="far fa-clock font-15"></i>
<ion-label class="font-15 pl-10" color="warning">{{roomCountDownDate}}</ion-label> <ion-label class="font-15 pl-10" color="warning">{{roomCountDownDate}}</ion-label>
</div> </div>
{{ RouteService.history }}
</div> </div>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
@@ -32,6 +32,10 @@ import { SessionStore } from 'src/app/store/session.service';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera'; import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { FileValidatorService } from "src/app/services/file/file-validator.service"
import { sanitize } from "sanitize-filename-ts";
@Component({ @Component({
selector: 'app-group-messages', selector: 'app-group-messages',
templateUrl: './group-messages.page.html', templateUrl: './group-messages.page.html',
@@ -104,6 +108,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
private file: File, private file: File,
private fileOpener: FileOpener, private fileOpener: FileOpener,
public RouteService: RouteService, public RouteService: RouteService,
private FileValidatorService: FileValidatorService
) { ) {
this.ChatSystemService.getUser() this.ChatSystemService.getUser()
@@ -507,7 +512,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
"mimeType": audioFile.value.mimeType, "mimeType": audioFile.value.mimeType,
}, },
attachments: [{ attachments: [{
"title": fileName, "title": sanitize(fileName),
"title_link_download": true, "title_link_download": true,
"type": "audio" "type": "audio"
}], }],
@@ -828,37 +833,45 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types); const file: any = await this.fileService.getFileFromDevice(types);
const fileName = file.name
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") { const validation = this.FileValidatorService.fileNameValidation(fileName)
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => { if(validation.isOk) {
console.error(error);
})));
const blob = this.fileService.base64toBlob(encodedData, file.type)
const formData = new FormData(); if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
formData.append('blobFile', blob);
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
console.error(error);
})));
const blob = this.fileService.base64toBlob(encodedData, file.type)
const formData = new FormData();
formData.append('blobFile', blob);
this.ChatSystemService.getGroupRoom(roomId).send({ this.ChatSystemService.getGroupRoom(roomId).send({
file: { file: {
"type": file.type, "type": file.type,
"guid": '', "guid": '',
}, },
attachments: [{ attachments: [{
"title": file.name, "title": sanitize(fileName),
"name": file.name, "name": sanitize(fileName),
// "text": "description", // "text": "description",
"title_link_download": false, "title_link_download": false,
}], }],
temporaryData: formData, temporaryData: formData,
attachmentsModelData: { attachmentsModelData: {
fileBase64: encodedData fileBase64: encodedData
} }
}); });
} else {
}
} else { } else {
this.toastService._badRequest("Ficheiro inválido")
} }
} }
@@ -23,7 +23,7 @@
</div> </div>
<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/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg">
</ion-icon> </ion-icon>
</button> </button>
+39 -36
View File
@@ -33,6 +33,10 @@ import { Filesystem, Directory } from '@capacitor/filesystem';
import { NewEventPage } from '../../agenda/new-event/new-event.page'; import { NewEventPage } from '../../agenda/new-event/new-event.page';
import { NotificationsService } from 'src/app/services/notifications.service'; import { NotificationsService } from 'src/app/services/notifications.service';
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service' import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
import { FileValidatorService } from "src/app/services/file/file-validator.service"
import { sanitize } from "sanitize-filename-ts";
const IMAGE_DIR = 'stored-images'; const IMAGE_DIR = 'stored-images';
@@ -117,6 +121,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private fileOpener: FileOpener, private fileOpener: FileOpener,
private router: Router, private router: Router,
public RochetChatConnectorService: RochetChatConnectorService, public RochetChatConnectorService: RochetChatConnectorService,
private FileValidatorService: FileValidatorService
) { ) {
try { try {
@@ -413,12 +418,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`; this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
} }
//Converting base64 to blob //Converting base64 to blob
const encodedData = btoa(this.audioRecorded); const encodedData = btoa(this.audioRecorded);
const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType) const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType)
const validation = await this.FileValidatorService.validateAudioFromBlob(blob)
const formData = new FormData(); const formData = new FormData();
formData.append("blobFile", blob); formData.append("blobFile", blob);
@@ -429,7 +435,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
"mimeType": audioFile.value.mimeType, "mimeType": audioFile.value.mimeType,
}, },
attachments: [{ attachments: [{
"title": fileName, "title": sanitize(fileName),
"title_link_download": true, "title_link_download": true,
"type": "audio" "type": "audio"
}], }],
@@ -759,7 +765,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async addFileToChatMobile(types: typeof FileType[]) { async addFileToChatMobile(types: typeof FileType[]) {
console.log('add image from gallery')
const roomId = this.roomId const roomId = this.roomId
const file = await Camera.getPhoto({ const file = await Camera.getPhoto({
@@ -852,43 +857,41 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
formData.append('blobFile', blob); formData.append('blobFile', blob);
console.log('add file', fileBase64) */ console.log('add file', fileBase64) */
const fileName = file.name
const validation = this.FileValidatorService.fileNameValidation(fileName)
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") { if(validation.isOk) {
console.log('TYPE', file.type)
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => { const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
console.error(error); console.error(error);
}))); })));
console.log(encodedData) console.log(encodedData)
const blob = this.fileService.base64toBlob(encodedData, file.type) const blob = this.fileService.base64toBlob(encodedData, file.type)
console.log('BLOB BLOB', blob)
const formData = new FormData();
formData.append('blobFile', blob);
/* console.log('add file', fileBase64) */
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
},
attachments: [{
"title": file.name,
"name": file.name,
// "text": "description",
"title_link_download": false,
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: encodedData,
}
});
} else {
console.log('file not supported')
}
const formData = new FormData();
formData.append('blobFile', blob);
/* console.log('add file', fileBase64) */
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
},
attachments: [{
"title": sanitize(fileName),
"name": sanitize(fileName),
// "text": "description",
"title_link_download": false,
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: encodedData,
}
});
} else {
this.toastService._badRequest("Ficheiro inválido")
}
} }
@@ -153,16 +153,16 @@ export class AttendeesPageModal implements OnInit {
this.showLoader = false; this.showLoader = false;
} else { } else {
this.contacts = result; this.contacts = result;
console.log('Attendes Email',this.loggeduser.Email) // console.log('Attendes Email',this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase()) let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase())
if(this.taskType == 0 || this.taskType == 1){ if(this.taskType == 0 || this.taskType == 1){
filterLoggedUserEmail = this.contacts.filter(item => item.IsPR == false) filterLoggedUserEmail = this.contacts.filter(item => item.IsPR == false)
} }
console.log('Attendes Email', filterLoggedUserEmail) // console.log('Attendes Email', filterLoggedUserEmail)
let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "") let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "")
this.contacts = filterEmptyEmail; this.contacts = filterEmptyEmail;
console.log('Attendes Email', this.contacts) //console.log('Attendes Email', this.contacts)
this.showLoader = false; this.showLoader = false;
} }
+2 -1
View File
@@ -311,7 +311,8 @@ label {
.time { .time {
font-family: Roboto; font-family: Roboto;
text-align: center; text-align: center;
color: var(--header-tab-text-white); /* color: var(--header-tab-text-white); */
color: black;
line-height: unset; line-height: unset;
margin-top: 10px; margin-top: 10px;
width: 100%; width: 100%;
@@ -12,7 +12,7 @@
<div class="title">{{ task.Folio}}</div> <div class="title">{{ task.Folio}}</div>
</div> </div>
<div class="div-icon" (click)="openOptions()"> <div class="div-icon" (click)="openOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-25 cursor-pointer" src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-25 cursor-pointer" src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-25 cursor-pointer" src="assets/images/theme/gov/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-25 cursor-pointer" src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-25 cursor-pointer" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-25 cursor-pointer" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
</div> </div>
@@ -97,7 +97,7 @@
</div> </div>
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'"> <div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (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 *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (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('Reexecutar')" class="btn-cancel" shape="round" >Enviar para Reexecuçã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.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</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 *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
@@ -328,7 +328,7 @@ export class DespachoPrPage 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": "Reexecução", "action": "Reexecutar",
"ActionTypeId": 100000010, "ActionTypeId": 100000010,
"dataFields": { "dataFields": {
"ReviewUserComment": note, "ReviewUserComment": note,
@@ -416,7 +416,7 @@ export class DespachoPrPage implements OnInit {
// console.log('actionName', actionName) // console.log('actionName', actionName)
await this.concluir(res.data.note, docs); await this.concluir(res.data.note, docs);
} }
else if (actionName == 'Reexecução') { else if (actionName == 'Reexecutar') {
await this.reexecutar(res.data.note, docs); await this.reexecutar(res.data.note, docs);
} }
@@ -12,7 +12,7 @@
<ion-label class="title">{{ task.Folio }}</ion-label> <ion-label class="title">{{ task.Folio }}</ion-label>
</div> </div>
<div class="div-icon" (click)="openOptions()" *ngIf="p.userPermission([p.permissionList.Agenda.access])"> <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/theme/blue/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>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
</div> </div>
@@ -21,7 +21,7 @@
<div class="solid"></div> <div class="solid"></div>
</div> </div>
<div class="buttons"> <div class="buttons">
<button class="btn-cancel" shape="round" >Arquivar</button> <button class="btn-cancel" shape="round" (click)="openAddNoteModal('Arquivo')">Arquivar</button>
<!-- <div class="solid"></div> --> <!-- <div class="solid"></div> -->
</div> </div>
<div class="buttons"> <div class="buttons">
@@ -504,7 +504,7 @@ export class DiplomaAssinarPage implements OnInit {
}); });
await Promise.all(draftPromises); await Promise.all(draftPromises);
if(this.draftArray.length == 0 ) { if (this.draftArray.length == 0) {
console.log('No draft found.'); console.log('No draft found.');
this.asDraft = false this.asDraft = false
} }
@@ -28,7 +28,7 @@
</div> </div>
<div class="menu-ptions"> <div class="menu-ptions">
<button class="btn-no-color" (click)="openOptions(loadedEvent)"> <button class="btn-no-color" (click)="openOptions(loadedEvent)">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/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>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</button> </button>
@@ -232,7 +232,7 @@
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div> </div>
<div class="ion-input-class-no-height"> <div class="ion-input-class-no-height cursor-pointer" (click)="addParticipantsCc()">
<div class="list-people"> <div class="list-people">
<ion-item lines="none"> <ion-item lines="none">
<ion-list> <ion-list>
@@ -241,7 +241,7 @@
</ion-list> </ion-list>
</ion-item> </ion-item>
</div> </div>
<div class="add-people" (click)="addParticipantsCc()"> <div class="add-people" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon>
@@ -294,7 +294,7 @@
</div> </div>
</div> </div>
<div *ngIf="sessionStore.user.Profile != 'PR'" class="aside-righ flex-grow-1"> <div class="aside-righ flex-grow-1">
<app-empty-container <app-empty-container
[texto]="emptyTextDescription" [texto]="emptyTextDescription"
*ngIf="!showAttendees" *ngIf="!showAttendees"
@@ -23,6 +23,7 @@ import { RoleIdService } from 'src/app/services/role-id.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
const moment = _rollupMoment || _moment; const moment = _rollupMoment || _moment;
@@ -114,6 +115,9 @@ export class BookMeetingModalPage implements OnInit {
sessionStore = SessionStore; sessionStore = SessionStore;
environment = environment environment = environment
loggeduser: LoginUserRespose;
eventPersons: EventPerson[];
contacts: EventPerson[];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
@@ -125,7 +129,8 @@ export class BookMeetingModalPage implements OnInit {
public eventService: EventsService, public eventService: EventsService,
public RoleIdService: RoleIdService, public RoleIdService: RoleIdService,
private httpErroHandle: HttpErrorHandle, private httpErroHandle: HttpErrorHandle,
public TaskService: TaskService public TaskService: TaskService,
private contactsService: ContactsService,
) { ) {
@@ -136,7 +141,7 @@ export class BookMeetingModalPage implements OnInit {
console.log('fulltask', this.fulltask) console.log('fulltask', this.fulltask)
if(this.fulltask?.Documents) { if (this.fulltask?.Documents) {
this.documents = this.fulltask.Documents this.documents = this.fulltask.Documents
} }
@@ -174,6 +179,7 @@ export class BookMeetingModalPage implements OnInit {
} }
this.changeAgenda(); this.changeAgenda();
this.loggeduser = SessionStore.user;
} }
ngOnInit() { ngOnInit() {
@@ -182,6 +188,7 @@ export class BookMeetingModalPage implements OnInit {
this.getAttachments(); this.getAttachments();
this.setDefaultTime() this.setDefaultTime()
this.getRecurrenceTypes(); this.getRecurrenceTypes();
this.fetchContacts("")
} }
@@ -191,8 +198,8 @@ export class BookMeetingModalPage implements OnInit {
} }
myInterval = setInterval(() => { myInterval = setInterval(() => {
document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => { document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => {
if(e) { if (e) {
e.disabled = true; e.disabled = true;
} }
}) })
@@ -327,8 +334,8 @@ export class BookMeetingModalPage implements OnInit {
return { return {
ApplicationId: e.ApplicationType || e.ApplicationId, ApplicationId: e.ApplicationType || e.ApplicationId,
Source: 1, Source: 1,
SourceId: e.Id || e.DocId || e.SourceId, SourceId: e.Id || e.DocId || e.SourceId,
SourceName:e.Assunto, SourceName: e.Assunto,
Description: e.Assunto, Description: e.Assunto,
Stakeholders: e.EntidadeOrganicaNome Stakeholders: e.EntidadeOrganicaNome
} }
@@ -417,7 +424,7 @@ export class BookMeetingModalPage implements OnInit {
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
console.log('attenes return', data)
if (data) { if (data) {
data = data['data']; data = data['data'];
@@ -587,4 +594,33 @@ export class BookMeetingModalPage implements OnInit {
this.postData.EndDate = this.postData.StartDate; this.postData.EndDate = this.postData.StartDate;
} }
async fetchContacts(filter: string) {
console.log(this.loggeduser)
if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
});
result.splice(index, 1);
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
console.log('Attendes Email', this.contacts)
}
);
}
}
} }
@@ -97,7 +97,7 @@
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div> </div>
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom "> <div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom || validateField ">
<!-- <ion-item <!-- <ion-item
class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none"> class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none">
<ion-select <ion-select
@@ -112,7 +112,7 @@
appearance="fill" appearance="fill"
class="width-100 d-block" class="width-100 d-block"
appearance="none"> appearance="none">
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de assunto*"> <mat-select [multiple]="false" [(ngModel)]="selectedTypes" placeholder="{{placeholderSubject}}">
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option> <mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@@ -69,7 +69,7 @@ export class ExpedientTaskModalPage implements OnInit {
loadedAttachments:any; loadedAttachments:any;
documents:SearchList[] = []; documents:SearchList[] = [];
subjectTypes:any[] = []; subjectTypes:any;
selectedTypes: string[]=[]; selectedTypes: string[]=[];
SearchFolder: any = [] SearchFolder: any = []
@@ -96,6 +96,7 @@ export class ExpedientTaskModalPage implements OnInit {
validateFrom = false; validateFrom = false;
validateField = false; validateField = false;
document: any document: any
placeholderSubject: string;
get toppingsValues() { get toppingsValues() {
return this.toppings.value; return this.toppings.value;
@@ -124,40 +125,38 @@ export class ExpedientTaskModalPage implements OnInit {
this.SearchFolder = this.navParams.get('SearchFolder'); this.SearchFolder = this.navParams.get('SearchFolder');
this.aplicationId = this.navParams.get('aplicationId') this.aplicationId = this.navParams.get('aplicationId')
// this.document = this.navParams.get('document') this.document = this.navParams.get('document')
this.taskType = this.navParams.get('taskAction'); this.taskType = this.navParams.get('taskAction');
// try {
// if(this.document) { // if(this.document) {
// const doc: any = this.document // const doc: any = this.document
// this.documents.push({
// this.documents.push({ // ApplicationId: (doc.ApplicationType || doc.ApplicationId),
// ApplicationId: (doc.ApplicationType || doc.ApplicationId), // ApplicationType: (doc.ApplicationType || doc.ApplicationId),
// ApplicationType: (doc.ApplicationType || doc.ApplicationId), // SourceId: (doc.Id || doc.DocId || doc.SourceId),
// SourceId: (doc.Id || doc.DocId || doc.SourceId), // Id: (doc.Id || doc.DocId || doc.SourceId),
// Id: (doc.Id || doc.DocId || doc.SourceId), // EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
// EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome), // Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
// Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome), // Data: (doc.DocDate || doc.Data),
// Data: (doc.DocDate || doc.Data), // DocDate: (doc.DocDate || doc.Data),
// DocDate: (doc.DocDate || doc.Data), // Assunto: doc.Assunto,
// Assunto: doc.Assunto, // } as any)
// } as any) // }
// } catch (error) {
// console.log(error)
// } // }
// console.log('this.document', this.document)
const DocumentToSave = this.documents.map((e) => {
return {
ApplicationId: e.ApplicationType,
SourceId: e.Id
}
});
console.log('this.document', this.document) if(this.loggeduser.Profile == 'PR') {
this.selectedTypes = ['99999850'];
this.placeholderSubject = 'Indefinido'
this.selectedTypes = ['99999850']; } else {
this.placeholderSubject = 'Selecione o tipo de assunto*'
}
this.postData = new Despacho(); this.postData = new Despacho();
this.participants = this.participants = new Array(); this.participants = this.participants = new Array();
@@ -461,16 +460,22 @@ export class ExpedientTaskModalPage implements OnInit {
} }
} }
/* if(this.postData.DispatchFolder.Message){ */ /* if(this.postData.DispatchFolder.Message){
try { if(this.selectedTypes.length > 0) { */
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise(); try {
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho') this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
this.modalController.dismiss(action_despacho_pr); await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
} catch (error) { this.modalController.dismiss(action_despacho_pr);
this.httpErroHandle.httpStatusHandle(error) } catch (error) {
} finally { this.httpErroHandle.httpStatusHandle(error)
//loader.remove() } finally {
} //loader.remove()
}
/* } else {
this.validateField = true;
this.toastService._badRequest('Por favor selecione um assunto');
} */
/* } /* }
else{ else{
this.validateField = true; this.validateField = true;
@@ -17,7 +17,7 @@
</div> </div>
<div class="menu-ptions"> <div class="menu-ptions">
<button class="btn-no-color d-flex" (click)="openOptions()"> <button class="btn-no-color d-flex" (click)="openOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/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>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</button> </button>
@@ -21,7 +21,7 @@
</div> </div>
<div class="menu-ptions"> <div class="menu-ptions">
<button class="btn-no-color" (click)="openOptions()"> <button class="btn-no-color" (click)="openOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/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>
@@ -14,7 +14,7 @@
</div> </div>
<div class="div-icon d-flex"> <div class="div-icon d-flex">
<div autoHide="false" class="d-flex" (click)="openOptions()"> <div autoHide="false" class="d-flex" (click)="openOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-30-rem cursor-pointer" src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-30-rem cursor-pointer" src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-30-rem cursor-pointer" src="assets/images/theme/gov/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-30-rem cursor-pointer" src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</div> </div>
</div> </div>
+3 -2
View File
@@ -7,15 +7,16 @@
<div class="bg-4 d-flex justify-center align-center"> <div class="bg-4 d-flex justify-center align-center">
<div class="div-logo"> <div class="div-logo">
<img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/fullLogo-no-g.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/donit.jpg' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A.png' alt='logo'> <img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/doneit.jpg' alt='logo'>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- <h3 class="center text-white">doneIT</h3> -->
<h3 class="center text-white">Gabinete Digital</h3> <h3 class="center text-white">Gabinete Digital</h3>
<form class="form"> <form class="form">
<p class="form-label">Email</p> <p class="form-label">Email</p>
+12 -1
View File
@@ -112,8 +112,15 @@ export class LoginPage implements OnInit {
if (this.validateUsername()) { if (this.validateUsername()) {
if (this.validatePassword()) { if (this.validatePassword()) {
let newUserName = ""
if (this.usernameAsDomain(environment.domain, this.username.trim())) {
newUserName = this.username.trim();
} else {
newUserName = this.username.trim() + "@" + environment.domain;
}
this.userattempt = { this.userattempt = {
username: this.username.trim(), username: newUserName.trim(),
password: this.password.trim(), password: this.password.trim(),
domainName: environment.domain, domainName: environment.domain,
BasicAuthKey: "" BasicAuthKey: ""
@@ -233,4 +240,8 @@ export class LoginPage implements OnInit {
} }
usernameAsDomain(substring, mainString) {
return mainString.includes(substring);
}
} }
@@ -30,6 +30,7 @@ import { Capacitor } from '@capacitor/core';
import { File } from '@ionic-native/file/ngx'; import { File } from '@ionic-native/file/ngx';
import { Media } from '@ionic-native/media/ngx'; import { Media } from '@ionic-native/media/ngx';
import { checkFileTypeService } from 'src/app/services/checkFileType.service'; import { checkFileTypeService } from 'src/app/services/checkFileType.service';
import { FileValidatorService } from "src/app/services/file/file-validator.service"
const config = { const config = {
quality: 0.5, quality: 0.5,
maxWidth: 800, maxWidth: 800,
@@ -130,7 +131,8 @@ export class NewPublicationPage implements OnInit {
private RouteService: RouteService, private RouteService: RouteService,
public FileService: FileService, public FileService: FileService,
private mediaCapture: MediaCapture, private mediaCapture: MediaCapture,
public checkFileType: checkFileTypeService public checkFileType: checkFileTypeService,
private FileValidatorService: FileValidatorService
) { ) {
this.publicationType = this.navParams.get('publicationType'); this.publicationType = this.navParams.get('publicationType');
@@ -695,3 +697,4 @@ export class NewPublicationPage implements OnInit {
} }
@@ -19,6 +19,9 @@
<div class="title-content width-100 d-flex justify-space-between"> <div class="title-content width-100 d-flex justify-space-between">
<div class="div-title flex-grow-1"> <div class="div-title flex-grow-1">
<ion-label class="title font-25-em">Acções</ion-label> <ion-label class="title font-25-em">Acções</ion-label>
<!-- <div>
<input type="file" (change)="onFileSelect($event)" />
</div> -->
</div> </div>
<div *ngIf="!intent" class="div-icon"> <div *ngIf="!intent" class="div-icon">
@@ -15,6 +15,10 @@ import { ThemeService } from 'src/app/services/theme.service'
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
import { NewPublicationPage } from './new-publication/new-publication.page'; import { NewPublicationPage } from './new-publication/new-publication.page';
import { ChunkService } from 'src/app/services/stream/chunk.service'
import { StreamService } from 'src/app/services/stream/stream.service'
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
// import { ActionModel } from 'src/app/models/beast-orm'; // import { ActionModel } from 'src/app/models/beast-orm';
@@ -70,6 +74,9 @@ export class PublicationsPage implements OnInit {
public ThemeService: ThemeService, public ThemeService: ThemeService,
public p: PermissionService, public p: PermissionService,
private storage: Storage, private storage: Storage,
private ChunkService: ChunkService,
private StreamService:StreamService,
private http: HttpClient,
) { ) {
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"];
@@ -228,6 +235,50 @@ export class PublicationsPage implements OnInit {
} }
async onFileSelect(event: any) {
const file:File = event.target.files[0];
const chunkSize = 1024 * 1024; // Adjust the chunk size as needed
const chunks = [];
let offset = 0;
let i = 0;
let j = 0;
function count () {
j++
return j
}
while (offset < file.size) {
const chunk = file.slice(offset, offset + chunkSize);
const reader = new FileReader();
reader.onload = async () => {
const headers = new HttpHeaders()
.append('X-File-Name', "fileName")
.append('X-File-Extension', "mp4")
.append('X-File-Content-Length', i.toString())
.append('X-File-Index', count().toString());
const a = new Uint8Array(reader.result as ArrayBuffer)
await this.http.post('http://localhost:3001/upload', a.buffer, { headers, responseType: 'blob' }).toPromise();
};
reader.readAsArrayBuffer(chunk);
offset += chunkSize;
i++;
}
}
async editAction(folderId?: string) { async editAction(folderId?: string) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: EditActionPage, component: EditActionPage,
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { MiddlewareRepositoryService } from './middleware-repository.service';
describe('MiddlewareRepositoryService', () => {
let service: MiddlewareRepositoryService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(MiddlewareRepositoryService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,16 @@
import { Injectable } from '@angular/core';
import { MiddlewareRemoteDatasourcecService } from "src/app/datasource/middleware/remote/middleware-remote-datasourcec.service";
@Injectable({
providedIn: 'root'
})
export class MiddlewareRepositoryService {
constructor(
private MiddlewareRemoteDatasourcecService: MiddlewareRemoteDatasourcecService,
) {}
refreshToken() {
return this.MiddlewareRemoteDatasourcecService.refreshToken()
}
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { DomSanitizerService } from './DomSanitizer.service';
describe('ActiveTabService', () => {
let service: DomSanitizerService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DomSanitizerService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+38
View File
@@ -0,0 +1,38 @@
import { Injectable, SecurityContext } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { Router } from '@angular/router';
import DOMPurify from 'dompurify';
@Injectable({
providedIn: 'root'
})
export class DomSanitizerService {
constructor(private sanitizer: DomSanitizer) {
}
sanitizeInput(input: string) {
// Encode special characters to prevent XSS attacks
const encodedInput = this.encodeSpecialCharacters(input);
// Use DomSanitizer to sanitize the content
return this.sanitizer.sanitize(SecurityContext.HTML, encodedInput);
}
private encodeSpecialCharacters(input: string): string {
// You can use a library like DOMPurify to encode special characters
return DOMPurify.sanitize(input);
// If you don't want to use an external library, you can manually encode
// Here's a simple example, you may need to extend this based on your requirements
/* return input.replace(/</g, '&lt;').replace(/>/g, '&gt;'); */
}
/* sanitizeInput(input: string): string {
return this.sanitizer.sanitize(SecurityContext.HTML, input);
} */
}
+10
View File
@@ -0,0 +1,10 @@
export type Either<T, E> = { isOk: true; isError: false, value: T } | { isOk: false; isError: true, error: E };
export function ok<T, E>(value: T): Either<T, E> {
return { isOk: true, isError: false, value };
}
export function error<T, E>(error: E): Either<T, E> {
return { isOk: false, isError: true, error};
}
+214 -17
View File
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { CustomCalendarEvent, EventListStore } from 'src/app/models/agenda/AgendaEventList'; import { CustomCalendarEvent, EventListStore } from 'src/app/models/agenda/AgendaEventList';
import { DateService } from '../date.service'; import { DateService } from '../date.service';
import { momentG } from 'src/plugin/momentG';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -9,6 +10,7 @@ export class ListBoxService {
height = "unset" height = "unset"
constructor( constructor(
private dateService: DateService private dateService: DateService
){} ){}
@@ -35,7 +37,7 @@ export class ListBoxService {
daysBetween(){ } daysBetween(){ }
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) { list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}): Year[] {
// // filter range // // filter range
// if(selectedDate) { // if(selectedDate) {
@@ -45,7 +47,6 @@ export class ListBoxService {
// ) // )
// } // }
if(segment!='Combinado') { if(segment!='Combinado') {
eventSource = this.filterSegment(eventSource, segment) eventSource = this.filterSegment(eventSource, segment)
} }
@@ -54,18 +55,60 @@ export class ListBoxService {
// eventSource = this.filterProfile(eventSource, profile) // eventSource = this.filterProfile(eventSource, profile)
// } // }
let newStracture:CustomCalendarEvent[]; let newStracture:CustomCalendarEvent[];
newStracture = this.encapsulation(eventSource); newStracture = this.encapsulation(eventSource);
return this.display(newStracture, selectedDate) // const object = {}
// for (const e of newStracture.reverse()) {
// if(!object[momentG(new Date(e.start), 'MMMM yyyy')]) {
// object[momentG(new Date(e.start), 'MMMM yyyy')] = []
// }
// object[momentG(new Date(e.start), 'MMMM yyyy')].push(e)
// }
// console.log({object})
// const daysStringNum = Object.keys(object).reverse()
// const daysObject = {}
// for(const day of daysStringNum) {
// daysObject[day] = object[day]
// }
// console.log({daysObject})
return this.display(newStracture, selectedDate).year
// console.log({daysObject})
// const daysStringNum = Object.keys(daysObject)
// for(const day of daysStringNum) {
// daysObject[day] = daysObject[day].reverse()
// }
// daysObject = this.transformObjectKeyOrder(daysObject, daysStringNum)
// return daysObject
} }
sortArrayISODate(myArray: any): any[] {
return myArray.sort((a,b) =>
Date.parse(b.start )
-
Date.parse(a.start))
}
display(list: CustomCalendarEvent[], selectedDate) { display(list: CustomCalendarEvent[], selectedDate) {
let days = {}; let days = {};
const year: Year[] = []
list.forEach( (event:CustomCalendarEvent, index) => { this.sortArrayISODate(list).reverse().forEach( (event:CustomCalendarEvent, index) => {
var startDate: any = new Date(event.start); var startDate: any = new Date(event.start);
@@ -95,7 +138,7 @@ export class ListBoxService {
const StartEvent = this.transForm(event, {startMany: true, endMany: false, middle: false}) const StartEvent = this.transForm(event, {startMany: true, endMany: false, middle: false})
if(this.CanPush(event, selectedDate)) days[day].push(StartEvent) if(this.CanPush(event, selectedDate)) {days[day].push(StartEvent); this.push(StartEvent, year)}
let i = 1; let i = 1;
@@ -121,26 +164,28 @@ export class ListBoxService {
// last push // last push
const EndEvent = this.transForm(event, {startMany: false, endMany: true, middle: false}) const EndEvent = this.transForm(event, {startMany: false, endMany: true, middle: false})
if(this.CanPush(event, selectedDate)) days[otherDays].push(EndEvent) if(this.CanPush(event, selectedDate)) {days[otherDays].push(EndEvent) ; this.push(event, year)}
} else { } else {
const EndEvent = this.transForm(event, {startMany: false,endMany: true, middle: true}) const EndEvent = this.transForm(event, {startMany: false,endMany: true, middle: true})
if(this.CanPush(event, selectedDate)) days[otherDays].push(EndEvent) if(this.CanPush(event, selectedDate)) {days[otherDays].push(EndEvent) ; this.push(event, year)}
} }
days[otherDays] = days[otherDays].reverse()
} }
} else { } else {
if(this.CanPush(event, selectedDate)) days[day].push(event) if(this.CanPush(event, selectedDate)) { days[day].push(event) ; this.push(event, year) }
} }
} else { } else {
if(this.CanPush(event, selectedDate)) days[day].push(event) if(this.CanPush(event, selectedDate)) { days[day].push(event) ; this.push(event, year) }
} }
} else { } else {
if(this.CanPush(event, selectedDate) && diffDays != 2) days[day].push(event) if(this.CanPush(event, selectedDate) && diffDays != 2) { days[day].push(event) ; this.push(event, year) }
} }
// //
@@ -157,14 +202,73 @@ export class ListBoxService {
}) })
return days return {days, year}
} }
push(event: any, year: Year[]) {
const date = new Date(event.start)
const yearName = momentG(new Date(date), 'yyyy')
const monthName = momentG(new Date(date), 'MMMM')
const dayName = momentG(new Date(date), 'dd')
let YearIndex = year.findIndex( x => x.yearInfo.yearName == yearName)
if(YearIndex == -1) {
YearIndex = year.push({
yearInfo: {
yearName: yearName
},
months: []
})
YearIndex--
}
let MonthNameIndex = year[YearIndex].months.findIndex( x => x.monthInfo.monthName == monthName)
if(MonthNameIndex == -1) {
MonthNameIndex = year[YearIndex].months.push({
monthInfo: {
monthName: monthName
},
days: []
})
MonthNameIndex --
}
let DayNameIndex = year[YearIndex].months[MonthNameIndex].days.findIndex( x => x.daysInfo.dayName == dayName)
if(DayNameIndex == -1) {
year[YearIndex].months[MonthNameIndex].days.push({
daysInfo: {
dayName: dayName
},
events: [event]
})
} else {
year[YearIndex].months[MonthNameIndex].days[DayNameIndex].events.push(event)
}
}
CanPush(event: any, selectedDate: Date) { CanPush(event: any, selectedDate: Date) {
return new Date(event.start).getMonth() == selectedDate.getMonth() && const limite = this.endOfMonth(selectedDate)
new Date(event.start).getFullYear() == selectedDate.getFullYear() && limite.setDate(limite.getDate() + 10)
new Date(event.start).getDate() >= selectedDate.getDate() limite.setHours(0)
selectedDate.setHours(0);
selectedDate.setMinutes(0);
selectedDate.setSeconds(0);
return (selectedDate.getTime() <= new Date(event.start).getTime() || selectedDate.getTime() <= new Date(event.end).getTime()) &&
(limite.getTime() >= new Date(event.start).getTime() || limite.getTime() >= new Date(event.end).getTime())
} }
encapsulation(eventsList:EventListStore[]): CustomCalendarEvent[] { encapsulation(eventsList:EventListStore[]): CustomCalendarEvent[] {
@@ -209,4 +313,97 @@ export class ListBoxService {
}) })
} }
transformObjectKeyOrder(originalObject, keyOrder) {
const transformedObject = {};
for (const key of keyOrder) {
if (originalObject.hasOwnProperty(key)) {
transformedObject[key] = originalObject[key];
}
}
// Include any remaining keys not in the specified order
for (const key in originalObject) {
if (!keyOrder.includes(key) && originalObject.hasOwnProperty(key)) {
transformedObject[key] = originalObject[key];
}
}
return transformedObject;
}
endOfMonth(myDate){
let date = new Date(myDate);
date.setDate(1); // Avoids edge cases on the 31st day of some months
date.setMonth(date.getMonth() +1);
date.setDate(0);
date.setHours(23);
date.setMinutes(59);
date.setSeconds(59);
return date;
}
} }
interface DayInfo {
// Define properties for dayInfo here
dayName: string
}
interface Day {
// Define properties for day here
}
interface Month {
monthInfo: {
monthName: string
// Define properties for yearInfo inside months here
}
days: {
daysInfo: DayInfo;
events: Day[];
}[]
}
interface Year {
yearInfo: {
yearName: string
// Define properties for yearInfo here
};
months: Month[];
}
const years: Year[] = [
{
yearInfo: {
yearName: ""
// Define properties for yearInfo inside the first year here
},
months: [
{
monthInfo: {
monthName: "",
// Define properties for yearInfo inside the first month here
},
days: [
{
daysInfo: {
dayName: "",
// Define properties for dayInfo inside the first day here
},
events: [
{
// Define properties for the first day here
},
],
}
],
},
// Add more months here as needed
],
},
// Add more years here as needed
];
+2
View File
@@ -319,6 +319,8 @@ export class MessageService {
if(params?.attachments) { if(params?.attachments) {
if(params?.attachments[0]?.image_url) { if(params?.attachments[0]?.image_url) {
delete params?.attachments[0]?.image_url delete params?.attachments[0]?.image_url
delete params?.file?.image_url
// delete
} }
} }
@@ -0,0 +1,8 @@
import { InputFilterDirective } from './input-filter.directive';
describe('InputFilterDirective', () => {
it('should create an instance', () => {
const directive = new InputFilterDirective();
expect(directive).toBeTruthy();
});
});
@@ -0,0 +1,31 @@
import { Directive, ElementRef, HostListener, Input, SecurityContext } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@Directive({
selector: '[appInputFilter]'
})
export class InputFilterDirective {
@Input() isAlphaNumeric: boolean;
constructor(private el: ElementRef, private sanitizer: DomSanitizer) {}
removeTags(inputValue) {
const div = document.createElement("div");
div.innerHTML = inputValue;
var text = div.textContent || div.innerText || "";
return text
}
filter(inputValue) {
this.el.nativeElement.value = this.removeTags(inputValue)
}
@HostListener('keypress', ['$event']) onInput(event: any): void {
const inputValue: string = event.target.value;
// Notify the subject when the input changes
this.filter(inputValue);
}
}
@@ -151,12 +151,12 @@ export class AttendeesPageModal implements OnInit {
this.showLoader = false; this.showLoader = false;
} else { } else {
this.contacts = result; this.contacts = result;
console.log('Attendes Email',this.loggeduser.Email) // console.log('Attendes Email',this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase()) let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase())
console.log('Attendes Email', filterLoggedUserEmail) // console.log('Attendes Email', filterLoggedUserEmail)
let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "") let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "")
this.contacts = filterEmptyEmail; this.contacts = filterEmptyEmail;
console.log('Attendes Email', this.contacts) // console.log('Attendes Email', this.contacts)
this.showLoader = false; this.showLoader = false;
} }
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { FileValidatorService } from './file-validator.service';
describe('FileValidatorService', () => {
let service: FileValidatorService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(FileValidatorService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,173 @@
import { Injectable } from '@angular/core';
import { Either, error, ok} from "src/app/services/Either"
import * as Sentry from '@sentry/capacitor';
@Injectable({
providedIn: 'root'
})
export class FileValidatorService {
forbiddenExtensions = [
".exe",
".bat",
".sh",
".jar",
".js",
".vbs",
".ps1",
".ini",
".config",
".zip",
".rar",
".tar.gz",
".7z",
".cab",
".sql",
".bak",
".htaccess",
".htpasswd",
".scr",
".pif",
".com",
".msi",
".dll",
".sys",
".ini",
".docm",
".xlsm",
".pptm",
".rtf",
".so",
".dylib",
".dat",
".log",
".conf",
".php",
".py",
".rb",
];
constructor() { }
private base64ToBlob(base64) {
const binaryData = atob(base64);
const arrayBuffer = new ArrayBuffer(binaryData.length);
const view = new Uint8Array(arrayBuffer);
for (let i = 0; i < binaryData.length; i++) {
view[i] = binaryData.charCodeAt(i);
}
return new Blob([arrayBuffer], { type: 'video/mp4' }); // Adjust the type as per your video format
}
ValidateImage(base64Image: string): Promise<Either<true, Event>> {
const imageDiv: HTMLImageElement = document.createElement("img")
return new Promise((resolve, reject) => {
imageDiv.onload = () => {
resolve(ok(true))
}
imageDiv.onerror = (e: Event) => {
resolve(error(e))
Sentry.captureMessage('FileValidatorService invalid image content');
}
imageDiv.src = base64Image
})
}
ValidateVideoFromBase64Data(base64Data: string) : Promise<Either<true, false>> {
const blob = this.base64ToBlob(base64Data);
return new Promise((resolve, reject) => {
const videoElement = document.createElement('video');
videoElement.src = URL.createObjectURL(blob);
// Add event listeners to handle video load and error
videoElement.addEventListener('loadeddata', () => {
resolve(ok(true))
// You can also perform additional validation checks here if needed.
});
videoElement.addEventListener('error', () => {
resolve(ok(true))
Sentry.captureMessage('FileValidatorService invalid video content');
});
})
}
ValidateVideoFromBlob(blob: Blob) : Promise<Either<true, false>> {
return new Promise((resolve, reject) => {
const videoElement = document.createElement('video');
videoElement.src = URL.createObjectURL(blob);
// Add event listeners to handle video load and error
videoElement.addEventListener('loadeddata', () => {
resolve(ok(true))
// You can also perform additional validation checks here if needed.
});
videoElement.addEventListener('error', () => {
resolve(ok(true))
Sentry.captureMessage('FileValidatorService invalid video content');
});
})
}
validateAudioFromBlob(blob: Blob): Promise<Either<true, false>> {
return new Promise((resolve, reject) => {
const audioElement = new Audio();
// Add event listeners to handle audio load and error
audioElement.addEventListener('canplaythrough', () => {
console.log('Valid audio');
resolve(ok(true))
// You can also perform additional validation checks here if needed.
});
audioElement.addEventListener('error', () => {
console.log('Invalid audio');
resolve(error(false))
});
audioElement.src = URL.createObjectURL(blob);
})
}
hasDuplicateExtension(filename): Either<true, false> {
// Use a regular expression to match multiple consecutive dots
const duplicateExtensionRegex = /\.\.+/;
const a = duplicateExtensionRegex.test(filename);
if(a) {
return ok(true)
} else {
Sentry.captureMessage('FileValidatorService invalid filename '+ filename);
return error(false)
}
}
fileNameValidation(fileName): Either<true, false> {
const fileExtension = fileName.slice(((fileName.lastIndexOf(".") - 1) >>> 0) + 2);
const found = this.forbiddenExtensions.includes(`.${fileExtension.toLowerCase()}`);
if(found) {
return error(false)
} else {
return ok(true)
}
}
}
@@ -91,7 +91,7 @@ export class HttpErrorHandle {
validationMessagge(service: string, callback?: any) { validationMessagge(service: string, callback?: any) {
switch (service) { switch (service) {
case 'diplomaAsDraft': case 'diplomaAsDraft':
this.toastService._badRequest('Este diploma não contem um draft para ser assinado!') this.toastService._badRequest('Este diploma não contem um rascunho para ser assinado!')
break; break;
case 'filetype': case 'filetype':
this.toastService._badRequest('Formato de ficheiro inválido!') this.toastService._badRequest('Formato de ficheiro inválido!')
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { HttpServiceService } from './http-service.service';
describe('HttpServiceService', () => {
let service: HttpServiceService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(HttpServiceService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,43 @@
import { HttpClient, HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
// import { Result, err, ok } from 'neverthrow'
import { tap, shareReplay, catchError } from "rxjs/operators";
import { Observable, of } from "rxjs";
@Injectable({
providedIn: 'root'
})
export class HttpServiceService {
constructor(private http: HttpClient) {}
put(url: string, body: any | null, options: Options): Observable<any> {
return this.http.put(url, body, options as any).pipe(
tap((response) => {
// Handle success response if needed
}),
catchError((error) => {
// Handle error response if needed
return of(error);
})
);
}
}
interface Options {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
context?: HttpContext;
observe?: 'body';
params?: HttpParams | {
[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
};
reportProgress?: boolean;
responseType?: 'arraybuffer';
withCredentials?: boolean;
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { TokenInterceptorService } from './token-interceptor.service';
describe('TokenInterceptorService', () => {
let service: TokenInterceptorService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TokenInterceptorService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,81 @@
import { Injectable } from "@angular/core";
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor,
HttpErrorResponse,
HTTP_INTERCEPTORS,
} from "@angular/common/http";
import { Observable, throwError, BehaviorSubject } from "rxjs";
import { catchError, filter, take, switchMap } from "rxjs/operators";
import { SessionStore } from "src/app/store/session.service";
import { MiddlewareRepositoryService } from "src/app/repository/middleWare/middleware-repository.service"
@Injectable({
providedIn: 'root'
})
export class TokenInterceptorService {
private isRefreshing = false;
private refreshTokenSubject: BehaviorSubject<any> = new BehaviorSubject<any>(
null
);
constructor(private middlewareRepositoryService: MiddlewareRepositoryService) {
this.middlewareRepositoryService = middlewareRepositoryService
}
intercept(
request: HttpRequest<any>,
next: HttpHandler
): Observable<HttpEvent<any>> {
if (SessionStore.user.Authorization) {
request = this.addToken(request, SessionStore.user.Authorization);
}
return next.handle(request).pipe(
catchError((error) => {
if (error instanceof HttpErrorResponse && error.status === 401) {
return this.handle401Error(request, next);
} else {
return throwError(error);
}
})
) as any
}
private addToken(request: HttpRequest<any>, token: string) {
return request.clone({
setHeaders: {
Authorization: `Bearer ${token}`,
},
});
}
private handle401Error(request: HttpRequest<any>, next: HttpHandler) {
if (!this.isRefreshing) {
this.isRefreshing = true;
this.refreshTokenSubject.next(null);
return this.middlewareRepositoryService.refreshToken().pipe(
switchMap((token: any) => {
this.isRefreshing = false;
this.refreshTokenSubject.next(token['result'].accessToken);
return next.handle(this.addToken(request, token['result'].accessToken));
})
);
} else {
return this.refreshTokenSubject.pipe(
filter((token) => token != null),
take(1),
switchMap((jwt) => {
return next.handle(this.addToken(request, jwt));
})
);
}
}
}
+15 -10
View File
@@ -239,17 +239,22 @@ export class NotificationsService {
} }
); );
} else { } else {
navigator.serviceWorker.onmessage = (event) => { try {
console.log('Mensagem recebida do Service Worker:', event.data.data);
let object = {
notification: event.data
}
if (event.data.notificationClicked) { navigator.serviceWorker.onmessage = (event) => {
console.log('Notificação push do Firebase clicada em segundo plano!'); console.log('Mensagem recebida do Service Worker:', event.data.data);
this.notificatinsRoutes(object) let object = {
} notification: event.data
}; }
if (event.data.notificationClicked) {
console.log('Notificação push do Firebase clicada em segundo plano!');
this.notificatinsRoutes(object)
}
};
} catch(e) {
console.log(e)
}
} }
} }
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ChunkService } from './chunk.service';
describe('ChunkService', () => {
let service: ChunkService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ChunkService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+140
View File
@@ -0,0 +1,140 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ChunkService {
constructor() {
window["ChunkService"] = this
// const a = this.generateChunkFile({} as any, {} as any)
}
generateChunkFile(base64: string, chunkSizeInBytes: number): File[] {
const byteCharacters = atob(base64); // Decode base64 data to binary
const chunks: File[] = [];
let start = 0;
function createChunk(): File {
const chunkSize = Math.min(chunkSizeInBytes, byteCharacters.length - start);
const chunkData = byteCharacters.slice(start, start + chunkSize);
start += chunkSize;
// console.log({chunkData})
const chunkArray = new Uint8Array(chunkData.length);
for (let i = 0; i < chunkData.length; i++) {
chunkArray[i] = chunkData.charCodeAt(i);
// console.log('chunkData.charCodeAt', chunkData.charCodeAt(i))
}
// console.log({Uint8Array:"Uint8Array", chunkArray})
const blob = new Blob([chunkArray]);
// console.log('blob')
// console.log('File')
return new File([blob], `chunk_${chunks.length + 1}`);
}
while (start < byteCharacters.length) {
chunks.push(createChunk());
}
return chunks;
}
generateChunkOfUint8Array(base64: string, chunkSizeInBytes: number): Uint8Array[] {
const byteCharacters = atob(base64); // Decode base64 data to binary
const chunks: Uint8Array[] = [];
let start = 0;
function createChunk(): Uint8Array {
const chunkSize = Math.min(chunkSizeInBytes, byteCharacters.length - start);
const chunkData = byteCharacters.slice(start, start + chunkSize);
start += chunkSize;
const chunkArray = new Uint8Array(chunkData.length);
for (let i = 0; i < chunkData.length; i++) {
chunkArray[i] = chunkData.charCodeAt(i);
}
return chunkArray;
}
while (start < byteCharacters.length) {
chunks.push(createChunk());
}
return chunks;
}
async uploadChunk(file: File): Promise<any> {
// Read and upload the file in chunks (as you've previously implemented)
const chunkSize = 1024 * 500; // Adjust the chunk size as needed
const chunks = [];
let offset = 0;
let i = 0
while (offset < file.size) {
console.log(offset)
const chunk = file.slice(offset, offset + chunkSize);
const reader = new FileReader();
reader.onload = () => {
chunks[i] = new Uint8Array(reader.result as ArrayBuffer)
};
reader.readAsArrayBuffer(chunk);
offset += chunkSize;
}
return chunks
}
onFileSelect(event: any, chunkSizeInBytes):Promise<Blob[]> {
const file:File = event.target.files[0];
const filename = file.name;
//const chunkSize = 1024 * 1024; // 1 MB chunks (adjust as needed)
const chunkSize = chunkSizeInBytes
return new Promise((resolve, reject) => {
// Read and upload chunks
const fileReader = new FileReader();
fileReader.onload = (e) => {
const arrayBuffer = e.target.result as ArrayBuffer;
const blob = new Blob([new Uint8Array(arrayBuffer)]);
const totalChunks = Math.ceil(file.size / chunkSize);
const chunks: Blob[] = []
for (let i = 1; i <= totalChunks; i++) {
const start = (i - 1) * chunkSize;
const end = i * chunkSize;
const chunk = blob.slice(start, end);
chunks.push(chunk)
}
resolve(chunks)
};
fileReader.readAsArrayBuffer(file);
})
}
generateChunkFromBase64(base64: string, chunkSizeInBytes: number) {
const byteCharacters = atob(base64); // Decode base64 data to binary
const chunkArray = [];
for (let offset = 0; offset < byteCharacters.length; offset += chunkSizeInBytes) {
const chunkData = byteCharacters.slice(offset, offset + chunkSizeInBytes);
chunkArray.push(chunkData);
}
return chunkArray;
}
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { StreamService } from './stream.service';
describe('StreamService', () => {
let service: StreamService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(StreamService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+112
View File
@@ -0,0 +1,112 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class StreamService {
constructor(
private http: HttpClient,
) {
window["StreamService"] = this
}
async uploadFile() {
const API_URL = 'http://localhost:3000/upload'; // Replace with your server URL
const filePath = 'path/to/large-file.zip'; // Replace with the path to your file
const fileName = 'my-file'; // Specify your desired filename
const fileExtension = 'zip'; // Specify the file extension
const headers = new HttpHeaders()
.append('X-File-Name', fileName)
.append('X-File-Extension', fileExtension);
const file = await this.readFileInChunks(filePath);
const chunkSize = 1024 * 1024; // 1 MB chunk size (adjust as needed)
for (let offset = 0; offset < file.length; offset += chunkSize) {
const chunk = file.slice(offset, offset + chunkSize);
// await this.uploadChunk(API_URL, chunk, headers);
}
console.log('Upload completed.');
}
async readFileInChunks(filePath: string): Promise<Uint8Array> {
const response = await fetch(filePath);
const reader = response.body.getReader();
const chunks: Uint8Array[] = [];
let done = false;
while (!done) {
const { value, done: isDone } = await reader.read();
if (!isDone) {
chunks.push(value);
}
done = isDone;
}
return new Uint8Array([].concat(...chunks.map((chunk) => Array.from(chunk))));
}
async uploadChunk(url: string, chunks: Uint8Array[], fileName, fileExtension): Promise<void> {
let i = 1
console.log('123', chunks.length)
for(const chunk of chunks) {
try {
console.log("iterate")
const headers = new HttpHeaders()
.append('X-File-Name', fileName)
.append('X-File-Extension', fileExtension)
.append('X-File-Content-Length', chunks.length.toString())
.append('X-File-Index', i.toString())
await this.http.post('http://localhost:3001/upload', chunk.buffer, { headers, responseType: 'blob' }).toPromise();
i++
} catch (error) {
console.error('Upload error:', error);
}
}
}
async uploadChunkNoLoop(url: string, chunk: Uint8Array, fileName, fileExtension, i, length): Promise<void> {
console.log("iterate")
const headers = new HttpHeaders()
.append('X-File-Name', fileName)
.append('X-File-Extension', fileExtension)
.append('X-File-Content-Length', length)
.append('X-File-Index', i.toString())
await this.http.post('http://localhost:3001/upload', chunk.buffer, { headers, responseType: 'blob' }).toPromise();
}
uploadChunk1(chunk: Blob, chunkNumber: number, totalChunks: number, filename: string) {
console.log(chunk)
const headers = new HttpHeaders()
.append('X-File-Name', filename)
.append('X-File-Content-Length', totalChunks.toString())
.append('X-File-Index', chunkNumber.toString())
return this.http.post('http://localhost:3001/upload-chunk', Blob, { headers, responseType: 'blob' });
}
}
// const text = 'Hello, World00120301010asdf1002sdf 0fsdfasf0001230 12300!\n';
// const base64 = btoa(text);
// let chunks = window["ChunkService"].generateChunkOfUint8Array(base64, 8)
// window.StreamService.uploadChunk("", chunks, "peter12", "txt")
+5
View File
@@ -0,0 +1,5 @@
export interface refreshToken {
Authorization: string,
refreshToken: null
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { MiddlewareServiceService } from './middleware-service.service';
describe('MiddlewareServiceService', () => {
let service: MiddlewareServiceService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(MiddlewareServiceService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,23 @@
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpServiceService } from 'src/app/services/http/http-service.service';
import { Observable } from "rxjs";
import { refreshToken } from "./interface"
@Injectable({
providedIn: 'root'
})
export class MiddlewareServiceService {
constructor(
private HttpServiceService: HttpServiceService,
) {}
refreshToken(refreshToken: string): Observable<refreshToken> {
const data = {
refreshToken: refreshToken
}
return this.HttpServiceService.put(environment.apiURL + "UserAuthentication/RefreshToken", data, {})
}
}
@@ -15,6 +15,7 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { EventToApproveEdit } from 'src/app/models/event.model'; import { EventToApproveEdit } from 'src/app/models/event.model';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -131,7 +132,8 @@ export class EditEventToApprovePage implements OnInit {
private processes:ProcessesService, private processes:ProcessesService,
private toastService: ToastService, private toastService: ToastService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public httpErrorHandler: HttpErrorHandle public httpErrorHandler: HttpErrorHandle,
private domSanitizeService: DomSanitizerService
) { ) {
this.isEventEdited = false; this.isEventEdited = false;
} }
@@ -324,6 +326,10 @@ export class EditEventToApprovePage implements OnInit {
e.IsRequired = false e.IsRequired = false
}) })
this.eventProcess.workflowInstanceDataFields.Subject = /* this.domSanitizeService.sanitizeInput( */this.eventProcess.workflowInstanceDataFields.Subject/* ) */;
this.eventProcess.workflowInstanceDataFields.Location = /* this.domSanitizeService.sanitizeInput( */this.eventProcess.workflowInstanceDataFields.Location/* ) */;
this.eventProcess.workflowInstanceDataFields.Body = /* this.domSanitizeService.sanitizeInput( */this.eventProcess.workflowInstanceDataFields.Body/* ) */;
this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc) this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{ this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{
@@ -15,6 +15,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { ContactsService } from 'src/app/services/contacts.service' import { ContactsService } from 'src/app/services/contacts.service'
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
@Component({ @Component({
selector: 'app-edit-event', selector: 'app-edit-event',
@@ -100,7 +101,8 @@ export class EditEventPage implements OnInit {
private attachmentsService: AttachmentsService, private attachmentsService: AttachmentsService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle, private httpErrorHandle: HttpErrorHandle,
private contactsService: ContactsService private contactsService: ContactsService,
private domSanitizeService: DomSanitizerService
) {} ) {}
ngOnInit() { ngOnInit() {
@@ -344,6 +346,9 @@ export class EditEventPage implements OnInit {
} }
this._postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); this._postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this._postEvent.Subject = /* this.domSanitizeService.sanitizeInput( */this._postEvent.Subject/* ) */;
this._postEvent.Location = /* this.domSanitizeService.sanitizeInput( */this._postEvent.Location/* ) */;
this._postEvent.Body.Text = /* this.domSanitizeService.sanitizeInput( */this._postEvent.Body.Text/* ) */;
if(!this._postEvent.EventRecurrence.hasOwnProperty('Type')) { if(!this._postEvent.EventRecurrence.hasOwnProperty('Type')) {
this._postEvent.EventRecurrence.Type = '-1' this._postEvent.EventRecurrence.Type = '-1'
@@ -31,6 +31,7 @@ import {
} from '@angular/material-moment-adapter'; } from '@angular/material-moment-adapter';
import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core'; import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module'; import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
import { InputFilterDirective } from 'src/app/services/directives/input-filter.directive';
@NgModule({ @NgModule({
@@ -34,6 +34,8 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: { parse: {
dateInput: "YYYY-MMMM-DD HH:mm" dateInput: "YYYY-MMMM-DD HH:mm"
@@ -131,6 +133,8 @@ export class NewEventPage implements OnInit {
CalendarNamesOptions = ['Oficial', 'Pessoal'] CalendarNamesOptions = ['Oficial', 'Pessoal']
environment = environment environment = environment
eventPersons: EventPerson[];
contacts: EventPerson[] = [];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
@@ -142,7 +146,9 @@ export class NewEventPage implements OnInit {
private chatMethodService: ChatMethodsService, private chatMethodService: ChatMethodsService,
private hhtpErrorHandle: HttpErrorHandle, private hhtpErrorHandle: HttpErrorHandle,
private processeService: ProcessesService, private processeService: ProcessesService,
public TaskService: TaskService public TaskService: TaskService,
private contactsService: ContactsService,
private domSanitazerService: DomSanitizerService
) { ) {
this.dateAdapter.setLocale('pt'); this.dateAdapter.setLocale('pt');
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
@@ -220,6 +226,7 @@ export class NewEventPage implements OnInit {
} }
}) })
} }
console.log('Attendes',this.taskParticipants)
this.taskParticipants = removeDuplicate(this.taskParticipants); this.taskParticipants = removeDuplicate(this.taskParticipants);
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
@@ -234,6 +241,7 @@ export class NewEventPage implements OnInit {
this.injectValidation(); this.injectValidation();
this.changeAgenda() this.changeAgenda()
this.fetchContacts("")
} }
@@ -497,6 +505,10 @@ export class NewEventPage implements OnInit {
} }
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this.postEvent.Subject = this.domSanitazerService.sanitizeInput(this.postEvent.Subject);
this.postEvent.Location = this.domSanitazerService.sanitizeInput(this.postEvent.Location);
this.postEvent.Body.Text = this.domSanitazerService.sanitizeInput(this.postEvent.Body.Text);
if (this.documents.length > 0) { if (this.documents.length > 0) {
@@ -987,5 +999,34 @@ export class NewEventPage implements OnInit {
return toAproveObject; return toAproveObject;
} }
async fetchContacts(filter: string) {
if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
});
result.splice(index, 1);
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
this.taskParticipants.push(this.contacts[0]);
this.setIntervenient.emit(this.taskParticipants);
console.log('Attendes Email', this.taskParticipants)
}
);
}
}
} }
@@ -31,7 +31,7 @@
<!-- <div class="div-icon" (click)="openOptions()"> <!-- <div class="div-icon" (click)="openOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/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>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
</div> </div>
@@ -130,7 +130,7 @@
</div> </div>
<!-- <div (click)="docIndex(i);LoadDocumentDetails()" class="doc-options"> <!-- <div (click)="docIndex(i);LoadDocumentDetails()" class="doc-options">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " <ion-icon *ngIf="ThemeService.currentTheme == 'gov' "
src="assets/images/theme/gov/icons-menu.svg"></ion-icon> src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</div> --> </div> -->
@@ -8,7 +8,7 @@
<div class="right"> <div class="right">
<!-- <div (click)=" ChatSystemService.getGroupRoom(this.roomId).deleteAll()">delete all</div> --> <!-- <div (click)=" ChatSystemService.getGroupRoom(this.roomId).deleteAll()">delete all</div> -->
<button title="Menu" class="btn-no-color" (click)="openGroupMessagesOptions()"> <button title="Menu" class="btn-no-color" (click)="openGroupMessagesOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/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>
@@ -29,6 +29,7 @@ import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { FileValidatorService } from "src/app/services/file/file-validator.service"
@Component({ @Component({
selector: 'app-group-messages', selector: 'app-group-messages',
@@ -105,6 +106,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
private platform: Platform, private platform: Platform,
private fileOpener: FileOpener, private fileOpener: FileOpener,
public p: PermissionService, public p: PermissionService,
private FileValidatorService: FileValidatorService
) { ) {
this.ChatSystemService.getUser() this.ChatSystemService.getUser()
@@ -901,9 +903,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const file: any = await this.fileService.getFileFromDevice(types); const file: any = await this.fileService.getFileFromDevice(types);
const fileName = file.name
const validation = this.FileValidatorService.fileNameValidation(fileName)
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") { if(validation.isOk) {
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => { const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
console.error(error); console.error(error);
@@ -946,9 +950,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
fileBase64: fileBase64, fileBase64: fileBase64,
} }
}) })
} else { } else {
this.toastService._badRequest("Ficheiro inválido")
} }
@@ -9,7 +9,7 @@
</div> </div>
<div hidden class="right"> <div hidden class="right">
<button title="Menu" class="btn-no-color" (click)="_openMessagesOptions()"> <button title="Menu" 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/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg">
</ion-icon> </ion-icon>
</button> </button>
+94 -81
View File
@@ -33,6 +33,7 @@ import { Howl } from 'howler';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page'; import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { FileValidatorService } from "src/app/services/file/file-validator.service"
const IMAGE_DIR = 'stored-images'; const IMAGE_DIR = 'stored-images';
@@ -122,6 +123,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private platform: Platform, private platform: Platform,
private fileOpener: FileOpener, private fileOpener: FileOpener,
public p: PermissionService, public p: PermissionService,
private FileValidatorService: FileValidatorService
) { ) {
// update // update
this.checkAudioPermission() this.checkAudioPermission()
@@ -648,7 +650,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
resultType: CameraResultType.Base64, resultType: CameraResultType.Base64,
source: CameraSource.Camera source: CameraSource.Camera
}); });
console.log('Selected: ', file)
var base64 = 'data:image/jpeg;base64,' + file.base64String var base64 = 'data:image/jpeg;base64,' + file.base64String
const compressedImage = await this.compressImageBase64( const compressedImage = await this.compressImageBase64(
base64, base64,
@@ -656,7 +658,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
800, // maxHeight 800, // maxHeight
0.9 // quality 0.9 // quality
).then((picture) => { ).then((picture) => {
console.log('Selected: ', picture)
base64 = picture base64 = picture
}); });
@@ -788,42 +790,46 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
//const imageData = await this.fileToBase64Service.convert(file) //const imageData = await this.fileToBase64Service.convert(file)
// //
console.log('Selected: ', file)
var base64 = 'data:image/jpeg;base64,' + file.base64String var base64 = 'data:image/jpeg;base64,' + file.base64String
const compressedImage = await this.compressImageBase64( if (file.format == "jpeg" || file.format == "png" || file.format == "gif") {
base64,
800, // maxWidth
800, // maxHeight
0.9 // quality
).then((picture) => {
console.log('Selected: ', picture)
base64 = picture
});
const response = await fetch(base64); const compressedImage = await this.compressImageBase64(
const blob = await response.blob(); base64,
800, // maxWidth
800, // maxHeight
0.9 // quality
).then((picture) => {
console.log(base64) base64 = picture
});
const formData = new FormData(); const response = await fetch(base64);
formData.append("blobFile", blob); const blob = await response.blob();
console.log(base64)
const formData = new FormData();
formData.append("blobFile", blob);
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
},
temporaryData: formData,
attachments: [{
"title": file.path,
//"image_url": 'data:image/jpeg;base64,' + file.base64String,
"text": "description",
"title_link_download": false,
}],
attachmentsModelData: {
fileBase64: base64,
}
})
}
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
},
temporaryData: formData,
attachments: [{
"title": file.path,
//"image_url": 'data:image/jpeg;base64,' + file.base64String,
"text": "description",
"title_link_download": false,
}],
attachmentsModelData: {
fileBase64: base64,
}
})
} }
@@ -835,63 +841,70 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
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(file.type)
if (file.type == 'application/pdf' || file.type == 'application/doc' || file.type == 'application/docx' ||
file.type == 'application/xls' || file.type == 'application/xlsx' || file.type == 'application/ppt' ||
file.type == 'application/pptx' || file.type == 'application/txt') {
console.log('FILE', file)
const fileName = file.name
const validation = this.FileValidatorService.fileNameValidation(fileName)
if (validation.isOk) {
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
console.error(error);
})));
let blob;
let formData
let fileBase64
if (this.platform.is("tablet")) {
blob = this.fileService.base64toBlob(encodedData, file.type)
console.log('BLOB BLOB', blob)
formData = new FormData();
formData.append('blobFile', blob);
/* console.log('add file', fileBase64) */
} else {
blob = this.fileService.base64toBlob(encodedData, file.type)
fileBase64 = await this._getBase64(file)
formData = new FormData();
formData.append('blobFile', blob);
}
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
console.error(error);
})));
let blob;
let formData
let fileBase64
if (this.platform.is("tablet")) {
blob = this.fileService.base64toBlob(encodedData, file.type)
console.log('BLOB BLOB', blob)
formData = new FormData();
formData.append('blobFile', blob);
/* console.log('add file', fileBase64) */
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
},
attachments: [{
"title": file.name,
"name": file.name,
//"image_url": res,
// "text": "description",
"title_link_download": false,
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: fileBase64,
}
})
} else { } else {
blob = this.fileService.base64toBlob(encodedData, file.type) this.toastService._badRequest("Ficheiro inválido")
fileBase64 = await this._getBase64(file)
formData = new FormData();
formData.append('blobFile', blob);
} }
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
},
attachments: [{
"title": file.name,
"name": file.name,
//"image_url": res,
// "text": "description",
"title_link_download": false,
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: fileBase64,
}
})
} else {
} }
} }
_getBase64(file) { _getBase64(file) {
@@ -247,15 +247,15 @@ export class AttendeePage implements OnInit {
this.showLoader = false; this.showLoader = false;
} else { } else {
this.contacts = this.sort(result as any); this.contacts = this.sort(result as any);
console.log('Attendes Email', this.loggeduser.Email) // console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase()) let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase())
if(this.taskType == 0 || this.taskType == 1){ if(this.taskType == 0 || this.taskType == 1){
filterLoggedUserEmail = this.contacts.filter(item => item.IsPR == false) filterLoggedUserEmail = this.contacts.filter(item => item.IsPR == false)
} }
console.log('Attendes Email', filterLoggedUserEmail) // console.log('Attendes Email', filterLoggedUserEmail)
let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "") let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "")
this.contacts = filterEmptyEmail; this.contacts = filterEmptyEmail;
console.log('Attendes Email', this.contacts) // console.log('Attendes Email', this.contacts)
this.showLoader = false; this.showLoader = false;
} }
@@ -9,7 +9,7 @@
<ion-label class="title">{{ task.Folio}}</ion-label> <ion-label class="title">{{ task.Folio}}</ion-label>
</div> </div>
<div class="div-icon" (click)="openOptions.emit()"> <div class="div-icon" (click)="openOptions.emit()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/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>
</div> </div>
@@ -9,7 +9,7 @@
<ion-label class="title">{{ task.Folio}}</ion-label> <ion-label class="title">{{ task.Folio}}</ion-label>
</div> </div>
<div class="div-icon" (click)="openOptions.emit()"> <div class="div-icon" (click)="openOptions.emit()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/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>
</div> </div>
+4 -6
View File
@@ -48,15 +48,14 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> --> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> -->
<div *ngIf="profilePicture == ''" class="profile-image"> <div *ngIf="profilePicture == ''" class="profile-image">
<img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image" <!-- <img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image"
src='assets/images/presidente.png'> src='assets/images/presidente.png'>
<img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image" <img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image"
src='assets/images/ministro.png'> src='assets/images/ministro.png'>
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image" <img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
src='assets/images/secretaria_geral.png'> src='assets/images/secretaria_geral.png'> -->
<ion-icon <ion-icon
*ngIf="loggeduser.RoleDescription != 'Presidente da República'&& loggeduser.RoleDescription != 'Ministro e Director do Gabinete do PR' && loggeduser.RoleDescription != 'Secretário Geral' "
class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
</div> </div>
@@ -212,15 +211,14 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> --> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> -->
<div *ngIf="profilePicture == ''" class="profile-image"> <div *ngIf="profilePicture == ''" class="profile-image">
<img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image" <!-- <img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image"
src='assets/images/presidente.png'> src='assets/images/presidente.png'>
<img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image" <img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image"
src='assets/images/ministro.png'> src='assets/images/ministro.png'>
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image" <img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
src='assets/images/secretaria_geral.png'> src='assets/images/secretaria_geral.png'> -->
<ion-icon <ion-icon
*ngIf="loggeduser.RoleDescription != 'Presidente da República'&& loggeduser.RoleDescription != 'Ministro e Director do Gabinete do PR' && loggeduser.RoleDescription != 'Secretário Geral' "
class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
</div> </div>
+29 -17
View File
@@ -102,26 +102,29 @@ export class HeaderPage implements OnInit {
getProfilpicture() { getProfilpicture() {
this.attachmentService.getUserProfilePhoto(this.SessionStore.user.UserPhoto).subscribe((base) => { if (this.SessionStore.user.UserPhoto) {
this.attachmentService.getUserProfilePhoto(this.SessionStore.user.UserPhoto).subscribe((base) => {
this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,' + base).then((value) => { this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,' + base).then((value) => {
this.profilePicture = 'data:image/jpeg;base64,' + base; this.profilePicture = 'data:image/jpeg;base64,' + base;
console.log('picture saved', value) console.log('picture saved')
}).catch((error) => { }).catch((error) => {
console.log('picture not saved') console.log('picture not saved')
}); });
}, (error) => { }, (error) => {
console.log('profile picture errro: ', error) console.log('profile picture errro: ', error)
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => { this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
console.log(picture) /* console.log(picture) */
this.profilePicture = picture this.profilePicture = picture
}).catch((error) => { }).catch((error) => {
this.profilePicture = ""; this.profilePicture = "";
})
}) })
})
} else {
this.profilePicture = "";
}
} }
@@ -266,7 +269,7 @@ export class HeaderPage implements OnInit {
modal.onDidDismiss().then(() => { modal.onDidDismiss().then(() => {
this.notificationLengthData() this.notificationLengthData()
this.getProfilpicture() this.getProfilePictureSorage()
this.showProfileModal = false this.showProfileModal = false
}) })
@@ -311,4 +314,13 @@ export class HeaderPage implements OnInit {
} }
getProfilePictureSorage() {
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
/* console.log(picture) */
this.profilePicture = picture
}).catch((error) => {
this.profilePicture = "";
})
}
} }
@@ -28,7 +28,7 @@ export class DiplomaOptionsPage implements OnInit {
fulltask: any fulltask: any
DraftIds = "" DraftIds = ""
DraftNames = "" DraftNames = ""
asDrat: boolean; asDraft: boolean;
constructor( constructor(
@@ -48,7 +48,7 @@ export class DiplomaOptionsPage implements OnInit {
this.DraftIds = this.navParams.get("DraftIds"); this.DraftIds = this.navParams.get("DraftIds");
this.DraftNames = this.navParams.get("DraftNames"); this.DraftNames = this.navParams.get("DraftNames");
this.asDrat = this.navParams.get('asDrat'); this.asDraft = this.navParams.get('asDraft');
console.log('this.task', this.task) console.log('this.task', this.task)
@@ -241,7 +241,7 @@ export class DiplomaOptionsPage implements OnInit {
async AssinarNew(note?, doc?) { async AssinarNew(note?, doc?) {
if (this.asDrat) { if (this.asDraft) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: PopupQuestionPage, component: PopupQuestionPage,
componentProps: { componentProps: {
@@ -9,7 +9,7 @@
</div> </div>
<div *ngIf="content != ''" class="buttons header-fix"> <div *ngIf="content != ''" class="buttons header-fix">
<!-- <button (click)="save(Document, content)" class="btn-cancel" shape="round" >Salvar</button> --> <!-- <button (click)="save(Document, content)" class="btn-cancel" shape="round" >Salvar</button> -->
<button (click)="AssinarDraft()" class="btn-cancel" shape="round" >Assinar</button> <button *ngIf="p.userRole('PR')" (click)="AssinarDraft()" class="btn-cancel" shape="round" >Assinar</button>
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button> <button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
</div> </div>
</ion-content> </ion-content>
@@ -14,6 +14,7 @@ import { FilePicker } from '@capawesome/capacitor-file-picker';
import { Directory, Encoding, Filesystem } from '@capacitor/filesystem'; import { Directory, Encoding, Filesystem } from '@capacitor/filesystem';
import { utf8Encode } from '@angular/compiler/src/util'; import { utf8Encode } from '@angular/compiler/src/util';
import { checkFileTypeService } from 'src/app/services/checkFileType.service'; import { checkFileTypeService } from 'src/app/services/checkFileType.service';
import { FileValidatorService } from "src/app/services/file/file-validator.service"
@Component({ @Component({
selector: 'app-new-publication', selector: 'app-new-publication',
@@ -60,7 +61,8 @@ export class NewPublicationPage implements OnInit {
public ThemeService: ThemeService, public ThemeService: ThemeService,
private httpErroHandle: HttpErrorHandle, private httpErroHandle: HttpErrorHandle,
public PublicationFolderService: PublicationFolderService, public PublicationFolderService: PublicationFolderService,
public checkFileType: checkFileTypeService public checkFileType: checkFileTypeService,
private FileValidatorService: FileValidatorService
) { ) {
this.publicationTitle = 'Nova Publicação'; this.publicationTitle = 'Nova Publicação';
@@ -145,6 +147,7 @@ export class NewPublicationPage implements OnInit {
this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String; this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String;
this.capturedImageTitle = 'foto'; this.capturedImageTitle = 'foto';
/* if(validation.isOk) { */
const compressedImage = await this.compressImageBase64( const compressedImage = await this.compressImageBase64(
this.capturedImage, this.capturedImage,
800, // maxWidth 800, // maxWidth
@@ -157,6 +160,9 @@ export class NewPublicationPage implements OnInit {
} }
this.seletedContent.push(fileObject) this.seletedContent.push(fileObject)
}); });
/* } else {
this.toastService._badRequest("Imagem inválida")
} */
} }
async laodPicture() { async laodPicture() {
@@ -211,6 +217,27 @@ export class NewPublicationPage implements OnInit {
}); });
/* this.capturedImage = 'data:image/jpeg;base64,' +capturedImage.base64String;
this.capturedImageTitle = 'foto';
const validation = await this.FileValidatorService.ValidateImage(this.capturedImage)
if(validation.isOk) {
const compressedImage = await this.compressImageBase64(
this.capturedImage,
800, // maxWidth
800, // maxHeight
0.9 // quality
).then((picture) => {
console.log('Selected: ', picture)
this.capturedImage = picture
});
} else {
this.toastService._badRequest("Imagem inválida")
} */
}; };
@@ -320,7 +347,6 @@ export class NewPublicationPage implements OnInit {
} */ } */
} }
else { else {
let time = new Date() let time = new Date()
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core'; import { NgModule,CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
@@ -31,6 +31,7 @@ setup(attributes: Attributes) {
], ],
exports: [ViewPublicationsPage], exports: [ViewPublicationsPage],
declarations: [ViewPublicationsPage], declarations: [ViewPublicationsPage],
providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}] providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}) })
export class ViewPublicationsPageModule {} export class ViewPublicationsPageModule {}
@@ -34,7 +34,7 @@
<ion-refresher-content> <ion-refresher-content>
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher>
<div class="main-container px-20" *ngIf="publicationFolderService.FolderDetails[foldserId]"> <div class="main-container px-20" *ngIf="publicationFolderService.FolderDetails[folderId]">
<p class="item-content-detail">{{publicationFolderService.FolderDetails[folderId].Detail}}</p> <p class="item-content-detail">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index"> <ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
+17 -11
View File
@@ -43,11 +43,15 @@ export class NotificationHolderService {
notificationObject(notification) { notificationObject(notification) {
const element = notification const element = notification
const i = this._notificationList.length + 1
let notificationObject; let notificationObject;
if (element.notification) { if (element.notification) {
notificationObject = { notificationObject = {
id: notification?.id, id: notification?.id || uuidv4(),
index: i,
title: element.notification.title, title: element.notification.title,
Service: element.data.Service, Service: element.data.Service,
Object: element.data.Object, Object: element.data.Object,
@@ -65,7 +69,8 @@ export class NotificationHolderService {
} else if (element.data) { } else if (element.data) {
notificationObject = { notificationObject = {
id: notification?.id, id: notification?.id || uuidv4(),
index: i,
title: element.title, title: element.title,
Service: element.data.Service, Service: element.data.Service,
Object: element.data.Object, Object: element.data.Object,
@@ -84,19 +89,20 @@ export class NotificationHolderService {
} else { } else {
{ {
notificationObject = { notificationObject = {
id: notification?.id, id: notification?.id || uuidv4(),
title: element.title,
Service: element.Service,
Object: element.Object,
IdObject: element.IdObject,
FolderId: element.FolderId, FolderId: element.FolderId,
body: element.body, IdObject: element.IdObject,
dateInit: element.dateInit,
dateEnd: element.dateEnd,
Location: element.Location, Location: element.Location,
TypeAgenda: element.TypeAgenda, Object: element.Object,
Role: element.Role, Role: element.Role,
Service: element.Service,
Status: element.Status, Status: element.Status,
TypeAgenda: element.TypeAgenda,
body: element.body,
dateEnd: element.dateEnd,
dateInit: element.dateInit,
index: element.index,
title: element.title,
read: false, read: false,
} }
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Some files were not shown because too many files have changed in this diff Show More