mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
pull from developer-prod made
This commit is contained in:
@@ -97,3 +97,4 @@ src/app/pipes/process.service.ts
|
||||
src/app/domain
|
||||
_src/
|
||||
-src
|
||||
plugin copy
|
||||
|
||||
@@ -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
@@ -1,4 +1,4 @@
|
||||
// / <reference types="@capacitor/local-notifications" />
|
||||
|
||||
// / <reference types="@capacitor/push-notifications" />
|
||||
// / <reference types="@capacitor/splash-screen" />
|
||||
|
||||
|
||||
+44
-13
@@ -1,28 +1,44 @@
|
||||
workflows:
|
||||
ios-native-workflow:
|
||||
name: iOS Native
|
||||
instance_type: mac_mini_m1
|
||||
ios-workflow:
|
||||
name: iOS Workflow
|
||||
max_build_duration: 120
|
||||
integrations:
|
||||
app_store_connect: GabineteDigital
|
||||
app_store_connect: 433YAF3YWG
|
||||
environment:
|
||||
ios_signing:
|
||||
distribution_type: app_store
|
||||
bundle_identifier: com.gpr.gabinetedigital.teste
|
||||
vars:
|
||||
BUNDLE_ID: "com.gpr.gabinetedigital.teste"
|
||||
APP_STORE_APPLE_ID: DV5P2ZCAPJ
|
||||
xcode: latest
|
||||
cocoapods: default
|
||||
APP_STORE_APPLE_ID: 1664747447
|
||||
XCODE_WORKSPACE: "platforms/ios/App.app.xcworkspace"
|
||||
XCODE_SCHEME: "App.app"
|
||||
scripts:
|
||||
- name: Install CocoaPods dependencies
|
||||
- name: Install npm dependencies for Ionic Capacitor project
|
||||
script: |
|
||||
pod install
|
||||
- name: Set up provisioning profiles settings on Xcode project
|
||||
script: xcode-project use-profiles
|
||||
npm install
|
||||
- name: Cocoapods installation
|
||||
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
|
||||
script: |
|
||||
cd $CM_BUILD_DIR/ios/App
|
||||
xcode-project build-ipa \
|
||||
--workspace "$CM_BUILD_DIR/$XCODE_WORKSPACE" \
|
||||
--workspace "$XCODE_WORKSPACE" \
|
||||
--scheme "$XCODE_SCHEME"
|
||||
artifacts:
|
||||
- build/ios/ipa/*.ipa
|
||||
@@ -30,7 +46,22 @@ workflows:
|
||||
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app
|
||||
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
|
||||
publishing:
|
||||
email:
|
||||
recipients:
|
||||
- romavicdosanjoskc@gmail.com
|
||||
notify:
|
||||
success: true
|
||||
failure: false
|
||||
app_store_connect:
|
||||
auth: integration
|
||||
|
||||
# Configuration related to TestFlight (optional)
|
||||
# Note: This action is performed during post-processing.
|
||||
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
|
||||
@@ -189,7 +189,7 @@
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
5B7AACB22ECDCEAA343DC840 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
buildActionMask = 8;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
@@ -197,14 +197,14 @@
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
buildActionMask = 8;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
@@ -215,14 +215,14 @@
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
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";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
buildActionMask = 8;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
@@ -230,7 +230,7 @@
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
@@ -390,7 +390,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = 63;
|
||||
CURRENT_PROJECT_VERSION = 65;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
|
||||
INFOPLIST_FILE = App/Info.plist;
|
||||
@@ -419,7 +419,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = 63;
|
||||
CURRENT_PROJECT_VERSION = 65;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 94BRNM2LSS;
|
||||
INFOPLIST_FILE = App/Info.plist;
|
||||
|
||||
Generated
+54
@@ -128,6 +128,7 @@
|
||||
"crypto-js": "^4.0.0",
|
||||
"date-fns": "^2.17.0",
|
||||
"depd": "^2.0.0",
|
||||
"dompurify": "^3.0.6",
|
||||
"dotenv": "^10.0.0",
|
||||
"duration": "^0.2.2",
|
||||
"faker": "^5.5.3",
|
||||
@@ -164,6 +165,7 @@
|
||||
"rocket.chat.realtime.api.rxjs": "^2.1.1",
|
||||
"rxjs": "~6.6.3",
|
||||
"rxjs-compat": "^6.6.7",
|
||||
"sanitize-filename-ts": "^1.0.2",
|
||||
"send-intent": "^5.0.0",
|
||||
"sharp": "^0.30.7",
|
||||
"socket.io-client": "^2.3.0",
|
||||
@@ -14702,6 +14704,11 @@
|
||||
"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": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
|
||||
@@ -33190,6 +33197,14 @@
|
||||
"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": {
|
||||
"version": "1.36.0",
|
||||
"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",
|
||||
"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": {
|
||||
"version": "27.1.5",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.5.tgz",
|
||||
@@ -41686,6 +41709,11 @@
|
||||
"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": {
|
||||
"version": "0.11.1",
|
||||
"resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz",
|
||||
@@ -54703,6 +54731,11 @@
|
||||
"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": {
|
||||
"version": "2.8.0",
|
||||
"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": {
|
||||
"version": "1.36.0",
|
||||
"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",
|
||||
"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": {
|
||||
"version": "27.1.5",
|
||||
"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",
|
||||
"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": {
|
||||
"version": "0.11.1",
|
||||
"resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz",
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
"crypto-js": "^4.0.0",
|
||||
"date-fns": "^2.17.0",
|
||||
"depd": "^2.0.0",
|
||||
"dompurify": "^3.0.6",
|
||||
"dotenv": "^10.0.0",
|
||||
"duration": "^0.2.2",
|
||||
"faker": "^5.5.3",
|
||||
@@ -178,6 +179,7 @@
|
||||
"rocket.chat.realtime.api.rxjs": "^2.1.1",
|
||||
"rxjs": "~6.6.3",
|
||||
"rxjs-compat": "^6.6.7",
|
||||
"sanitize-filename-ts": "^1.0.2",
|
||||
"send-intent": "^5.0.0",
|
||||
"sharp": "^0.30.7",
|
||||
"socket.io-client": "^2.3.0",
|
||||
|
||||
@@ -90,6 +90,7 @@ import { PopupQuestionPipe } from './modals/popup-question.pipe';
|
||||
import '@teamhive/capacitor-video-recorder';
|
||||
import { tokenInterceptor } from './interceptors/token.interceptors';
|
||||
|
||||
import { InputFilterDirective } from './services/directives/input-filter.directive';
|
||||
|
||||
// import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
// import { AngularFireModule } from '@angular/fire';
|
||||
@@ -119,7 +120,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
SentrySibling.init
|
||||
);
|
||||
@NgModule({
|
||||
declarations: [AppComponent, PopupQuestionPipe],
|
||||
declarations: [AppComponent, PopupQuestionPipe, InputFilterDirective],
|
||||
imports: [BrowserModule,
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
@@ -173,8 +174,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
EditorModule,
|
||||
// options
|
||||
DeplomaOptionsPageModule,
|
||||
CreateProcessPageModule
|
||||
|
||||
CreateProcessPageModule,
|
||||
],
|
||||
entryComponents: [
|
||||
DiplomaOptionsPage,
|
||||
@@ -216,6 +216,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
DocumentViewer,
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: LoggingInterceptorService, multi: true },
|
||||
tokenInterceptor
|
||||
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -413,6 +413,8 @@ const routes: Routes = [
|
||||
canActivate: [InactivityGuard]
|
||||
|
||||
},
|
||||
|
||||
{ path: '**', redirectTo: '/', pathMatch: 'full' },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -22,6 +22,8 @@ import { UserSession } from '../models/user.model';
|
||||
import { PermissionList } from '../models/permission/permissionList';
|
||||
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 { NewActionPage } from '../pages/publications/new-action/new-action.page';
|
||||
import { PublicationsPage } from '../pages/publications/publications.page';
|
||||
@@ -104,6 +106,8 @@ export class HomePage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private zone: NgZone
|
||||
|
||||
// private ChunkService: ChunkService,
|
||||
// private StreamService: StreamService
|
||||
) {
|
||||
if (SessionStore.exist) {
|
||||
this.user = SessionStore.user;
|
||||
|
||||
@@ -62,14 +62,14 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</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
|
||||
floatLabel="never"
|
||||
appearance="fill"
|
||||
class="width-100 d-block"
|
||||
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-select>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -63,6 +63,7 @@ export class CreateProcessPage implements OnInit {
|
||||
loadedAttachments: any;
|
||||
subjectTypes: any;
|
||||
selectedTypes: string[] = [];
|
||||
placeholderSubject: string;
|
||||
|
||||
postData: Despacho;
|
||||
dispatchFolder: Folder;
|
||||
@@ -125,7 +126,13 @@ export class CreateProcessPage implements OnInit {
|
||||
this.postData = new Despacho();
|
||||
this.participants = this.participants = new Array();
|
||||
//Initialize SubjectTypes Array with the value "Indefinido"
|
||||
if(this.loggeduser.Profile == 'PR') {
|
||||
this.selectedTypes = ['99999850'];
|
||||
this.placeholderSubject = 'Indefinido'
|
||||
} else {
|
||||
this.placeholderSubject = 'Selecione o tipo de assunto*'
|
||||
}
|
||||
|
||||
|
||||
let NumberPDPP;
|
||||
|
||||
@@ -179,9 +186,9 @@ export class CreateProcessPage implements OnInit {
|
||||
ngOnInit() {
|
||||
console.log('crete process')
|
||||
this.getSubjectType();
|
||||
setTimeout(() => {
|
||||
/* setTimeout(() => {
|
||||
this.selectedTypes = ['99999850'];
|
||||
}, 500);
|
||||
}, 500); */
|
||||
|
||||
|
||||
this.taskDate = new Date(this.task.taskStartDate);
|
||||
|
||||
@@ -331,7 +331,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loggeduser.Profile != 'PR'" class="aside-righ flex-grow-1">
|
||||
<div class="aside-righ flex-grow-1">
|
||||
<app-empty-container
|
||||
[texto]="emptyTextDescription"
|
||||
*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 { environment } from 'src/environments/environment';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
@@ -99,6 +100,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
CalendarNamesOptions
|
||||
testeFormDefaul = "Eudes"
|
||||
environment = environment
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -111,21 +114,53 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
public _eventService: EventsService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.document = this.navParams.get('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
|
||||
} else {
|
||||
this.attachments = [this.document]
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.document = []
|
||||
|
||||
this.subject = this.navParams.get('subject')
|
||||
|
||||
this.postData = new Event();
|
||||
@@ -163,6 +198,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
this.adding = "intervenient";
|
||||
this.setDefaultTime()
|
||||
this.getRecurrenceTypes();
|
||||
this.fetchContacts("")
|
||||
|
||||
|
||||
}
|
||||
@@ -277,25 +313,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
|
||||
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 = {
|
||||
EventId: '',
|
||||
Subject: this.postData.Subject,
|
||||
@@ -318,10 +335,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
Type: this.EventRecurrenceType,
|
||||
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) => {
|
||||
laoder.remove();
|
||||
@@ -512,5 +530,34 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
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 *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" src="assets/images/theme/gov/icons-profile.svg"></ion-icon>
|
||||
<img
|
||||
|
||||
<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'>
|
||||
<img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' "
|
||||
class="profile-pic" src='assets/images/ministro.png'>
|
||||
<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 *ngIf="profilePicture != '' ">
|
||||
@@ -135,7 +135,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -44,8 +44,12 @@ export class EditProfilePage implements OnInit {
|
||||
}
|
||||
getProfilpictureFromStorage() {
|
||||
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
|
||||
console.log(picture)
|
||||
if(picture) {
|
||||
this.profilePicture = picture
|
||||
} else {
|
||||
this.profilePicture = "";
|
||||
}
|
||||
/* console.log(picture) */
|
||||
}).catch((error) => {
|
||||
this.profilePicture = "";
|
||||
})
|
||||
|
||||
@@ -37,18 +37,18 @@
|
||||
<ion-header class=" bg-blue ion-no-border">
|
||||
<div class="profile-content">
|
||||
|
||||
<div class="d-flex align-center">
|
||||
<div class="d-flex align-center flex-column">
|
||||
|
||||
<div *ngIf="profilePicture == ''" class="profile-pic">
|
||||
<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"
|
||||
src="assets/images/theme/gov/icons-profile.svg"></ion-icon>
|
||||
<div *ngIf="profilePicture == ''">
|
||||
<img
|
||||
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'>
|
||||
<img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-pic"
|
||||
src='assets/images/ministro.png'>
|
||||
<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 *ngIf="profilePicture != ''" class="profile-pic">
|
||||
|
||||
@@ -99,8 +99,12 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
getProfilpicture() {
|
||||
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
|
||||
console.log(picture)
|
||||
if(picture) {
|
||||
this.profilePicture = picture
|
||||
} else {
|
||||
this.profilePicture = "";
|
||||
}
|
||||
/* console.log(picture) */
|
||||
}).catch((error ) => {
|
||||
this.profilePicture = "";
|
||||
})
|
||||
|
||||
@@ -125,7 +125,7 @@ export class ViewDocumentPage implements OnInit {
|
||||
}
|
||||
|
||||
async openBookMeetingModal() {
|
||||
console.log('this.Document', this.Document)
|
||||
console.log('this.Document----------', this.Document)
|
||||
let classs;
|
||||
if( window.innerWidth < 701) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
@@ -164,6 +164,8 @@ export class ViewDocumentPage implements OnInit {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
// check passing
|
||||
|
||||
console.log('this.Document----------openExpedientActionsModal', this.Document)
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedientTaskModalPage,
|
||||
componentProps: {
|
||||
|
||||
@@ -110,3 +110,7 @@ models.register({
|
||||
version: 14,
|
||||
models: [PublicationDetailsModel, ActionModel, PublicationFolderModel]
|
||||
})
|
||||
|
||||
|
||||
|
||||
window["MessageModel"] = MessageModel
|
||||
|
||||
@@ -3,5 +3,6 @@ export class EventPerson{
|
||||
Name: string;
|
||||
IsRequired: boolean;
|
||||
UserType: string;
|
||||
IsPR: boolean
|
||||
IsPR: boolean;
|
||||
RoleDescription: string;
|
||||
}
|
||||
@@ -215,24 +215,30 @@
|
||||
</div>
|
||||
<div class="timeline-wrapper flex-grow-1 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="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, </span> {{ timelineDate }}
|
||||
</div>
|
||||
|
||||
<div *ngFor="let events of TimelineMDList | keyvalue; " >
|
||||
<div class="ss-timeline timeline-mobile flex-grow-1 pr-10 text-black height-100 width-100 overflow-y-auto" >
|
||||
|
||||
<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 *ngFor="let day of month.days " class="EventListBox-container" >
|
||||
|
||||
<div class="EventListBox-container" >
|
||||
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
|
||||
{{ TimelineDay(events.key)}} <div style="text-transform: capitalize; display: inline;">{{ viewTitle }}</div>
|
||||
{{ day.daysInfo.dayName }} <div style="text-transform: capitalize; display: inline;">{{month.monthInfo.monthName}}</div>
|
||||
</div>
|
||||
|
||||
<div *ngFor="let event of events.value" class="EventListBox mb-10" >
|
||||
|
||||
<div *ngFor="let event of day.events " class="EventListBox mb-10" >
|
||||
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(event) ">
|
||||
>
|
||||
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
|
||||
@@ -259,11 +265,12 @@
|
||||
<ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -875,13 +875,12 @@ $font-size: rem(15);
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.ss-timeline > :nth-child(2) .dayShow {
|
||||
display: none;
|
||||
.header-day .dayShow:nth-child(1) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.ss-timeline > :nth-child(1) .dayShow {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.calendar-options {
|
||||
position: relative;
|
||||
|
||||
@@ -270,9 +270,20 @@ export class AgendaPage implements OnInit {
|
||||
this.segment = "Combinado";
|
||||
}
|
||||
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++;
|
||||
this.weekToShow()
|
||||
}
|
||||
@@ -410,13 +421,16 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
onDropDownScrollWeal() {
|
||||
|
||||
try {
|
||||
setTimeout(() => {
|
||||
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
setTimeout(() => {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
currentMoth = {
|
||||
rangeStartDate: null,
|
||||
rangeEndDate: null
|
||||
}
|
||||
|
||||
onRangeChanged(ev: { startTime: Date, endTime: Date }) {
|
||||
this.rangeStartDate = ev.startTime;
|
||||
this.rangeEndDate = ev.endTime;
|
||||
|
||||
if (this.currentMoth.rangeEndDate == null) {
|
||||
this.currentMoth = {
|
||||
rangeStartDate: ev.startTime,
|
||||
rangeEndDate: ev.endTime
|
||||
}
|
||||
}
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
|
||||
|
||||
@@ -710,14 +737,29 @@ export class AgendaPage implements OnInit {
|
||||
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||
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');
|
||||
if(this.TimelineMDList[selectedDay]) {
|
||||
const yearName = momentG(new Date(this.eventSelectedDate), 'yyyy')
|
||||
const monthName = momentG(new Date(this.eventSelectedDate), 'MMMM')
|
||||
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 {
|
||||
this.hasEventToday = false
|
||||
}
|
||||
|
||||
|
||||
this.isSelectedDayHasEvent = momentG(new Date(), 'dd MMMM yyyy', 'pt') == momentG(this.eventSelectedDate, 'dd MMMM yyyy', 'pt');
|
||||
@@ -742,10 +784,7 @@ export class AgendaPage implements OnInit {
|
||||
} catch (e) { }
|
||||
|
||||
this.updateEventListBox()
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
} else { }
|
||||
|
||||
}
|
||||
|
||||
@@ -1129,10 +1168,8 @@ export class AgendaPage implements OnInit {
|
||||
// THIS LINE
|
||||
this.updateEventListBox();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
shoeEventDay(events: any[]) {
|
||||
|
||||
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 { environment } from 'src/environments/environment';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -98,7 +99,8 @@ export class EditEventPage implements OnInit {
|
||||
private router: Router,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private contactsService: ContactsService
|
||||
private contactsService: ContactsService,
|
||||
private domSanitazerService: DomSanitizerService
|
||||
) {
|
||||
|
||||
/* this.postEvent = new Event(); */
|
||||
@@ -363,6 +365,9 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ProcessesService } from 'src/app/services/processes.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 = {
|
||||
parse: {
|
||||
@@ -93,6 +95,9 @@ export class NewEventPage implements OnInit {
|
||||
roomId: string;
|
||||
globalEnd = new Date('1999')
|
||||
environment = environment
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[];
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -105,7 +110,9 @@ export class NewEventPage implements OnInit {
|
||||
private chatMethodService: ChatMethodsService,
|
||||
private hhtpErrorHandle: HttpErrorHandle,
|
||||
private processeService: ProcessesService,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
private domSanitazerService: DomSanitizerService
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.postEvent = new Event();
|
||||
@@ -196,6 +203,7 @@ export class NewEventPage implements OnInit {
|
||||
this.checkRoleInArray()
|
||||
this.changeAgenda()
|
||||
|
||||
this.fetchContacts("")
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -407,6 +415,9 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -831,4 +842,33 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
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="left d-flex">
|
||||
<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 == 'doneIt' " slot="end" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</button>
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
<i class="far fa-clock font-15"></i>
|
||||
<ion-label class="font-15 pl-10" color="warning">{{roomCountDownDate}}</ion-label>
|
||||
</div>
|
||||
{{ RouteService.history }}
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</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 { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||
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({
|
||||
selector: 'app-group-messages',
|
||||
templateUrl: './group-messages.page.html',
|
||||
@@ -104,6 +108,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private file: File,
|
||||
private fileOpener: FileOpener,
|
||||
public RouteService: RouteService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
this.ChatSystemService.getUser()
|
||||
|
||||
@@ -507,7 +512,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"mimeType": audioFile.value.mimeType,
|
||||
},
|
||||
attachments: [{
|
||||
"title": fileName,
|
||||
"title": sanitize(fileName),
|
||||
"title_link_download": true,
|
||||
"type": "audio"
|
||||
}],
|
||||
@@ -828,6 +833,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const file: any = await this.fileService.getFileFromDevice(types);
|
||||
|
||||
|
||||
const fileName = file.name
|
||||
|
||||
const validation = this.FileValidatorService.fileNameValidation(fileName)
|
||||
|
||||
if(validation.isOk) {
|
||||
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
|
||||
@@ -846,8 +856,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"guid": '',
|
||||
},
|
||||
attachments: [{
|
||||
"title": file.name,
|
||||
"name": file.name,
|
||||
"title": sanitize(fileName),
|
||||
"name": sanitize(fileName),
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
@@ -860,6 +870,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {
|
||||
this.toastService._badRequest("Ficheiro inválido")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div hidden class="right">
|
||||
<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>
|
||||
</button>
|
||||
|
||||
@@ -33,6 +33,10 @@ import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { NewEventPage } from '../../agenda/new-event/new-event.page';
|
||||
import { NotificationsService } from 'src/app/services/notifications.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';
|
||||
|
||||
@@ -117,6 +121,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private fileOpener: FileOpener,
|
||||
private router: Router,
|
||||
public RochetChatConnectorService: RochetChatConnectorService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
|
||||
try {
|
||||
@@ -413,12 +418,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Converting base64 to blob
|
||||
const encodedData = btoa(this.audioRecorded);
|
||||
const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
|
||||
|
||||
const validation = await this.FileValidatorService.validateAudioFromBlob(blob)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
@@ -429,7 +435,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"mimeType": audioFile.value.mimeType,
|
||||
},
|
||||
attachments: [{
|
||||
"title": fileName,
|
||||
"title": sanitize(fileName),
|
||||
"title_link_download": true,
|
||||
"type": "audio"
|
||||
}],
|
||||
@@ -759,7 +765,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async addFileToChatMobile(types: typeof FileType[]) {
|
||||
console.log('add image from gallery')
|
||||
const roomId = this.roomId
|
||||
|
||||
const file = await Camera.getPhoto({
|
||||
@@ -852,17 +857,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
formData.append('blobFile', blob);
|
||||
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") {
|
||||
console.log('TYPE', file.type)
|
||||
if(validation.isOk) {
|
||||
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
console.log(encodedData)
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
console.log('BLOB BLOB', blob)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
@@ -874,8 +879,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"guid": '',
|
||||
},
|
||||
attachments: [{
|
||||
"title": file.name,
|
||||
"name": file.name,
|
||||
"title": sanitize(fileName),
|
||||
"name": sanitize(fileName),
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
@@ -885,11 +890,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('file not supported')
|
||||
this.toastService._badRequest("Ficheiro inválido")
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
getBase64(file) {
|
||||
|
||||
@@ -153,16 +153,16 @@ export class AttendeesPageModal implements OnInit {
|
||||
this.showLoader = false;
|
||||
} else {
|
||||
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())
|
||||
if(this.taskType == 0 || this.taskType == 1){
|
||||
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() != "")
|
||||
|
||||
this.contacts = filterEmptyEmail;
|
||||
console.log('Attendes Email', this.contacts)
|
||||
//console.log('Attendes Email', this.contacts)
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -311,7 +311,8 @@ label {
|
||||
.time {
|
||||
font-family: Roboto;
|
||||
text-align: center;
|
||||
color: var(--header-tab-text-white);
|
||||
/* color: var(--header-tab-text-white); */
|
||||
color: black;
|
||||
line-height: unset;
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="title">{{ task.Folio}}</div>
|
||||
</div>
|
||||
<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 == 'doneIt' " class="font-25 cursor-pointer" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
<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('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.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
</div>
|
||||
|
||||
@@ -328,7 +328,7 @@ export class DespachoPrPage implements OnInit {
|
||||
async reexecutar(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Reexecução",
|
||||
"action": "Reexecutar",
|
||||
"ActionTypeId": 100000010,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
@@ -416,7 +416,7 @@ export class DespachoPrPage implements OnInit {
|
||||
// console.log('actionName', actionName)
|
||||
await this.concluir(res.data.note, docs);
|
||||
}
|
||||
else if (actionName == 'Reexecução') {
|
||||
else if (actionName == 'Reexecutar') {
|
||||
await this.reexecutar(res.data.note, docs);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<ion-label class="title">{{ task.Folio }}</ion-label>
|
||||
</div>
|
||||
<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 == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
<div class="solid"></div>
|
||||
</div>
|
||||
<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>
|
||||
<div class="buttons">
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div class="menu-ptions">
|
||||
<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 == 'doneIt' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
</button>
|
||||
|
||||
+3
-3
@@ -232,7 +232,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="ion-input-class-no-height cursor-pointer" (click)="addParticipantsCc()">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
@@ -241,7 +241,7 @@
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</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 == '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>
|
||||
@@ -294,7 +294,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="sessionStore.user.Profile != 'PR'" class="aside-righ flex-grow-1">
|
||||
<div class="aside-righ flex-grow-1">
|
||||
<app-empty-container
|
||||
[texto]="emptyTextDescription"
|
||||
*ngIf="!showAttendees"
|
||||
|
||||
+38
-2
@@ -23,6 +23,7 @@ import { RoleIdService } from 'src/app/services/role-id.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
|
||||
const moment = _rollupMoment || _moment;
|
||||
|
||||
@@ -114,6 +115,9 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
sessionStore = SessionStore;
|
||||
environment = environment
|
||||
loggeduser: LoginUserRespose;
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -125,7 +129,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
public eventService: EventsService,
|
||||
public RoleIdService: RoleIdService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
|
||||
|
||||
) {
|
||||
@@ -174,6 +179,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}
|
||||
|
||||
this.changeAgenda();
|
||||
this.loggeduser = SessionStore.user;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -182,6 +188,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.getAttachments();
|
||||
this.setDefaultTime()
|
||||
this.getRecurrenceTypes();
|
||||
this.fetchContacts("")
|
||||
|
||||
}
|
||||
|
||||
@@ -417,7 +424,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
console.log('attenes return', data)
|
||||
if (data) {
|
||||
data = data['data'];
|
||||
|
||||
@@ -587,4 +594,33 @@ export class BookMeetingModalPage implements OnInit {
|
||||
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)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -97,7 +97,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</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
|
||||
class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none">
|
||||
<ion-select
|
||||
@@ -112,7 +112,7 @@
|
||||
appearance="fill"
|
||||
class="width-100 d-block"
|
||||
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-select>
|
||||
</mat-form-field>
|
||||
|
||||
+21
-16
@@ -69,7 +69,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
loadedAttachments:any;
|
||||
documents:SearchList[] = [];
|
||||
|
||||
subjectTypes:any[] = [];
|
||||
subjectTypes:any;
|
||||
selectedTypes: string[]=[];
|
||||
SearchFolder: any = []
|
||||
|
||||
@@ -96,6 +96,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
validateFrom = false;
|
||||
validateField = false;
|
||||
document: any
|
||||
placeholderSubject: string;
|
||||
|
||||
get toppingsValues() {
|
||||
return this.toppings.value;
|
||||
@@ -124,14 +125,13 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
this.SearchFolder = this.navParams.get('SearchFolder');
|
||||
this.aplicationId = this.navParams.get('aplicationId')
|
||||
// this.document = this.navParams.get('document')
|
||||
this.document = this.navParams.get('document')
|
||||
|
||||
this.taskType = this.navParams.get('taskAction');
|
||||
|
||||
|
||||
// try {
|
||||
// if(this.document) {
|
||||
// const doc: any = this.document
|
||||
|
||||
// this.documents.push({
|
||||
// ApplicationId: (doc.ApplicationType || doc.ApplicationId),
|
||||
// ApplicationType: (doc.ApplicationType || doc.ApplicationId),
|
||||
@@ -144,20 +144,19 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
// Assunto: doc.Assunto,
|
||||
// } 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'
|
||||
} else {
|
||||
this.placeholderSubject = 'Selecione o tipo de assunto*'
|
||||
}
|
||||
|
||||
this.postData = new Despacho();
|
||||
this.participants = this.participants = new Array();
|
||||
@@ -461,7 +460,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
/* if(this.postData.DispatchFolder.Message){ */
|
||||
/* if(this.postData.DispatchFolder.Message){
|
||||
if(this.selectedTypes.length > 0) { */
|
||||
try {
|
||||
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
|
||||
@@ -471,6 +471,11 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
} finally {
|
||||
//loader.remove()
|
||||
}
|
||||
/* } else {
|
||||
this.validateField = true;
|
||||
this.toastService._badRequest('Por favor selecione um assunto');
|
||||
} */
|
||||
|
||||
/* }
|
||||
else{
|
||||
this.validateField = true;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="menu-ptions">
|
||||
<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 == 'doneIt' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
</button>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="menu-ptions">
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="div-icon d-flex">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
<div class="bg-4 d-flex justify-center align-center">
|
||||
<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 == '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>
|
||||
<!-- <h3 class="center text-white">doneIT</h3> -->
|
||||
<h3 class="center text-white">Gabinete Digital</h3>
|
||||
<form class="form">
|
||||
<p class="form-label">Email</p>
|
||||
|
||||
@@ -112,8 +112,15 @@ export class LoginPage implements OnInit {
|
||||
if (this.validateUsername()) {
|
||||
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 = {
|
||||
username: this.username.trim(),
|
||||
username: newUserName.trim(),
|
||||
password: this.password.trim(),
|
||||
domainName: environment.domain,
|
||||
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 { Media } from '@ionic-native/media/ngx';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
const config = {
|
||||
quality: 0.5,
|
||||
maxWidth: 800,
|
||||
@@ -130,7 +131,8 @@ export class NewPublicationPage implements OnInit {
|
||||
private RouteService: RouteService,
|
||||
public FileService: FileService,
|
||||
private mediaCapture: MediaCapture,
|
||||
public checkFileType: checkFileTypeService
|
||||
public checkFileType: checkFileTypeService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
|
||||
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="div-title flex-grow-1">
|
||||
<ion-label class="title font-25-em">Acções</ion-label>
|
||||
<!-- <div>
|
||||
<input type="file" (change)="onFileSelect($event)" />
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<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 { Storage } from '@ionic/storage';
|
||||
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';
|
||||
|
||||
|
||||
@@ -70,6 +74,9 @@ export class PublicationsPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
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"];
|
||||
@@ -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) {
|
||||
const modal = await this.modalController.create({
|
||||
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();
|
||||
});
|
||||
});
|
||||
@@ -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, '<').replace(/>/g, '>'); */
|
||||
}
|
||||
|
||||
/* sanitizeInput(input: string): string {
|
||||
return this.sanitizer.sanitize(SecurityContext.HTML, input);
|
||||
} */
|
||||
}
|
||||
@@ -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};
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CustomCalendarEvent, EventListStore } from 'src/app/models/agenda/AgendaEventList';
|
||||
import { DateService } from '../date.service';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -9,6 +10,7 @@ export class ListBoxService {
|
||||
|
||||
height = "unset"
|
||||
|
||||
|
||||
constructor(
|
||||
private dateService: DateService
|
||||
){}
|
||||
@@ -35,7 +37,7 @@ export class ListBoxService {
|
||||
|
||||
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
|
||||
// if(selectedDate) {
|
||||
@@ -45,7 +47,6 @@ export class ListBoxService {
|
||||
// )
|
||||
// }
|
||||
|
||||
|
||||
if(segment!='Combinado') {
|
||||
eventSource = this.filterSegment(eventSource, segment)
|
||||
}
|
||||
@@ -55,17 +56,59 @@ export class ListBoxService {
|
||||
// }
|
||||
|
||||
let newStracture:CustomCalendarEvent[];
|
||||
|
||||
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) {
|
||||
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);
|
||||
|
||||
@@ -95,7 +138,7 @@ export class ListBoxService {
|
||||
|
||||
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;
|
||||
|
||||
@@ -121,26 +164,28 @@ export class ListBoxService {
|
||||
// last push
|
||||
|
||||
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 {
|
||||
|
||||
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 {
|
||||
|
||||
|
||||
if(this.CanPush(event, selectedDate)) days[day].push(event)
|
||||
if(this.CanPush(event, selectedDate)) { days[day].push(event) ; this.push(event, year) }
|
||||
}
|
||||
} else {
|
||||
if(this.CanPush(event, selectedDate)) days[day].push(event)
|
||||
if(this.CanPush(event, selectedDate)) { days[day].push(event) ; this.push(event, year) }
|
||||
}
|
||||
} 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) {
|
||||
|
||||
return new Date(event.start).getMonth() == selectedDate.getMonth() &&
|
||||
new Date(event.start).getFullYear() == selectedDate.getFullYear() &&
|
||||
new Date(event.start).getDate() >= selectedDate.getDate()
|
||||
const limite = this.endOfMonth(selectedDate)
|
||||
limite.setDate(limite.getDate() + 10)
|
||||
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[] {
|
||||
@@ -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
|
||||
];
|
||||
|
||||
@@ -319,6 +319,8 @@ export class MessageService {
|
||||
if(params?.attachments) {
|
||||
if(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;
|
||||
} else {
|
||||
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())
|
||||
console.log('Attendes Email', filterLoggedUserEmail)
|
||||
// console.log('Attendes Email', filterLoggedUserEmail)
|
||||
let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "")
|
||||
this.contacts = filterEmptyEmail;
|
||||
console.log('Attendes Email', this.contacts)
|
||||
// console.log('Attendes Email', this.contacts)
|
||||
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) {
|
||||
switch (service) {
|
||||
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;
|
||||
case 'filetype':
|
||||
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));
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,6 +239,8 @@ export class NotificationsService {
|
||||
}
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
|
||||
navigator.serviceWorker.onmessage = (event) => {
|
||||
console.log('Mensagem recebida do Service Worker:', event.data.data);
|
||||
let object = {
|
||||
@@ -250,6 +252,9 @@ export class NotificationsService {
|
||||
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();
|
||||
});
|
||||
});
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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")
|
||||
@@ -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 { ThemeService } from 'src/app/services/theme.service'
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
|
||||
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
@@ -131,7 +132,8 @@ export class EditEventToApprovePage implements OnInit {
|
||||
private processes:ProcessesService,
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService,
|
||||
public httpErrorHandler: HttpErrorHandle
|
||||
public httpErrorHandler: HttpErrorHandle,
|
||||
private domSanitizeService: DomSanitizerService
|
||||
) {
|
||||
this.isEventEdited = false;
|
||||
}
|
||||
@@ -324,6 +326,10 @@ export class EditEventToApprovePage implements OnInit {
|
||||
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.forEach(e=>{
|
||||
|
||||
@@ -15,6 +15,7 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { ContactsService } from 'src/app/services/contacts.service'
|
||||
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
@@ -100,7 +101,8 @@ export class EditEventPage implements OnInit {
|
||||
private attachmentsService: AttachmentsService,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private contactsService: ContactsService
|
||||
private contactsService: ContactsService,
|
||||
private domSanitizeService: DomSanitizerService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -344,6 +346,9 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
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')) {
|
||||
this._postEvent.EventRecurrence.Type = '-1'
|
||||
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
} from '@angular/material-moment-adapter';
|
||||
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 { InputFilterDirective } from 'src/app/services/directives/input-filter.directive';
|
||||
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -34,6 +34,8 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
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 = {
|
||||
parse: {
|
||||
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||
@@ -131,6 +133,8 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
environment = environment
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[] = [];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -142,7 +146,9 @@ export class NewEventPage implements OnInit {
|
||||
private chatMethodService: ChatMethodsService,
|
||||
private hhtpErrorHandle: HttpErrorHandle,
|
||||
private processeService: ProcessesService,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
private domSanitazerService: DomSanitizerService
|
||||
) {
|
||||
this.dateAdapter.setLocale('pt');
|
||||
this.loggeduser = SessionStore.user;
|
||||
@@ -220,6 +226,7 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log('Attendes',this.taskParticipants)
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
|
||||
@@ -234,6 +241,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
this.injectValidation();
|
||||
this.changeAgenda()
|
||||
this.fetchContacts("")
|
||||
|
||||
}
|
||||
|
||||
@@ -497,6 +505,10 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -987,5 +999,34 @@ export class NewEventPage implements OnInit {
|
||||
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()">
|
||||
<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 == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -130,7 +130,7 @@
|
||||
</div>
|
||||
|
||||
<!-- <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' "
|
||||
src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
</div> -->
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="right">
|
||||
<!-- <div (click)=" ChatSystemService.getGroupRoom(this.roomId).deleteAll()">delete all</div> -->
|
||||
<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>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -29,6 +29,7 @@ import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -105,6 +106,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
private platform: Platform,
|
||||
private fileOpener: FileOpener,
|
||||
public p: PermissionService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
|
||||
this.ChatSystemService.getUser()
|
||||
@@ -901,9 +903,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
|
||||
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) => {
|
||||
console.error(error);
|
||||
@@ -946,9 +950,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
fileBase64: fileBase64,
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest("Ficheiro inválido")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div hidden class="right">
|
||||
<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>
|
||||
</button>
|
||||
|
||||
@@ -33,6 +33,7 @@ import { Howl } from 'howler';
|
||||
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 { PermissionService } from 'src/app/services/permission.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
@@ -122,6 +123,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
private platform: Platform,
|
||||
private fileOpener: FileOpener,
|
||||
public p: PermissionService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
// update
|
||||
this.checkAudioPermission()
|
||||
@@ -648,7 +650,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
resultType: CameraResultType.Base64,
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
|
||||
console.log('Selected: ', file)
|
||||
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
base64,
|
||||
@@ -656,7 +658,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
800, // maxHeight
|
||||
0.9 // quality
|
||||
).then((picture) => {
|
||||
console.log('Selected: ', picture)
|
||||
|
||||
base64 = picture
|
||||
});
|
||||
|
||||
@@ -788,15 +790,17 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
//const imageData = await this.fileToBase64Service.convert(file)
|
||||
//
|
||||
|
||||
console.log('Selected: ', file)
|
||||
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
if (file.format == "jpeg" || file.format == "png" || file.format == "gif") {
|
||||
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
base64,
|
||||
800, // maxWidth
|
||||
800, // maxHeight
|
||||
0.9 // quality
|
||||
).then((picture) => {
|
||||
console.log('Selected: ', picture)
|
||||
|
||||
base64 = picture
|
||||
});
|
||||
|
||||
@@ -824,6 +828,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
fileBase64: base64,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -835,11 +841,18 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const roomId = this.roomId
|
||||
|
||||
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)
|
||||
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
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);
|
||||
@@ -886,11 +899,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
fileBase64: fileBase64,
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest("Ficheiro inválido")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -247,15 +247,15 @@ export class AttendeePage implements OnInit {
|
||||
this.showLoader = false;
|
||||
} else {
|
||||
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())
|
||||
if(this.taskType == 0 || this.taskType == 1){
|
||||
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() != "")
|
||||
this.contacts = filterEmptyEmail;
|
||||
console.log('Attendes Email', this.contacts)
|
||||
// console.log('Attendes Email', this.contacts)
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<ion-label class="title">{{ task.Folio}}</ion-label>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<ion-label class="title">{{ task.Folio}}</ion-label>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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> -->
|
||||
|
||||
<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'>
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image"
|
||||
src='assets/images/ministro.png'>
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
|
||||
src='assets/images/secretaria_geral.png'>
|
||||
src='assets/images/secretaria_geral.png'> -->
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -212,15 +211,14 @@
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> -->
|
||||
|
||||
<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'>
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image"
|
||||
src='assets/images/ministro.png'>
|
||||
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
|
||||
src='assets/images/secretaria_geral.png'>
|
||||
src='assets/images/secretaria_geral.png'> -->
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -102,26 +102,29 @@ export class HeaderPage implements OnInit {
|
||||
|
||||
getProfilpicture() {
|
||||
|
||||
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.profilePicture = 'data:image/jpeg;base64,' + base;
|
||||
|
||||
console.log('picture saved', value)
|
||||
console.log('picture saved')
|
||||
}).catch((error) => {
|
||||
console.log('picture not saved')
|
||||
});
|
||||
}, (error) => {
|
||||
console.log('profile picture errro: ', error)
|
||||
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
|
||||
console.log(picture)
|
||||
/* console.log(picture) */
|
||||
this.profilePicture = picture
|
||||
}).catch((error) => {
|
||||
this.profilePicture = "";
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
} else {
|
||||
this.profilePicture = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -266,7 +269,7 @@ export class HeaderPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.notificationLengthData()
|
||||
this.getProfilpicture()
|
||||
this.getProfilePictureSorage()
|
||||
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
|
||||
DraftIds = ""
|
||||
DraftNames = ""
|
||||
asDrat: boolean;
|
||||
asDraft: boolean;
|
||||
|
||||
|
||||
constructor(
|
||||
@@ -48,7 +48,7 @@ export class DiplomaOptionsPage implements OnInit {
|
||||
|
||||
this.DraftIds = this.navParams.get("DraftIds");
|
||||
this.DraftNames = this.navParams.get("DraftNames");
|
||||
this.asDrat = this.navParams.get('asDrat');
|
||||
this.asDraft = this.navParams.get('asDraft');
|
||||
|
||||
|
||||
console.log('this.task', this.task)
|
||||
@@ -241,7 +241,7 @@ export class DiplomaOptionsPage implements OnInit {
|
||||
|
||||
async AssinarNew(note?, doc?) {
|
||||
|
||||
if (this.asDrat) {
|
||||
if (this.asDraft) {
|
||||
const modal = await this.modalController.create({
|
||||
component: PopupQuestionPage,
|
||||
componentProps: {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div *ngIf="content != ''" class="buttons header-fix">
|
||||
<!-- <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>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -14,6 +14,7 @@ import { FilePicker } from '@capawesome/capacitor-file-picker';
|
||||
import { Directory, Encoding, Filesystem } from '@capacitor/filesystem';
|
||||
import { utf8Encode } from '@angular/compiler/src/util';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
@@ -60,7 +61,8 @@ export class NewPublicationPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public PublicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService
|
||||
public checkFileType: checkFileTypeService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
|
||||
@@ -145,6 +147,7 @@ export class NewPublicationPage implements OnInit {
|
||||
this.capturedImage = 'data:image/jpeg;base64,' + capturedImage.base64String;
|
||||
this.capturedImageTitle = 'foto';
|
||||
|
||||
/* if(validation.isOk) { */
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
this.capturedImage,
|
||||
800, // maxWidth
|
||||
@@ -157,6 +160,9 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
this.seletedContent.push(fileObject)
|
||||
});
|
||||
/* } else {
|
||||
this.toastService._badRequest("Imagem inválida")
|
||||
} */
|
||||
}
|
||||
|
||||
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 {
|
||||
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 { FormsModule } from '@angular/forms';
|
||||
|
||||
@@ -31,6 +31,7 @@ setup(attributes: Attributes) {
|
||||
],
|
||||
exports: [ViewPublicationsPage],
|
||||
declarations: [ViewPublicationsPage],
|
||||
providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}]
|
||||
providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
export class ViewPublicationsPageModule {}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</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>
|
||||
|
||||
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
|
||||
|
||||
@@ -43,11 +43,15 @@ export class NotificationHolderService {
|
||||
|
||||
notificationObject(notification) {
|
||||
const element = notification
|
||||
const i = this._notificationList.length + 1
|
||||
|
||||
let notificationObject;
|
||||
|
||||
if (element.notification) {
|
||||
|
||||
notificationObject = {
|
||||
id: notification?.id,
|
||||
id: notification?.id || uuidv4(),
|
||||
index: i,
|
||||
title: element.notification.title,
|
||||
Service: element.data.Service,
|
||||
Object: element.data.Object,
|
||||
@@ -65,7 +69,8 @@ export class NotificationHolderService {
|
||||
|
||||
} else if (element.data) {
|
||||
notificationObject = {
|
||||
id: notification?.id,
|
||||
id: notification?.id || uuidv4(),
|
||||
index: i,
|
||||
title: element.title,
|
||||
Service: element.data.Service,
|
||||
Object: element.data.Object,
|
||||
@@ -84,19 +89,20 @@ export class NotificationHolderService {
|
||||
} else {
|
||||
{
|
||||
notificationObject = {
|
||||
id: notification?.id,
|
||||
title: element.title,
|
||||
Service: element.Service,
|
||||
Object: element.Object,
|
||||
IdObject: element.IdObject,
|
||||
id: notification?.id || uuidv4(),
|
||||
FolderId: element.FolderId,
|
||||
body: element.body,
|
||||
dateInit: element.dateInit,
|
||||
dateEnd: element.dateEnd,
|
||||
IdObject: element.IdObject,
|
||||
Location: element.Location,
|
||||
TypeAgenda: element.TypeAgenda,
|
||||
Object: element.Object,
|
||||
Role: element.Role,
|
||||
Service: element.Service,
|
||||
Status: element.Status,
|
||||
TypeAgenda: element.TypeAgenda,
|
||||
body: element.body,
|
||||
dateEnd: element.dateEnd,
|
||||
dateInit: element.dateInit,
|
||||
index: element.index,
|
||||
title: element.title,
|
||||
read: false,
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
@@ -3,12 +3,16 @@ import { Environment } from './../../app/models/envarioment';
|
||||
|
||||
export const doneITProd: Environment = {
|
||||
id:'1',
|
||||
apiURL: 'https://API.DONEIT.CO.AO/api/',
|
||||
apiURL: 'https://gdapi-dev.dyndns.info/api/',
|
||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
||||
/* apiURL: 'https://API.DONEIT.CO.AO/api/',
|
||||
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
|
||||
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
|
||||
apiPCURL: 'http://192.168.0.21:9099/api/',
|
||||
apiPCURL: 'http://192.168.0.21:9099/api/', */
|
||||
production: true,
|
||||
domain: 'equilibrium.co.ao',
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: '',
|
||||
defaultuserpwd: '',
|
||||
chatOffline: true,
|
||||
@@ -29,14 +33,18 @@ export const doneITProd: Environment = {
|
||||
|
||||
export const doneITDev: Environment = {
|
||||
id:'1',
|
||||
apiURL: 'https://API.DONEIT.CO.AO/api/',
|
||||
apiURL: 'https://gdapi-dev.dyndns.info/api/',
|
||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
||||
/* apiURL: 'https://API.DONEIT.CO.AO/api/',
|
||||
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
|
||||
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
|
||||
apiPCURL: 'http://192.168.0.21:9099/api/',
|
||||
apiPCURL: 'http://192.168.0.21:9099/api/', */
|
||||
production: true,
|
||||
domain: 'equilibrium.co.ao',
|
||||
defaultuser: 'peter.maquiran@equilibrium.co.ao',
|
||||
defaultuserpwd: 'codcodccx',
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: '',
|
||||
defaultuserpwd: '',
|
||||
chatOffline: true,
|
||||
presidential: false,
|
||||
version: versionData,
|
||||
|
||||
@@ -19,7 +19,7 @@ firebase.initializeApp(firebaseConfig);
|
||||
const messaging = firebase.messaging();
|
||||
|
||||
messaging.onBackgroundMessage(function(payload) {
|
||||
console.log('Received background message 22 ', payload);
|
||||
// console.log('Received background message 22 ', payload);
|
||||
|
||||
const notificationTitle = payload.notification.title;
|
||||
const notificationOptions = {
|
||||
@@ -33,11 +33,11 @@ messaging.onBackgroundMessage(function(payload) {
|
||||
|
||||
self.addEventListener('install', function(event) {
|
||||
self.skipWaiting();
|
||||
console.log('Installed', event);
|
||||
// console.log('Installed', event);
|
||||
});
|
||||
|
||||
self.addEventListener('activate', function(event) {
|
||||
console.log('Activated', event);
|
||||
// console.log('Activated', event);
|
||||
});
|
||||
|
||||
self.addEventListener('push', function(event) {
|
||||
@@ -45,14 +45,14 @@ self.addEventListener('push', function(event) {
|
||||
var uid = "EXISTS_IN_CORE.JS";
|
||||
var token = "ALSO_EXISTS_IN_CORE.JS";
|
||||
|
||||
console.log("Push recieved - we need to know the uid and token here, from core.js");
|
||||
// console.log("Push recieved - we need to know the uid and token here, from core.js");
|
||||
});
|
||||
|
||||
self.addEventListener('message', function(event){
|
||||
var data = JSON.parse(event.data);
|
||||
|
||||
console.log("SW Received Message:");
|
||||
console.log(data);
|
||||
// console.log("SW Received Message:");
|
||||
// console.log(data);
|
||||
|
||||
self.userID = data.uid;
|
||||
self.userToken = data.token;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user