Compare commits

...

No commits in common. 'main' and 'MOE_MAIN-COLOR_CHANGES' have entirely different histories.

36
Mohem/.gitignore vendored

@ -0,0 +1,36 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
npm-debug.log*
package-lock.json
package.json
.idea/
.ionic/
.sourcemaps/
.sass-cache/
.tmp/
.versions/
coverage/
www/
node_modules/
tmp/
temp/
platforms/
plugins/
plugins/android.json
plugins/ios.json
$RECYCLE.BIN/
.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>433856133450-4fo40j578p9v3g9uvofk6uv8bk882lc4.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.433856133450-4fo40j578p9v3g9uvofk6uv8bk882lc4</string>
<key>API_KEY</key>
<string>AIzaSyC3zU_Wv49lpcg9aMG_lyZWQ_5cI925fc4</string>
<key>GCM_SENDER_ID</key>
<string>433856133450</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.moenergy.khadmaty2</string>
<key>PROJECT_ID</key>
<string>khadmaty2-250fc</string>
<key>STORAGE_BUCKET</key>
<string>khadmaty2-250fc.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:433856133450:ios:a302a61a86bba4cdcda9b3</string>
</dict>
</plist>

@ -0,0 +1,200 @@
{
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
"version": 1,
"defaultProject": "app",
"newProjectRoot": "projects",
"projects": {
"app": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "www",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
],
"styles": [
{
"input": "src/theme/variables.scss"
},
{
"input": "src/global.scss"
},
{
"input": "src/app/app.scss"
}
],
"scripts": ["node_modules/chart.js/dist/Chart.js"],
"es5BrowserSupport": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
},
"ci": {
"progress": false
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
},
"ci": {
"progress": false
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [],
"scripts": [],
"assets": [
{
"glob": "favicon.ico",
"input": "src/",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
}
]
},
"configurations": {
"ci": {
"progress": false,
"watch": false
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
}
},
"ionic-cordova-build": {
"builder": "@ionic/angular-toolkit:cordova-build",
"options": {
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "app:build:production"
}
}
},
"ionic-cordova-serve": {
"builder": "@ionic/angular-toolkit:cordova-serve",
"options": {
"cordovaBuildTarget": "app:ionic-cordova-build",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"cordovaBuildTarget": "app:ionic-cordova-build:production",
"devServerTarget": "app:serve:production"
}
}
}
}
},
"app-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"devServerTarget": "app:serve:production"
},
"ci": {
"devServerTarget": "app:serve:ci"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": ["**/node_modules/**"]
}
}
}
}
},
"cli": {
"defaultCollection": "@ionic/angular-toolkit"
},
"schematics": {
"@ionic/angular-toolkit:component": {
"styleext": "scss"
},
"@ionic/angular-toolkit:page": {
"styleext": "scss"
}
}
}

@ -0,0 +1,134 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.moenergy.khadmaty2" version="1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>خدماتي</name>
<description>An app created by cloud Solutions</description>
<author email="eservicescs@cloudsolution-sa.com" href="http://cloudsolution-sa.com">Cloud Solutions</author>
<content src="index.html" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="ScrollEnabled" value="false" />
<preference name="KeyboardResize" value="true" />
<preference name="KeyboardResizeMode" value="native" />
<preference name="HideKeyboardFormAccessoryBar" value="false" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="fullscreen" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="orientation" value="portrait" />
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="@xml/network_security_config" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
<icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
<icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
<icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
<icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
<icon height="58" src="resources/ios/icon/icon-29@2x.png" width="58" />
<icon height="87" src="resources/ios/icon/icon-29@3x.png" width="87" />
<icon height="48" src="resources/ios/icon/icon-24@2x.png" width="48" />
<icon height="55" src="resources/ios/icon/icon-27.5@2x.png" width="55" />
<icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
<icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
<icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
<icon height="216" src="resources/ios/icon/icon-108@2x.png" width="216" />
<splash height="2688" src="resources/ios/splash/Default-2688h~iphone.png" width="1242" />
<splash height="1242" src="resources/ios/splash/Default-Landscape-2688h~iphone.png" width="2688" />
<splash height="1792" src="resources/ios/splash/Default-1792h~iphone.png" width="828" />
<splash height="828" src="resources/ios/splash/Default-Landscape-1792h~iphone.png" width="1792" />
<splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
<splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
</platform>
<platform name="android">
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="30" />
</platform>
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="cordova-plugin-datepicker" spec="~0.9.3" />
<plugin name="cordova-plugin-ionic-webview" spec="4.1.0">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>
<plugin name="cordova-sqlite-storage" spec="^3.4.0" />
<plugin name="cordova-plugin-nativestorage" spec="^2.3.2" />
<plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="^3.2.2" />
<plugin name="cordova-plugin-globalization" spec="^1.11.0" />
<plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
<plugin name="cordova-plugin-device" spec="^2.0.3" />
<plugin name="cordova-plugin-local-notification" spec="^0.9.0-beta.2" />
<plugin name="cordova-plugin-badge" spec="^0.8.8" />
<plugin name="cordova.plugins.diagnostic" spec="^5.0.1" />
<plugin name="cordova-plugin-camera" spec="^4.1.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.2.0" />
<plugin name="cordova-plugin-appavailability" spec="^0.4.2" />
<plugin name="cordova-plugin-apprate" spec="^1.4.0" />
<plugin name="cordova-plugin-file" spec="^6.0.2" />
<plugin name="cordova-plugin-filepath" spec="^1.5.6" />
<plugin name="com-badrit-base64" spec="^0.2.0" />
<plugin name="cordova-plugin-fingerprint-aio" spec="^3.0.0">
<variable name="FACEID_USAGE_DESCRIPTION" value="User Authentication" />
</plugin>
<allow-navigation href="http://localhost:8100" sessionid="ccddd6d3" />
</widget>

@ -0,0 +1,28 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};

@ -0,0 +1,14 @@
import { AppPage } from './app.po';
describe('new App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should be blank', () => {
page.navigateTo();
expect(page.getParagraphText()).toContain('The world is your oyster.');
});
});

@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.deepCss('app-root ion-content')).getText();
}
}

@ -0,0 +1,13 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}

@ -0,0 +1,46 @@
{
"project_info": {
"project_number": "433856133450",
"project_id": "khadmaty2-250fc",
"storage_bucket": "khadmaty2-250fc.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:433856133450:android:ef6d4285c5dc9aaccda9b3",
"android_client_info": {
"package_name": "com.moenergy.khadmaty2"
}
},
"oauth_client": [
{
"client_id": "433856133450-1kiutma9906m0ioe270c7u9qrvgjg92v.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyC1KpsYOYj20Qo1F9m-7L42Ny90O9PYTJk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "433856133450-1kiutma9906m0ioe270c7u9qrvgjg92v.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "433856133450-4fo40j578p9v3g9uvofk6uv8bk882lc4.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.moenergy.khadmaty2"
}
}
]
}
}
}
],
"configuration_version": "1"
}

@ -0,0 +1,162 @@
@echo start installing required native and 3rd party plugins
@echo to update angular -> npm install -g @angular/cli
@echo to update ionic -> npm install -g ionic
@echo add browser, android , ios platforms commit non required
@echo to add browser -> call ionic cordova platform add browser
@echo to add ios -> call ionic cordova platform add ios
call ionic cordova platform add android
@echo copying android FCM google servcie file
call cp ./google-services.json ./platforms/android/
call npm i @angular/animations
call npm i @swimlane/ngx-charts --save
@echo primeng framework [angular]
call npm install primeng --save
call npm install primeicons --save
@echo add css links for primeng in global.scss
@echo @import "../node_modules/primeng/resources/themes/nova-light/theme.css";
@echo @import "../node_modules/primeng/resources/primeng.min.css";
@echo @import "../node_modules/primeicons/primeicons.css";
@echo install chartjs as dependency for primeng chartjs
call npm install chart.js --save
@echo add reference in [angular.json] in [scripts] array add (node_modules/chart.js/dist/Chart.js)
@echo calendar https://mattlewis92.github.io/angular-calendar/#/kitchen-sink
call npm install --save @ng-bootstrap/ng-bootstrap
call npm install --save angular-calendar date-fns
@echo install android support gradle release because of barcode scanner to install missing android attributes
call ionic cordova plugin add cordova-android-support-gradle-release --fetch
@echo sqlite storage
call ionic cordova plugin add cordova-sqlite-storage
call npm install @ionic-native/sqlite
@echo native storage
call ionic cordova plugin add cordova-plugin-nativestorage
call npm install @ionic-native/native-storage
@echo bluetooth ble centeral //check interface assets/js/bletooth.js
call ionic cordova plugin add cordova-plugin-ble-central
call npm install @ionic-native/ble
@echo launch navigator
@echo warning : for now we stick with launch navigator 3 since 5 has issue
REM call ionic cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable GOOGLE_API_KEY_FOR_ANDROID="AIzaSyC-XbzwGMyAVCnspof0cqiO4iLfKmeEYVA"
call ionic cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator@3
call npm install @ionic-native/launch-navigator
@echo themeablebrowser
call ionic cordova plugin add cordova-plugin-themeablebrowser
call npm install @ionic-native/themeable-browser
@echo in app browser
call ionic cordova plugin add cordova-plugin-inappbrowser
call npm install @ionic-native/in-app-browser
@echo globalization
call ionic cordova plugin add cordova-plugin-globalization
call npm install @ionic-native/globalization
@echo android permissions plugin
call ionic cordova plugin add cordova-plugin-android-permissions
call npm install @ionic-native/android-permissions
@echo sms reader https://www.npmjs.com/package/cordova-plugin-sms-receive
call npm i cordova-plugin-sms-receive
call cordova plugin add cordova-plugin-sms-receive
@echo device information
call ionic cordova plugin add cordova-plugin-device
call npm install @ionic-native/device
@echo local notifications
call ionic cordova plugin add cordova-plugin-local-notification
call npm install @ionic-native/local-notifications
@echo badge
call ionic cordova plugin add cordova-plugin-badge
call npm install @ionic-native/badge
@echo biometric features
call ionic cordova plugin add cordova-plugin-fingerprint-aio --variable FACEID_USAGE_DESCRIPTION="User Authentication"
call npm install @ionic-native/fingerprint-aio
@echo install diagnostic
call ionic cordova plugin add cordova.plugins.diagnostic
call npm install @ionic-native/diagnostic
@echo install barcode plugin
call ionic cordova plugin add phonegap-plugin-barcodescanner
call npm install @ionic-native/barcode-scanner
@echo install camera plugin
call ionic cordova plugin add cordova-plugin-camera
call npm install @ionic-native/camera
@echo install keyboard plugin
call ionic cordova plugin add cordova-plugin-ionic-keyboard
call npm install @ionic-native/keyboard
@echo install opentok required permissions
call ionic cordova plugin add cordova-opentok-android-permissions
@echo install App Availability Plugin
call ionic cordova plugin add cordova-plugin-appavailability
call npm install @ionic-native/app-availability
@echo install rate plugin
call ionic cordova plugin add cordova-plugin-apprate
call npm install @ionic-native/app-rate
@echo install file plugin
call ionic cordova plugin add cordova-plugin-file
call npm install @ionic-native/file
@echo install filePath plugin
call ionic cordova plugin add cordova-plugin-filepath
call npm install @ionic-native/file-path
@echo install Base64 plugin
call ionic cordova plugin add com-badrit-base64
call npm install @ionic-native/base64
@echo install Firebasex plugin
call ionic cordova plugin add cordova-plugin-firebasex
call npm install @ionic-native/firebase-x
@echo reinitializing git repository
@echo git init
@echo git remote add origin https://enas_yaghi@hmg.git.cloudforge.com/patientappionic.git
@echo git push -f origin master
@echo update project from package.js change if necessary
@echo to install all dependencies in package.json
@echo npm cache clean --force
@echo exact version -> npm install --save --save-exact react
@echo latest versions based on package.json rules -> npm install
@echo to build or serve for (( production ))
@echo export NODE_OPTIONS=--max-old-space-size=4096
@echo ionic cordova build android --release --aot --minifyjs --optimizejs --minifycss
@echo ionic cordova build ios --release --aot --minifyjs --optimizejs --minifycss

@ -0,0 +1,158 @@
#!/bin/sh
echo start installing required native and 3rd party plugins
echo to update angular -> npm install -g @angular/cli
echo to update ionic -> npm install -g ionic
echo add browser, android , ios platforms commit non required
echo to add browser -> call ionic cordova platform add browser
echo to add ios -> call ionic cordova platform add ios
ionic cordova platform add android
echo copying android FCM google servcie file
cp ./google-services.json ./platforms/android/
npm i @angular/animations
npm i @swimlane/ngx-charts --save
echo primeng framework [angular]
npm install primeng --save
npm install primeicons --save
echo add css links for primeng in global.scss
echo @import "../node_modules/primeng/resources/themes/nova-light/theme.css";
echo @import "../node_modules/primeng/resources/primeng.min.css";
echo @import "../node_modules/primeicons/primeicons.css";
echo install chartjs as dependency for primeng chartjs
npm install chart.js --save
# echo add reference in [angular.json] in [scripts] array add (node_modules/chart.js/dist/Chart.js)
echo calendar https://mattlewis92.github.io/angular-calendar/#/kitchen-sink
npm install --save @ng-bootstrap/ng-bootstrap
npm install --save angular-calendar date-fns
echo install android support gradle release because of barcode scanner to install missing android attributes
ionic cordova plugin add cordova-android-support-gradle-release --fetch
echo sqlite storage
ionic cordova plugin add cordova-sqlite-storage
npm install @ionic-native/sqlite
echo native storage
ionic cordova plugin add cordova-plugin-nativestorage
npm install @ionic-native/native-storage
echo bluetooth ble centeral //check interface assets/js/bletooth.js
ionic cordova plugin add cordova-plugin-ble-central
npm install @ionic-native/ble
echo launch navigator
echo warning : for now we stick with launch navigator 3 since 5 has issue
# call ionic cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable GOOGLE_API_KEY_FOR_ANDROID="AIzaSyC-XbzwGMyAVCnspof0cqiO4iLfKmeEYVA"
ionic cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator@3
npm install @ionic-native/launch-navigator
echo themeablebrowser
ionic cordova plugin add cordova-plugin-themeablebrowser
npm install @ionic-native/themeable-browser
echo in app browser
ionic cordova plugin add cordova-plugin-inappbrowser
npm install @ionic-native/in-app-browser
echo globalization
ionic cordova plugin add cordova-plugin-globalization
npm install @ionic-native/globalization
echo android permissions plugin
ionic cordova plugin add cordova-plugin-android-permissions
npm install @ionic-native/android-permissions
echo sms reader https://www.npmjs.com/package/cordova-plugin-sms-receive
npm i cordova-plugin-sms-receive
cordova plugin add cordova-plugin-sms-receive
echo device information§
ionic cordova plugin add cordova-plugin-device
npm install @ionic-native/device
echo local notifications
ionic cordova plugin add cordova-plugin-local-notification
npm install @ionic-native/local-notifications
echo badge
ionic cordova plugin add cordova-plugin-badge
npm install @ionic-native/badge
echo biometric features
ionic cordova plugin add cordova-plugin-fingerprint-aio --variable FACEID_USAGE_DESCRIPTION="User Authentication"
npm install @ionic-native/fingerprint-aio
echo install diagnostic
ionic cordova plugin add cordova.plugins.diagnostic
npm install @ionic-native/diagnostic
echo install background-geolocation
ionic cordova plugin add cordova-plugin-mauron85-background-geolocation@alpha --variable GOOGLE_PLAY_SERVICES_VERSION="16.0.0"
npm install @ionic-native/background-geolocation
echo install barcode plugin
ionic cordova plugin add phonegap-plugin-barcodescanner
npm install @ionic-native/barcode-scanner
echo install camera plugin
ionic cordova plugin add cordova-plugin-camera
npm install @ionic-native/camera
echo install keyboard plugin
ionic cordova plugin add cordova-plugin-ionic-keyboard
npm install @ionic-native/keyboard
echo install opentok required permissions
ionic cordova plugin add cordova-opentok-android-permissions
echo install health plugin
ionic cordova plugin add cordova-plugin-health --variable HEALTH_READ_PERMISSION="App needs read access to read heart rate" --variable HEALTH_WRITE_PERMISSION="App needs write access for heart rate" --variable GMS_VERSION="16.0.1"
npm install @ionic-native/health
echo install App Availability Plugin
ionic cordova plugin add cordova-plugin-appavailability
npm install @ionic-native/app-availability
echo install rate plugin
ionic cordova plugin add cordova-plugin-apprate
npm install @ionic-native/app-rate
echo reinitializing git repository
echo git init
echo git remote add origin https://enas_yaghi@hmg.git.cloudforge.com/patientappionic.git
echo git push -f origin master
echo update project from package.js change if necessary
echo to install all dependencies in package.json
echo npm cache clean --force
echo exact version -> npm install --save --save-exact react
echo latest versions based on package.json rules -> npm install
echo to build or serve for (( production ))
echo export NODE_OPTIONS=--max-old-space-size=4096
echo ionic serve --prod -> for serving in production
echo ionic cordova build android --release --aot --minifyjs --optimizejs --minifycss
echo ionic cordova build ios --release --aot --minifyjs --optimizejs --minifycss

@ -0,0 +1,7 @@
{
"name": "Mohem",
"integrations": {
"cordova": {}
},
"type": "angular"
}

Binary file not shown.

@ -0,0 +1 @@
latest versions based on package.json rules - install

@ -0,0 +1,217 @@
{
"name": "MOHEM",
"version": "0.0.1",
"author": "Cloud Solutions",
"homepage": "http://www.cloudsolution-sa.com/",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"dependencies": {
"@angular/animations": "^7.2.15",
"@angular/common": "^7.2.2",
"@angular/core": "^7.2.2",
"@angular/forms": "^7.2.2",
"@angular/http": "^7.2.2",
"@angular/platform-browser": "^7.2.2",
"@angular/platform-browser-dynamic": "^7.2.2",
"@angular/router": "^7.2.2",
"@ionic-native/android-permissions": "^5.18.0",
"@ionic-native/app-availability": "^5.18.0",
"@ionic-native/app-rate": "^5.18.0",
"@ionic-native/badge": "^5.18.0",
"@ionic-native/base64": "^5.18.0",
"@ionic-native/camera": "^5.18.0",
"@ionic-native/core": "^5.8.0",
"@ionic-native/date-picker": "^5.10.0",
"@ionic-native/device": "^5.18.0",
"@ionic-native/diagnostic": "^5.18.0",
"@ionic-native/file": "^5.18.0",
"@ionic-native/file-chooser": "^5.36.0",
"@ionic-native/file-opener": "^5.36.0",
"@ionic-native/file-path": "^5.18.0",
"@ionic-native/file-picker": "^5.36.0",
"@ionic-native/fingerprint-aio": "^5.18.0",
"@ionic-native/firebase-x": "^5.34.0",
"@ionic-native/globalization": "^5.18.0",
"@ionic-native/health": "^5.4.0",
"@ionic-native/keyboard": "^5.17.0",
"@ionic-native/launch-navigator": "^5.17.0",
"@ionic-native/local-notifications": "^5.17.0",
"@ionic-native/native-storage": "^5.17.0",
"@ionic-native/open-native-settings": "^5.14.0",
"@ionic-native/sms-retriever": "^5.36.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/sqlite": "^5.18.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^4.1.0",
"@ng-bootstrap/ng-bootstrap": "^4.2.2",
"@swimlane/ngx-charts": "^10.1.0",
"angular-calendar": "^0.26.11",
"app": "0.1.0",
"chart.js": "^2.9.3",
"com-badrit-base64": "^0.2.0",
"cordova-android": "^8.1.0",
"cordova-android-support-gradle-release": "^3.0.1",
"cordova-open-native-settings": "^1.5.2",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-android-permissions": "^1.0.2",
"cordova-plugin-androidx": "^1.0.2",
"cordova-plugin-androidx-adapter": "^1.1.0",
"cordova-plugin-appavailability": "^0.4.2",
"cordova-plugin-apprate": "^1.4.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-datepicker": "^0.9.3",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-file-opener2": "^3.0.5",
"cordova-plugin-filechooser": "^1.2.0",
"cordova-plugin-filepath": "^1.5.6",
"cordova-plugin-filepicker": "^1.1.6",
"cordova-plugin-fingerprint-aio": "^3.0.0",
"cordova-plugin-firebasex": "^13.0.0",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.0",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-sms-retriever-manager": "^1.0.3",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-sqlite-storage": "^3.4.0",
"cordova-support-google-services": "^1.3.2",
"cordova.plugins.diagnostic": "^5.0.1",
"core-js": "^2.5.4",
"date-fns": "^1.30.1",
"ionic2-calendar": "^0.5.8",
"ionic4-rating": "^1.0.9",
"ng-circle-progress": "^1.5.1",
"ng2-file-upload": "^1.3.0",
"ng2-pdf-viewer": "^5.3.2",
"ngx-gauge": "^1.0.0-beta.10",
"npm": "^6.14.11",
"phonegap-plugin-multidex": "^1.0.0",
"primeicons": "^1.0.0",
"primeng": "^7.1.3",
"run": "1.4.0",
"rxjs": "~6.3.3",
"tslib": "^1.10.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^3.2.2",
"xlsx": "^0.14.3",
"zone.js": "~0.8.29"
},
"devDependencies": {
"@angular-devkit/architect": "~0.12.3",
"@angular-devkit/build-angular": "^0.13.9",
"@angular-devkit/core": "~7.2.3",
"@angular-devkit/schematics": "~7.2.3",
"@angular/cli": "^7.3.6",
"@angular/compiler": "~7.2.2",
"@angular/compiler-cli": "~7.2.2",
"@angular/language-service": "~7.2.2",
"@ionic/angular-toolkit": "~1.4.0",
"@ionic/lab": "3.1.2",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~10.12.0",
"codelyzer": "~4.5.0",
"cordova-ios": "^6.2.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.0.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.13.1",
"protractor": "^5.4.3",
"ts-node": "~8.0.0",
"tslint": "~5.12.0",
"typescript": "3.1.6"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-nativestorage": {},
"cordova-plugin-globalization": {},
"cordova-plugin-android-permissions": {},
"cordova-plugin-badge": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-datepicker": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova.plugins.diagnostic": {
"ANDROID_SUPPORT_VERSION": "28.+"
},
"cordova-open-native-settings": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-file": {},
"cordova-plugin-filepath": {},
"com-badrit-base64": {},
"cordova-sqlite-storage": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {},
"cordova-plugin-local-notification": {},
"cordova-plugin-appavailability": {},
"cordova-plugin-apprate": {},
"cordova-plugin-fingerprint-aio": {
"FACEID_USAGE_DESCRIPTION": "User Authentication"
},
"cordova-plugin-androidx": {},
"cordova-plugin-androidx-adapter": {},
"cordova-plugin-firebasex": {
"FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true",
"FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true",
"FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true",
"ANDROID_ICON_ACCENT": "#FF00FFFF",
"ANDROID_FIREBASE_PERFORMANCE_MONITORING": "false",
"ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0",
"ANDROID_PLAY_SERVICES_AUTH_VERSION": "19.0.0",
"ANDROID_FIREBASE_ANALYTICS_VERSION": "19.0.0",
"ANDROID_FIREBASE_MESSAGING_VERSION": "22.0.0",
"ANDROID_FIREBASE_CONFIG_VERSION": "21.0.0",
"ANDROID_FIREBASE_PERF_VERSION": "20.0.1",
"ANDROID_FIREBASE_AUTH_VERSION": "21.0.1",
"ANDROID_FIREBASE_INAPPMESSAGING_VERSION": "20.0.0",
"ANDROID_FIREBASE_FIRESTORE_VERSION": "23.0.1",
"ANDROID_FIREBASE_FUNCTIONS_VERSION": "20.0.0",
"ANDROID_FIREBASE_IID_VERSION": "21.1.0",
"ANDROID_FIREBASE_INSTALLATIONS_VERSION": "17.0.0",
"ANDROID_FIREBASE_CRASHLYTICS_VERSION": "18.0.1",
"ANDROID_FIREBASE_CRASHLYTICS_NDK_VERSION": "18.0.1",
"ANDROID_GSON_VERSION": "2.8.7",
"ANDROID_FIREBASE_PERF_GRADLE_PLUGIN_VERSION": "1.4.0"
},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
},
"cordova-plugin-sms-retriever-manager": {
"PLAY_SERVICES_VERSION": "15.0.1"
},
"cordova-plugin-file-opener2": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-filepicker": {},
"cordova-plugin-filechooser": {}
},
"platforms": [
"ios",
"android"
]
}
}

@ -0,0 +1,8 @@
These are Cordova resources. You can replace icon.png and splash.png and run
`ionic cordova resources` to generate custom icons and splash screens for your
app. See `ionic cordova resources --help` for details.
Cordova reference documentation:
- Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html
- Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 KiB

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">localhost</domain>
<domain includeSubdomains="true">hrmsys.moenergy.gov.sa</domain>
</domain-config>
</network-security-config>

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 KiB

@ -0,0 +1,56 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('addAttach','title')}}</ion-title>
<ion-buttons slot="primary">
<ion-button style="background: none !important;" (click)="closeBtnModal()">
<ion-icon slot="icon-only" name="close"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('addAttach','title')}}</div>
<div class="fileDiv"> <input end class="inputfile" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" />
<label end for="file">
<ion-icon name="add"></ion-icon>
</label></div>
</ion-card-header>
<ion-card-content>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-row class="rowAH titleH">
<ion-col size="4">
<label class="Header" for=""> {{ts.trPK('addAttach','name')}}</label>
</ion-col>
<ion-col size="4">
<label class="Header" for="">{{ts.trPK('addAttach','size')}} </label>
</ion-col>
<ion-col size="4">
<label class="Header" for=""> {{ts.trPK('addAttach','remove')}} </label>
</ion-col>
</ion-row>
<ion-row class="rowAH" *ngFor="let item of uploader.queue">
<ion-col size="4">
<label for="">{{ item?.file?.name }}</label>
</ion-col>
<ion-col size="4">
<label *ngIf="uploader.options.isHTML5">{{ item?.file?.size/1024/1024 | number:'.2' }}
MB</label>
</ion-col>
<ion-col size="4">
<button class="iconButton" ion-button (click)="removeFile(item)"> <img class="imgSize"
src="../assets/imgs/deletegray.png"></button>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button color="customnavy" (click)="OkBtnModal()">{{ts.trPK('general','ok')}} </ion-button>
</div>
</ion-footer>

@ -0,0 +1,103 @@
.col {
//border: #dedede solid 1px;
padding: 2px !important;
text-align: center;
font-size: 15px;
}
.item-md.item-block .item-inner,
.item-ios.item-block .item-inner {
padding: 0px !important;
}
.iconButton .imgSize{
width:22px !important;
}
.itemAH {
padding: 0px !important;
font-size: 13px;
}
.gridAH {
text-align: center;
padding: 5px 5px !important;
border-radius: 5px;
}
.rowAH {
white-space: normal;
.col {
border: 1px solid var(--cusgray);
label {
font-size: 14px;
}
}
}
.Header {
font-weight: bold;
color: var(--customnavy);
font-size: 14px;
}
.titleH {
font-size: 15px;
border: 1px solid var(--cusgray);
border-top-right-radius: 5px;
border-top-left-radius: 5px;
border-bottom: 0px;
.col {
border: 0px;
}
}
ion-label.label.label-md,
ion-label.label.label-ios {
margin: 0px;
}
.fileDiv .inputfile {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
width: 40px;
height: 40px;
top: 0;
z-index: 100;
// z-index: -1;
}
.inputfile+label {
display: inline-block;
color: var(--light);
}
.fileDiv {
padding: 10px;
position: absolute;
right:0;
top:0;
:root[dir="ltr"] {
float: right;
}
:root[dir="rtl"] {
float: left;
}
}
ion-icon{
font-size: 28px;
}
button.iconButton.button.button-ios.button-default.button-default-ios,
button.iconButton.button.button-md.button-default.button-default-md {
padding: 0px;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AbsenceAttachmentComponent } from './absence-attachment.component';
describe('AbsenceAttachmentComponent', () => {
let component: AbsenceAttachmentComponent;
let fixture: ComponentFixture<AbsenceAttachmentComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AbsenceAttachmentComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AbsenceAttachmentComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,168 @@
import { Component, EventEmitter, OnInit } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { FileUploader } from "ng2-file-upload";
import { AddAttachService } from "../service/add-attach-service";
import { AddEitResponse } from "src/app/eit/models/add.eit.response";
import { ModalController } from '@ionic/angular';
/**
* Generated class for the AddAttachPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@Component({
selector: "absence-attachment",
templateUrl: "absence-attachment.component.html",
styleUrls: ["./absence-attachment.component.scss"]
})
export class AbsenceAttachmentComponent implements OnInit {
private eitResponse: any; //AddEitResponse=new AddEitResponse();
isUpload: boolean = false;
inQueue: boolean = false;
addAttachmentListReq: any;
attachmentID: number = 0;
addAttachRequest: any = [];
fileData: any;
fileType: any;
index: any = 1;
dirPage: any;
TransactionID: any;
indexLastObj: any;
filterAllowedType: any = [
"application/pdf",
"image/jpeg",
"image/png",
"text/plain",
"image/jpg",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
];
constructor(
public common: CommonService,
public AddAttachService: AddAttachService,
public modalCtrl: ModalController,
public ts: TranslatorService
) {
this.eitResponse = this.common.sharedService.getSharedData(
AddEitResponse.SHARED_DATA,
true
);
// this.TransactionID = this.navParams.get("TransactionID");
// this.indexLastObj = this.navParams.get("indexLastObj");
// console.log("this.TransactionID : "+ this.TransactionID);
this.isUpload = false;
}
public uploader: FileUploader = new FileUploader({
allowedMimeType: [
"application/pdf",
"image/jpeg",
"image/png",
"text/plain",
"image/jpg",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
maxFileSize: 10 * 1024 * 1024,
formatDataFunctionIsAsync: true,
formatDataFunction: async item => {
return new Promise((resolve, reject) => {
resolve({
name: item._file.name,
length: item._file.size,
contentType: item._file.type,
date: new Date()
});
});
}
});
public hasBaseDropZoneOver: boolean = false;
public hasAnotherDropZoneOver: boolean = false;
ngOnInit() {}
public fileOverBase(e: any): void {
this.hasBaseDropZoneOver = e;
}
public fileOverAnother(e: any): void {
this.hasAnotherDropZoneOver = e;
}
OkBtnModal() {
let fileCount: number = this.uploader.queue.length;
if (fileCount > 0) {
let data: any = this.addAttachRequest;
this.modalCtrl.dismiss(data);
}
else {
let msg: string = "";
msg = this.ts.trPK("general", "noFileSelect");
this.common.presentAlert(msg);
return;
}
} // end ok button
closeBtnModal() {
this.modalCtrl.dismiss();
}
onFileSelected(input) {
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
let msg: string = "";
msg = this.ts.trPK("general", "noFileSelect");
this.common.presentAlert(msg);
return;
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
// console.log(file);
this.getBase64(file).then(data =>
this.pushObject(data, file.name, file.type)
);
}
}
getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
pushObject(fileData, name, type) {
// console.log("before push: "+ this.index);
this.indexLastObj++;
try {
let array = name.split(".");
let attachType: string = array[array.length - 1];
this.addAttachRequest.push({
AttachmentID: this.indexLastObj,
P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1],
P_FILE_DATA: fileData.split(",")[1],
P_FILE_NAME: name, //.split('.')[0],
P_TRANSACTION_ID: this.TransactionID
});
} catch (e) {}
}
removeFile(objectitem) {
let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem);
this.uploader.queue.splice(objIndex1, 1);
let objIndex = this.addAttachRequest.findIndex(
item => item.AttachmentID == objectitem.AttachmentID
);
this.addAttachRequest.splice(objIndex, 1);
}
}

@ -0,0 +1,261 @@
<app-generic-header
showBack="true"
[headerText]="'submitAbsenceConfirm, submitAbsenceConfirm' | translate">
</app-generic-header>
<ion-content>
<!-------------------------------Start New design ---------------------------------------->
<ion-grid>
<ion-row style="margin-top: 20px;margin-left: 12px;">
<ion-col>
<div size="10" [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'general, addAttach' | translate}} <span *ngIf="selEmp.ATTACHMENT_REQUIRED ==='Y'">*</span></div>
</ion-col>
<ion-col style="padding-left: 7%;" size="2">
<div class="fileDiv">
<input end class="inputfile" style="margin-top: 10px;z-index: 99999;position: absolute;opacity: 0;" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" (click)="onFileSelectedclick($event)" />
<label end for="file" class="attachLable">
<ion-icon style="font-size: 22px;" name="add"></ion-icon>
</label></div>
</ion-col>
</ion-row>
<ion-item class="attachmentDiv" *ngIf="attachListOver?.length == 0">
<ion-img style="height: 26px;width:100%;margin-top:12px" src="../assets/imgs/attach-icon.png"></ion-img>
<ion-label style="margin-top: -24px;" position="floating" class="boldTxtNav">{{ 'general, notAttch' | translate}}</ion-label>
</ion-item>
</ion-grid>
<ion-grid class="attachmentDiv" *ngIf="attachListOver?.length > 0">
<div *ngFor="let attachList of attachListOver ; let i = index">
<ion-row>
<ion-col size="1">
<ion-label style="color: black !important;">
{{attachList.AttachmentID +1 }} .
</ion-label>
</ion-col>
<ion-col style="text-align: left;" size="10">
<ion-label style="color: blue !important;" (click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
{{attachList.P_FILE_NAME }}
</ion-label>
</ion-col>
<ion-col size="1">
<!-- <button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button> -->
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn removeLable"
(click)="removeFile(attachList)">
<ion-icon style="font-size:22px;margin-left:-7px;margin-top:-2px;" name="close"></ion-icon>
</button>
</ion-col>
</ion-row>
</div>
</ion-grid>
<ion-grid *ngIf="attachmentRes?.length > 0">
<div *ngFor="let attachRes of attachmentRes">
<ion-row>
<ion-col col-8>
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachRes.FILE_NAME }} </ion-label>
</ion-col>
<ion-col col-4>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
<button float-end class="attachImgBtn" (click)="delelteFile(attachRes)"><img
class="attachImg" src="../assets/imgs/deletegray.png"></button>
</ion-col>
<!-- <button [disabled]="!isResubmitEIT" class="iconButton" (click)="addAttachment(false,attachRes)"><img
class="imgSize" src="../assets/imgs/editIcon.png"></button>
<button (click)="delelteFile(attachRes)" class="iconButton" [disabled]="!isResubmitEIT"><img
class="imgSize" src="../assets/imgs/cancel.png"></button> -->
</ion-row>
</div>
</ion-grid>
<ion-grid class="">
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, comment' | translate}}</div>
<ion-item class="submitNote" lines="none">
<!-- <ion-label position="floating" class="boldTxtNav">{{'confirmAddEit, comment' | translate}}</ion-label> -->
<ion-textarea type="text" [(ngModel)]="absComments"></ion-textarea>
</ion-item>
</ion-grid>
<ion-grid class="approvalList">
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, approverList' | translate}}</div>
<div class="noDataDiv" *ngIf="approversList.length == 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div style="background-color: white;border-radius: 32px;border: 1px solid #c8c4c4;" *ngIf="approversList?.length > 0">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item style="padding-left: 4%;" *ngFor="let employee of approversList">
<div class="timeline-item" slot="start">
<div [class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png"> </div>
</div>
<ion-col>
<ion-label style="color:black !important ;font-weight: bold;padding-top: 0%;">
{{employee.APPROVER}}
</ion-label>
<ion-label style="color:black !important ;padding-top: 4%;">
{{employee.POSITION_TITLE}}
</ion-label>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</ion-list>
</div>
</ion-grid>
<!-------------------------------End New design ---------------------------------------->
<!-- <ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle"> {{ts.trPK('confirmAddEit','approverList')}}</div>
</ion-card-header>
<ion-card-content class="confirm-details">
<ion-grid class=" gridAH" *ngIf="approversList?.length > 0">
<ion-row class="rowAH titleH">
<ion-col size="1" >
<label class="Header" for="">{{ts.trPK('confirmAddEit','no')}}</label>
</ion-col>
<ion-col size="3">
<label class="Header" for="">{{ts.trPK('confirmAddEit','approver')}}</label>
</ion-col>
<ion-col size="3">
<label class="Header" for="">{{ts.trPK('confirmAddEit','approverCategory')}} </label>
</ion-col>
<ion-col size="3">
<label class="Header" for="">{{ts.trPK('confirmAddEit','approverType')}}</label>
</ion-col>
<ion-col size="2">
<label class="Header" for="">{{ts.trPK('confirmAddEit','status')}}</label>
</ion-col>
</ion-row>
<ion-row class="rowAH" *ngFor="let item of approversList">
<ion-col size="1">
<label for="">{{item.APPROVER_ORDER_NUMBER}}</label>
</ion-col>
<ion-col size="3">
<label for="">{{item.APPROVER}}</label>
</ion-col>
<ion-col size="3">
<label for="">{{item.APPROVER_CATEGORY}}</label>
</ion-col>
<ion-col size="3">
<label for="">{{item.APPROVER_TYPE}}</label>
</ion-col>
<ion-col size="2">
<label for="">{{item.APPROVAL_STATUS}}</label>
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
<ion-item padding>
<ion-label class="boldTxtNav">{{ts.trPK('confirmAddEit','comment')}}</ion-label>
<ion-textarea type="text" [(ngModel)]="absComments"></ion-textarea>
</ion-item>
<div>
<ion-card>
<ion-card-header class="boxHdr">
<div class="hrTitle">{{ts.trPK('absenceList','attachList')}}</div>
<img class="imgSize" src="../assets/imgs/attachment.png" (click)="addAttachment(true,-1)">
</ion-card-header>
<ion-card-content >
<ion-grid *ngIf="attachListOver?.length > 0">
<div *ngFor="let attachList of attachListOver ; let i = index">
<ion-row>
<ion-col size="8">
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachList.P_FILE_NAME }} </ion-label>
</ion-col>
<ion-col size="4">
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn"
(click)="removeFile(attachList)"><img class="attachImg"
src="../assets/imgs/deletegray.png"></button>
</ion-col>
</ion-row>
</div>
</ion-grid>
<ion-grid *ngIf="attachmentRes?.length > 0">
<div *ngFor="let attachRes of attachmentRes">
<ion-row>
<ion-col size="8">
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachRes.FILE_NAME }} </ion-label>
</ion-col>
<ion-col size="4">
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
<button float-end [disabled]="!isResubmitAbs" class="attachImgBtn"
(click)="delelteFile(attachRes)"><img class="attachImg"
src="../assets/imgs/deletegray.png"></button>
</ion-col>
</ion-row>
</div>
</ion-grid>
</ion-card-content>
</ion-card> -->
<!-- </div> -->
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="confirmEitOkButton" (click)="openSubmitModal()" [disabled] ="selEmp.ATTACHMENT_REQUIRED =='Y' && !attachListOver">{{ts.trPK('confirmAddEit','start')}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,285 @@
.imgSize{
position: absolute;
right: 15px;
top: 0;
bottom: 0;
margin: auto;
height:20px;
width:20px;
}
.rowAH ion-col {
border: 1px solid #d9d9d9;
font-size: 13px;
}
.titleH {
font-size: 13px;
border: 1px solid #d9d9d9;
border-top-right-radius: 5px;
border-top-left-radius: 5px;
border-bottom: 0px;
}
.gridAH {
text-align: center;
padding: 5px 5px !important;
border-radius: 5px;
}
ion-card-content.confirm-details{
padding: 0;
}
.confirm-details label{
font-size: 13px;
}
/****************** NEW Design ***************************************/
.footer-button {
border-radius: 2px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
.Header {
font-weight: bold;
color: #1a586d !important;
font-size: 10px;
}
.tbData {
font-size: 10px;
}
.btnBack {
background: transparent;
float: right;
}
.attachmentDiv{
background: #ffffff;
height: auto;
text-align: center;
padding-top: 1px;
margin: 10px;
border-radius: 15px;
border: 1px solid grey;
}
.noDataDiv{
background: #ffffff;
height: 11%;
text-align: center;
padding-top: 1px;
border-radius: 10px;
margin: 10px;
border-radius: 5px;
}
.submitNote{
background: #ffffff;
height: 80px;
padding-top: 1px;
margin: 10px;
border-radius: 15px;
border: 1px solid grey;
}
.approvalList{
--background: #f0efef;
height: auto;
text-align: center;
padding-top: 1px;
border-radius: 10px;
margin: 10px;
border-radius: 5px;
}
/************************New Design**********************************/
.notification-list{
background: none;
background: none;
border-radius: 32px;
ion-item{
// margin-top: 5px;
// margin-bottom: 5px;
background-color: transparent;
.item-date{
width: 100%;
font-size: 16px;
font-weight: bold;
text-align: start;
padding: 0;
margin: 0;
position: absolute;
left: 0;
top: 12%;
}
ion-label , [item-end]{
white-space: normal;
font-size: 14px;
padding-top: 15%;
// :root[dir="ltr"]{
// margin-left: 10px;
// }
// :root[dir="rtl"]{
// margin-right: 10px;
// }
}
}
}
.timeline {
position: relative;
margin: 15px 0 0 0;
// border-bottom: solid 1px var(--cusgray);
}
.timeline:before {
content: '';
position: inherit !important;
top: 0;
bottom: 0;
width: 4px;
// background: #e4e4e4;
z-index: 1;
left: 35px;
/* margin-left: -10px; */
/* z-index: 1; */
}
.timeline .timeline-thumb {
border-radius: 500px;
width: 70px !important;
z-index: 2;
position: absolute;
left: 0px;
// :root[dir="ltr"]{
// left: 37px;
// }
// :root[dir="rtl"]{
// right: 37px;
// }
float: right;
top: 9px;
}
.timeline .timeline-thumb.timeline-icon {
height: 70px;
// text-align: center;
// color: white;
// border: 5px solid #CBD0D3;
// transform: scale(0.2);
}
.timeline .timeline-item {
// width: 40px;
}
.timeline .timeline-stats {
position: relative;
font-size: 12px;
color: var(--darkgray);
}
.empImge{
border-radius: 50%;
width:60px;
height: 60px;
border: #dedede solid 1px;
}
.empImgeRep {
border-radius: 50% !important;
width: 80px;
height: 80px;
border: #dedede solid 1px;
}
.line{
padding-bottom:87px;
}
.attachLable{
position: absolute;
top: 0px;
z-index: 0;
background: #44A7A1;
color: #fff;
border-radius: 50%;
border: 0px;
width: 24px;
height: 24px;
text-align: center;
font-size: 5px;
}
.removeLable{
top: 0px;
z-index: 0;
background: #d8252d;
color: #fff;
border-radius: 50%;
border: 0px;
width: 20px;
height: 20px;
text-align: center;
font-size: 5px;
}
.note-modal {
// width: 90%;
// height: 50%;
// top: 20%;
// left: 5%;
// right: 5%;
// bottom: 5%;
background: rgba(0, 0, 0, 0.5) !important;
padding: 30% 10% !important;
--height: 12cm !important;
// --width: 80% !important;
--border-radius:20px;
}
.header-toolbar-new{
--background: #024d71;
}
.confirmEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
--background: #0ca2de;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}
.approvalTitle-ar{
font-weight: bold;
font-size: 16px;
text-align: right;
}
.approvalTitle{
font-weight: bold;
font-size: 16px;
text-align: left;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AbsenceConfirmComponent } from './absence-confirm.component';
describe('AbsenceConfirmComponent', () => {
let component: AbsenceConfirmComponent;
let fixture: ComponentFixture<AbsenceConfirmComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AbsenceConfirmComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AbsenceConfirmComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,464 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ApproversList } from '../models/approvers';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { WorkListButtonRequest } from 'src/app/eit/models/NotificationButtonReq';
import { ModalController } from '@ionic/angular';
import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes';
import { AbsenceResponse } from '../models/absence.response';
import { SubmitAbConfirmService } from '../service/submit-absence-confirm.service';
import { WorklistAttachService } from '../service/work-list-attach.service';
import { ConfirmAddEitService } from '../service/confirm-add-eit-service';
import { AbsenceNotificatonBodyResponse } from '../models/AbsenceNotificationBodyRes';
import { AbsenceAttachmentComponent } from '../absence-attachment/absence-attachment.component';
import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component';
import { FileUploader } from 'ng2-file-upload';
import { SubmitAbsenceModalComponent } from '../submit-absence-modal/submit-absence-modal.component';
import { HomeComponent } from "src/app/notification/home/home.component";
@Component({
selector: 'app-absence-confirm',
templateUrl: './absence-confirm.component.html',
styleUrls: ['./absence-confirm.component.scss']
})
export class AbsenceConfirmComponent implements OnInit {
direction: string;
P_TransactionID: number;
approversList = [];
selEmp: any = '';
respID: number;
absComments: string = '';
selMenu: MenuResponse;
attachItems: any;
attachListDisplay: any;
isTrue: any = 0;
getPassNotificationDetails: any;
menuType: string = '';
attachmentRes: any;
objIndex1: any;
attachListOver: any = [];
index: any = 0;
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
private isResubmitAbs: boolean = false;
private isSubmitBtnClicked: boolean;
filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
constructor(
public common: CommonService,
public ts: TranslatorService,
public modalCtrl: ModalController,
public ConfirmAddEitService: ConfirmAddEitService,
public submitConService: SubmitAbConfirmService,
public WorklistAttachService: WorklistAttachService
) {
this.isSubmitBtnClicked = false;
this.direction = TranslatorService.getCurrentLanguageName()
// this.isResubmitAbs = this.navParams.get("isResubmit");
if (this.isResubmitAbs) {
this.P_TransactionID = this.common.sharedService.getSharedData(
AbsenceResponse.SHARED_DATA
);
this.getPassNotificationDetails = this.common.sharedService.getSharedData(
AbsenceNotificatonBodyResponse.NOT_WORKLIST,
true
);
this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
this.menuType = 'E';
this.respID = -999;
// this.getApproversList();
// console.log("this.getPassNotificationDetails.P_NOTIFICATION_ID :"+this.getPassNotificationDetails.NOTIFICATION_ID);
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
} else {
this.selMenu = this.common.sharedService.getSharedData(
MenuResponse.SHARED_DATA,
true
);
this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
true
);
this.respID = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_RESP_ID,
true
);
this.P_TransactionID = this.common.sharedService.getSharedData(
AbsenceResponse.SHARED_DATA
);
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
}
this.getApproversList();
}
ngOnInit() { }
startAbApproval() {
if (this.attachListOver) {
//first call add attach inside success call submit
let request = {
AddAttachmentList: this.attachListOver
};
this.ConfirmAddEitService.addAttachment(request).subscribe(
(result: any) => {
this.handleAddAttachmentResults(result);
}
);
} else {
this.startAbsApprovalProcess();
}
} //end
handleAddAttachmentResults(result) {
if (this.common.validResponse(result)) {
//this.isUpload=true;
this.isTrue = 0;
for (let i = 0; i < result.AddAttSuccessList.length; i++) {
if (!result.AddAttSuccessList[i].AddSuccess) {
this.attachListOver[i].isSuccess = false;
// if false display cancel button with waring icon or design
} // end if
else {
// if true remove cancel and set isSuccess = true
this.attachListOver[i].isSuccess = true;
this.isTrue = this.isTrue + 1; //count flag of attach status
} // end else
} // end for
if (this.isTrue == result.AddAttSuccessList.length) {
this.startAbsApprovalProcess();
} else {
//stope
let filtered = this.attachListOver.filter(function (el) {
return el.isSuccess == true;
});
this.attachListOver = filtered;
let msg: string = '';
// msg = this.translate.translate("addAttach.errorMsg");
//this.common.showAlert(msg);
}
}
}
startAbsApprovalProcess() {
let request: any = {};
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
request.P_MENU_TYPE = this.menuType;
request.P_SELECTED_RESP_ID = this.respID;
request.P_TRANSACTION_ID = this.P_TransactionID;
request.P_COMMENTS = this.absComments;
this.submitConService
.startAbApprovalProcess(request)
.subscribe((result: any) => {
this.handleResults(result);
});
}
cancelAbProcess() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID
};
this.submitConService.cancelHRTransaction(body).subscribe((result: any) => {
this.handleCancelResults(result);
});
}
handleCancelResults(result) {
if (this.common.validResponse(result)) {
this.isSubmitBtnClicked = false;
// this.navCtrl.popToRoot();
}
}
handleResults(result) {
if (this.common.validResponse(result)) {
this.isSubmitBtnClicked = true;
//if(this.isResubmitAbs==false){
// let msg: string = this.ts.trPK('general', 'messageSuccess');
// this.common.presentAlert(msg);
this.common.greenToastPK("eit", "approval-message-success")
// }
// this.navCtrl.popToRoot();
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
}
getApproversList() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID,
P_AME_TRANSACTION_TYPE: 'SSHRMS',
P_PAGE_NUM: 1,
P_PAGE_LIMIT: 1000
};
this.submitConService.getApproversList(body).subscribe((result: any) => {
this.handleApproversResult(result);
});
}
handleApproversResult(result) {
if (this.common.validResponse(result)) {
this.approversList = result.GetApprovesList;
}
}
async addAttachment(str: boolean, attachItems: any) {
let attachDocID = attachItems.ATTACHED_DOCUMENT_ID;
// var modalPage = this.modalCtrl.create("AddAttachPage", {
// indexLastObj: this.attachListOver.length,
// TransactionID: this.P_TransactionID,
// enableBackdropDismiss: false
// });
const modal = await this.modalCtrl.create({
component: AbsenceAttachmentComponent,
componentProps: { indexLastObj: this.attachListOver.length, TransactionID: this.P_TransactionID },
keyboardClose: true,
animated: false
});
modal.onDidDismiss()
.then((data) => {
if (data == 'cancel' || data == 'undefined') {
return;
} else {
if (!str) {
this.updateFile(data, attachDocID);
} else {
this.attachListDisplay = data.data;
this.attachItems = this.attachListDisplay.map(function (el) {
var o = Object.assign({}, el);
o.isSuccess = false;
return o;
});
this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
}
}
});
return await modal.present();
}
/*****submit modal********/
async openSubmitModal() {
this.common.sharedService.setSharedData(this.attachListOver, 'submitAbsAttachmentList');
this.common.sharedService.setSharedData(this.absComments, 'absComments');
const modal = await this.modalCtrl.create({
component: SubmitAbsenceModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == 'cancel' || data.data == undefined) {
return;
} else {
this.startAbApproval();
}
});
return await modal.present();
}
removeFile(objectitem) {
if (this.attachListOver) {
let index2 = this.attachListOver.findIndex(item => item == objectitem);
if (index2 > -1) {
this.attachListOver.splice(index2, 1);
}
}
if (this.attachmentRes) {
let index3 = this.attachmentRes.findIndex(item => item == objectitem);
if (index3 > -1) {
this.attachmentRes.splice(index3, 1);
}
}
}
getAttachment(NotificationID) {
this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
this.WorklistAttachService.getAttach(this.attachReqObj).subscribe(
(result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
}
);
}
handleWorkListAttachResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetAttachementList != null) {
this.attachmentRes = result.GetAttachementList;
} // if result == null
} // valid it
}
async OpenAttachFiles(value, Type) {
this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
const modal = await this.modalCtrl.create({
component: WorkListAttachViewComponent
});
modal.onDidDismiss()
.then((data) => {
});
return await modal.present();
}
updateFile(attachList, attachDocID) {
let req = {
P_ATTACHED_DOCUMENT_ID: attachDocID,
P_FILE_DATA: attachList[0].P_FILE_DATA,
P_FILE_NAME: attachList[0].P_FILE_NAME,
P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
};
this.submitConService.updateAttach(req).subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.MessageStatus == 1) {
let msg: string = '';
// msg = this.translate.translate("addAttach.attachUpdate");
// this.common.showAlert(msg);
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
}
} // val
});
}
delelteFile(attach) {
// let alert = this.common.showConfirmMsg(
// this.translate.translate("general.deletePerm")
// );
// alert.onDidDismiss(data => {
// if (data == true) {
// this.continueDelete(attach);
// }
// });
}
continueDelete(attach) {
let req = {
P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
};
this.submitConService.delteAttach(req).subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.DeleteAttachmentList.P_RETURN_STATUS === 'S') {
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
// let msg: string = "";
// msg = this.translate.translate("addAttach.deleteAttach");
// this.common.showAlert(msg);
}
}
});
}
ionViewWillLeave() {
if (this.P_TransactionID && this.isSubmitBtnClicked == false)
this.cancelAbProcess();
}
/*******************Add attchement Functions*************/
public uploader: FileUploader = new FileUploader({
allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
maxFileSize: 10 * 1024 * 1024,
formatDataFunctionIsAsync: true,
formatDataFunction: async (item) => {
return new Promise((resolve, reject) => {
resolve({
name: item._file.name,
length: item._file.size,
contentType: item._file.type,
date: new Date()
});
});
}
});
onFileSelectedclick(event) {
event.target.value = '';
}
onFileSelected(input) {
// this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
let msg: string = "";
msg = this.ts.trPK("general", "notSupport");
this.common.presentAlert(msg);
return
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
// console.log(file);
//var encoded = Base64.encode(file);
this.getBase64(file).then(
data => this.pushObject(data, file.name, file.type)
);
// }
// };
}
}
getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
pushObject(fileData, name, type) {
console.log('before push: ' + this.index);
//this.attachListOver.length++;
try {
let array = name.split('.');
let attachType: string = array[array.length - 1];
this.attachListOver.push(
{
AttachmentID: this.attachListOver.length,
P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1],
P_FILE_DATA: fileData.split(',')[1],
P_FILE_NAME: name,//.split('.')[0],
P_TRANSACTION_ID: this.P_TransactionID
})
} catch (e) {
}
//console.log("after push: "+ this.index);
// return this.addAttachRequest
}
}

@ -0,0 +1,132 @@
<ion-header>
<ion-toolbar>
<!-- class="header-toolbar" <nav-buttons></nav-buttons> -->
<ion-title color="dark">{{ 'replacementRoll, title' | translate}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content >
<ion-list syle="margin-bottom:2px !important" [hidden]="isAnswer==true">
<ion-item>
<ion-label class="boldTxtNav">{{'replacementRoll, searchBy' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="searchBy">
<ion-select-option value="1" selected="true">{{'addAttach, name' | translate}}</ion-select-option>
<ion-select-option value="2">{{'login, username' | translate}}</ion-select-option>
<ion-select-option value="3">{{'general, email' | translate}}</ion-select-option>
</ion-select>
</ion-item>
<ion-item lines="none">
<ion-button [ngClass]="direction == 'en'? 'filterBtn':'filterBtn-ar'" button-type="clear" (click)="getreplacmentemployee()" item-end>
<ion-icon slot="icon-only" color="white" name="search"></ion-icon>
</ion-button>
<ion-input [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" [(ngModel)]="inputSearch" placeholder='{{"general, search" | translate}}'></ion-input>
<!-- <button ion-button icon-only (click)="getreplacmentemployee()" clear type="button" item-end>
<ion-icon name="search"></ion-icon>
</button> -->
</ion-item>
<!-- <ion-item>
<ion-label>
{{selEmpName}}
</ion-label>
</ion-item> -->
<!-- <div class="centerDiv">
<button ion-button (click)="closePage()">{{'general.save' | translate}}</button>
</div> -->
</ion-list>
<!-- <div class="noteInput">
<ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, question" | translate}} :
{{pQuestion}} ?</ion-label>
<ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, answer" | translate}}
</ion-label>
<ion-label [hidden]="isAnswer==true" class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label>
<ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</div> -->
<ion-item [hidden]="isAnswer==true">
<!-- <ion-list *ngIf="ReplacementList"> -->
<!-- <ion-list *ngIf="ReplacementList">
-->
<!-- <ion-radio-group mode="md" [(ngModel)]="selEmp"> -->
<!-- <ion-grid fixed>
<ion-row justify-content-end>
<ion-col [ngClass]="{'activated': (active == i),'deactivated': (active != i)}" (click)="select(employee,i)"
*ngFor="let employee of demoeAttach;let i=index;"
size-xs="6" size-sm="6" size-md="6" size-lg="6" align-self-stretch>
<div class="profileImageDiv"> <img class="profileImage" src="../assets/imgs/profile.png"></div>
<div *ngIf="active == i" class="selIEmpDiv"> <img class="selIEmpImage" src="../assets/imgs/green.png"></div>
<br/>
<div class="repContentDiv">
<ion-label style="color:var(--dark) !important">
<span style="font-weight: bold !important">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}}</ion-label>
</div>
</ion-col>
</ion-row>
</ion-grid> -->
<!-- </ion-radio-group> -->
<!--
</ion-list> -->
<div class="square-container">
<div (click)="select(employee,i)" *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> -->
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
</div>
<div *ngIf="active == i" class="selIEmpDiv">
<img class="selIEmpImage" src="../assets/imgs/green.png">
</div>
<div [ngClass]="{'activated': (active == i),'deactivated': (active != i)}"
class="content">
<ion-label>
<span style="font-weight: bold !important">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}}
</ion-label>
</div>
</div>
</div>
</ion-item>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; --border-radius: 10px; " ion-button (click)="submitAction()">
{{'general, submit' | translate}}</ion-button>
<ion-button class="footer-button" style="background: var(--darkblue)!important;border-radius: 10px; --background: transparent; --border-radius: 10px; " ion-button (click)="closeModal()">
{{'general, cancel' | translate}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,159 @@
button.item-button.button.button-md.button-clear.button-clear-md {
background-color: transparent;
}
.footer-button {
border-radius: 3px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
// ion-item {
// margin-top: 5%;
// margin-right: 7%;
// width: 100%;
// }
.ionItem{
border: #e4e4e4 solid;
/* margin: 6px; */
/* padding: 11px; */
height: 85px;
width: 164px;
border-radius: 5px;
text-align: center;
}
.profileImageDiv{
text-align: center;
margin-bottom: -27px;
z-index: 3;
position: relative;
top: 0;
}
.profileImage{
width:60px !important;
// margin-left: -25px;
// margin-right: 22px;
}
.activated{
border: #209a83 0.02cm solid ;
}
.deactivated{ border: #e4e4e4 0.02cm solid;
}
.repContentDiv{
text-align: center;
width: 85%;
font-size: 14px;
border: #e4e4e4 solid;
border-radius: 5px;
padding: 20px 8px 8px 8px;
margin-top: -9px;
margin-right: -35px
}
.selIEmpDiv{
text-align: right;
margin-bottom: -26px;
margin-right: 0px;
z-index: 3;
position: relative;
top: 0;
}
.selIEmpImage{
width:22px !important
}
.noteInput{
border: solid var(--gray) 1px;
border-radius: 15px;
margin: 8px 17px 0px 17px;
padding: 10px 2px 10px 2px;
}
.filterInput{
border: solid var(--gray) 1px;
border-radius: 21px;
padding-left: 10px !important;
}
.filterInput-ar{
// border: solid var(--gray) 1px;
// border-radius: 21px;
// padding-left: 10px !important;
border: solid var(--gray) 1px;
border-radius: 21px;
// padding-left: 145px !important;
margin-left: 115px;
// padding-right: 129px;
// margin-right: -143px;
margin-right: -136px;
}
// {padding-left: unset;
// padding-right: unset;
// -webkit-padding-start: var(--padding-start);
// padding-inline-start: var(--padding-start);
// -webkit-padding-end: var(--padding-end);
// padding-inline-end: var(--padding-end);
// margin-left: -53x;
// margin-right: 37px;}
.filterBtn{
background: var(--newgreen);
--background: var (--newgreen);
border-radius: 50%;
height: 60px;
width: 60px;
}
.filterBtn-ar{
// background: var(--newgreen);
// --background: var (--newgreen);
// border-radius: 50%;
// height: 60px;
// width: 60px;
background: var(--newgreen);
--background: var (--newgreen);
border-radius: 50%;
height: 60px;
width: 60px;
margin-left: -181px;
margin-right: 259px;
}
*{
box-sizing: border-box;
}
.square-container{
// padding: 8px;
width:100%;
}
.square{
// width:calc(100% / 2);
width:50%;
float:left;
position: relative;
// padding-bottom: calc(100% / 2);
}
.square .content{
width: calc(100% - 16px) !important;
height: calc(100% - 16px) !important;
margin: 8px;
padding: 16px;
// position: absolute;
color: white;
border-radius: 9px;
text-align: center;
// background-color: #0095ff;
// box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AbsenceReplacementListComponent } from './absence-replacement-list.component';
describe('AbsenceReplacementListComponent', () => {
let component: AbsenceReplacementListComponent;
let fixture: ComponentFixture<AbsenceReplacementListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AbsenceReplacementListComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AbsenceReplacementListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,343 @@
import { ModalController } from '@ionic/angular';
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { WorKListReplacmentEmployeeResponse } from 'src/app/notification/models/ReplacmentEmployeeRes';
import { WorkListReplacmentEmployeeRequest } from 'src/app/notification/models/ReplacmentEmployeeReq';
import { WorkListActionRequest } from 'src/app/notification/models/NotificationActionReq';
import { WorklistMainService } from 'src/app/notification/service/work-list.main.service';
import { ViewReplacementModalComponent } from 'src/app/notification/view-replacement-modal/view-replacement-modal.component';
import { WorklistService } from 'src/app/notification/service/worklist.service';
@Component({
selector: 'app-absence-replacement-list',
templateUrl: './absence-replacement-list.component.html',
styleUrls: ['./absence-replacement-list.component.scss'],
})
export class AbsenceReplacementListComponent implements OnInit {
P_SEARCH_EMPLOYEE_DISPLAY_NAME: string = "";
P_SEARCH_EMAIL_ADDRESS: string = "";
getPassActionMode: any;
selectedValue: any;
inputSearch: any;
selEmpName: any;
selectedReplacedEmp: any;
selectedUserInf: any;
userNote: any;
getPassNotificationDetails: any;
isAnswer: boolean = false;
pQuestion: string = "";
selEmp: any;
P_PAGE_NUM: number;
P_PAGE_LIMIT: number;
ReplacementList: any = [];
searchBy: string = "2";
IsReachEnd: boolean = false;
ReplacmentListRes: WorKListReplacmentEmployeeResponse;
private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest();
private WorkListActionObj: WorkListActionRequest;
getpassResAttr: any = [];
active: any;
demoeAttach:any=[];
public direction: string;
constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 50;
// this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false);
// this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false);
// this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false);
// this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false);
// if (this.getPassActionMode == "ANSWER_INFO") {
// this.isAnswer = true;
// }
this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.direction = TranslatorService.getCurrentLanguageName();
// this.WorkListActionObj = new WorkListActionRequest();
// this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;//26919060;
// this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
// this.WorkListActionObj.P_ACTION_MODE = "";
// this.WorkListActionObj.P_COMMENTS = "";
// this.WorkListActionObj.RespondAttributeList =[];// this.getpassResAttr;
// this.WorkListActionObj.P_APPROVER_INDEX = null;
}
ngOnInit() {
this.selectedReplacedEmp = this.cs.sharedService.getSharedData('selectedReplacedEmp');
this.demoeAttach = [{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj",
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
}
];
}
getreplacmentemployee() {
this.ReplacementList = [];
this.IsReachEnd = false;
this.P_PAGE_NUM = 1;
if (this.inputSearch) {
switch (this.searchBy) {
case '1': {
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.inputSearch;
this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = "";
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = "";
break;
}
case '2': {
this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = this.inputSearch;
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = "";
break;
}
case '3': {
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = this.inputSearch;
this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = "";
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
break;
}
default: {
this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = "";
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = "";
break;
}
}
} else {
this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = "";
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = "";
}
// if(this.selectedValue =="1"){
// this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=this.inputSearch;
// this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME="";
// this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS="";
// }
// else if(this.selectedValue =="2"){
// this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME="";
// this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=this.inputSearch;
// this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS="";
// }
// else if(this.selectedValue =="3"){
// this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME="";
// this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME="";
// this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS=this.inputSearch;
// }
this.WorkListReplacmentEmployeeObj.P_SELECTED_EMPLOYEE_NUMBER =this.selectedReplacedEmp;
this.worklistService.getReplacmentEmployeeList(this.WorkListReplacmentEmployeeObj).
subscribe((result: WorKListReplacmentEmployeeResponse) => {
this.handleWorkListReplacmentEmployeeResult(result);
});
}//End replacment Employee
handleWorkListReplacmentEmployeeResult(result) {
if (this.cs.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (this.cs.hasData(result.ReplacementList)) {
//this.ReplacmentListRes =result.ReplacementList;
this.ReplacementList = result.ReplacementList;
this.P_PAGE_NUM++;
let lastItemIndex = this.ReplacementList.length - 1;
if (result.ReplacementList[lastItemIndex]) {
let lastitem = result.ReplacementList[lastItemIndex];
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
}
} else {
let msg: string = this.ts.trPK('general', 'noResult');
this.cs.presentAlert(msg);
}
// if(result.ReplacementList.length == 0){
// }
// else if(result.ReplacementList != null)
// {
// this.ReplacmentListRes =result.ReplacementList;
// //open modal
// this.openModale(this.ReplacmentListRes);
// } // if result == null
} // valid it
}
getValueSelected(Value) {
this.selectedValue = Value;
}
select(selectEmp,index){
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp=selectEmp
this.active=index;
}
clear() {
this.selEmpName = "";
this.selectedUserInf = null;
}
async openModale(ReplacmentListRes) {
const modal = await this.modalCtrl.create({
component: ViewReplacementModalComponent
});
modal.onDidDismiss()
.then((data) => {
if (data == "cancel" || data == "undefined") {
//this.selEmpName="";
return;
} else {
this.selectedUserInf = data;
this.selEmpName = this.selectedUserInf.EMPLOYEE_DISPLAY_NAME;
}
});
return await modal.present();
}
submitAction() {
this.selEmp
if( this.selEmp){
let data = this.selEmp;
this.modalCtrl.dismiss(data);
}else{
let msg: string = this.ts.trPK("replacementRoll", "msg");
this.cs.showErrorMessageDialog(() => {
}, this.ts.trPK('general', 'ok'), msg);
return false;
}
// if (this.selEmp && this.isAnswer == false) {
// // this.selectedUserInf = this.ReplacementList[this.selEmp];
// this.selectedUserInf = this.selEmp;
// console.log("selEmp "+ this.selEmp.USER_NAME);
// if (this.selectedUserInf && this.selectedUserInf.USER_NAME) {
// console.log("userInfo "+this.selectedUserInf.USER_NAME);
// if (this.userNote) {
// this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
// this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
// this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
// this.workListMainService.actionButton(this.WorkListActionObj).
// subscribe((result: any) => {
// this.handleApplayActionResult(result);
// });
// } else {
// let msg: string = this.ts.trPK("replacementRoll", "enterNote");
// this.cs.showErrorMessageDialog(() => {
// }, this.ts.trPK('general', 'ok'), msg);
// }
// } else {
// let msg: string = this.ts.trPK("replacementRoll", "msg");
// this.cs.showErrorMessageDialog(() => {
// }, this.ts.trPK('general', 'ok'), msg);
// }
// } else if (this.isAnswer == true) {
// if (this.userNote) {
// this.WorkListActionObj.P_FORWARD_TO_USER_NAME = null;
// this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
// this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
// this.workListMainService.actionButton(this.WorkListActionObj).
// subscribe((result: any) => {
// this.handleApplayActionResult(result);
// });
// } else {
// let msg: string = this.ts.trPK("replacementRoll", "enterNote");
// this.cs.showErrorMessageDialog(() => {
// }, this.ts.trPK('general', 'ok'), msg);
// }
// } else {
// let msg: string = this.ts.trPK("replacementRoll", "msg");
// this.cs.showErrorMessageDialog(() => {
// }, this.ts.trPK('general', 'ok'), msg);
// }
}
doInfinite(infiniteScroll) {
if (!this.IsReachEnd) {
//const request =new WorkListActionRequest();
// request.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=this.P_SEARCH_USER_NAME;
// request.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=this.P_SEARCH_EMPLOYEE_DISPLAY_NAME;
// request.P_SEARCH_EMAIL_ADDRESS=this.P_SEARCH_EMAIL_ADDRESS;
this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM;
this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
// request.P_SELECTED_EMPLOYEE_NUMBER=this.selEmp;
this.worklistService.getReplacmentEmployeeList(this.WorkListReplacmentEmployeeObj).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.ReplacementList)) {
this.P_PAGE_NUM++;
result.ReplacementList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true;
}
else {
this.IsReachEnd = false;
}
this.ReplacementList.push(vr);
// this.pro.GetVacationRulesList.push(vr);
});
} else {
this.IsReachEnd = true;
}
}
//this.P_PAGE_NUM++;
if (infiniteScroll)
infiniteScroll.target.complete();
// console.log(resFlag);
}, (Error) => console.log(Error), () => infiniteScroll.target.complete());
} else {
if (infiniteScroll)
infiniteScroll.target.complete();
}
}
closeModal() {
this.modalCtrl.dismiss();
}
}

@ -0,0 +1,103 @@
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from "@angular/forms";
import { Routes, RouterModule } from "@angular/router";
import { AbsenceListService } from "./service/service.service";
import { IonicModule } from "@ionic/angular";
import { SubmitAbsenceService } from "./service/submit.absence.service";
import { AbsencePage } from "./absence.page";
import { DatePicker } from "@ionic-native/date-picker/ngx";
import { HomeComponent } from "./home/home.component";
import { SubmitAbsenceComponent } from "./submit-absence/submit-absence.component";
import { replacmentListService } from "./service/replacement-list.service";
import { HmgCommonModule } from "./../hmg-common/hmg-common.module";
import { ReplacementListComponent } from "../vacation-rule/replacement-list/replacement-list.component";
import { AbsenceConfirmComponent } from "./absence-confirm/absence-confirm.component";
import { ConfirmAddEitService } from "./service/confirm-add-eit-service";
import { SubmitAbConfirmService } from "./service/submit-absence-confirm.service";
import { WorklistAttachService } from "./service/work-list-attach.service";
import { AbsenceAttachmentComponent } from "./absence-attachment/absence-attachment.component";
import { AddAttachService } from "./service/add-attach-service";
import { WorkListAttachViewComponent } from "src/app/notification/work-list-attach-view/work-list-attach-view.component";
import { ViewAttachmentsComponent } from './view-attachments/view-attachments.component';
import { SubmitAbsenceModalComponent } from './submit-absence-modal/submit-absence-modal.component';
import { AbsenceReplacementListComponent } from './absence-replacement-list/absence-replacement-list.component';
import { WorklistService } from 'src/app/notification/service/worklist.service';
import { WorklistMainService } from 'src/app/notification/service/work-list.main.service';
const routes: Routes = [
{
path: "",
component: AbsencePage,
children: [
{
path: "home",
component: HomeComponent
},
{
path: "submit-absence",
component: SubmitAbsenceComponent
},
{
path: "replacement-list",
component: ReplacementListComponent
},
{
path: "confirm-absence",
component: AbsenceConfirmComponent
},
{
path: "absence-attachment",
component: AbsenceAttachmentComponent
},
{
path: "worklist-attachment",
component: WorkListAttachViewComponent
},
{
path:'view-attachements',
component:ViewAttachmentsComponent
},
{
path:'absence-submit-modal',
component:SubmitAbsenceModalComponent
},
{
path:'absence-replacment-modal',
component:AbsenceReplacementListComponent
}
]
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HmgCommonModule,
RouterModule.forChild(routes)
],
providers: [
AbsenceListService,
SubmitAbsenceService,
replacmentListService,
WorklistAttachService,
SubmitAbConfirmService,
DatePicker,
ConfirmAddEitService,
AddAttachService,
WorklistService,
WorklistMainService
],
declarations: [
AbsencePage,
HomeComponent,
SubmitAbsenceComponent,
AbsenceConfirmComponent,
AbsenceAttachmentComponent,
ViewAttachmentsComponent,
SubmitAbsenceModalComponent,
AbsenceReplacementListComponent
]
})
export class AbsencePageModule {}

@ -0,0 +1,6 @@
<ion-content>
<ion-router-outlet></ion-router-outlet>
</ion-content>

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

Loading…
Cancel
Save