improve envarionment

This commit is contained in:
Peter Maquiran
2023-01-25 15:06:19 +01:00
parent f445050821
commit 891c44d674
14 changed files with 182 additions and 111 deletions
+7 -34
View File
@@ -1,43 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gpr.gabinetedigital">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:name="com.gpr.gabinetedigital.MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask"
android:exported="true">
<?xml version='1.0' encoding='utf-8'?>
<manifest package="com.gpr.gabinetedigital" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:exported="true" android:label="@string/title_activity_main" android:launchMode="singleTask" android:name="com.gpr.gabinetedigital.MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
<provider android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
</manifest>
+1 -1
View File
@@ -40,7 +40,7 @@ export class DeleteMessageModel extends models.Model {
}
models.register({
databaseName: 'chat-storage'+environment.version.lastCommitNumber,
databaseName: 'chat-storage'+environment.version.lastCommitNumber + environment.id,
type: 'indexedDB',
version: 11,
models: [MessageModel, DeleteMessageModel, attachments]
+30
View File
@@ -0,0 +1,30 @@
export interface Environment {
id: string;
apiURL: string;
apiChatUrl: string;
apiWsChatUrl: string;
logoLabel: string;
production: boolean;
domain: string;
defaultuser: string;
defaultuserpwd: string;
chatOffline: boolean;
presidencial: boolean;
version: version;
sentryUrl: string;
despachoLabel: string
}
export interface version {
shortSHA: string;
SHA: string;
branch: string;
lastCommitAuthor: string;
lastCommitTime: string;
lastCommitMessage: string;
lastCommitNumber: string;
change: string;
changeStatus: string;
changeAuthor: string;
}
@@ -229,7 +229,7 @@
</div>
<div class="exp-card-text">
<!-- <p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p> -->
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Titular</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do {{ environment.despachoLabel }}</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && !p.userPermission([p.permissionList.Gabinete.md_tasks])">Despachos criados por mim</p>
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
</div>
@@ -246,6 +246,17 @@
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Assinar</p>
<p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
</div>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente-hover.svg"></ion-icon>
</div>
<p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas assinados PR</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" >Diplomas</p>
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="SessionStore.user.Profile == 'Consultant'" (click)="openDiplomaPorElaborar('gerarDiplomas'); selectedElement='gerarDiplomas'" [class.active]="selectedElement == 'gerarDiplomas'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
@@ -260,17 +271,6 @@
<p class="text-center exp-card-content">{{ deplomasStore.DiplomaGerarList.length }} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="deplomasStore.countDiplomasAssinadoListCount >= 1" (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente-hover.svg"></ion-icon>
</div>
<p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas assinados PR</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" >Diplomas</p>
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasParaAssinar'" [class.active]="selectedElement == 'DiplomasParaAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
@@ -32,6 +32,7 @@ import { Storage } from '@ionic/storage';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { SessionStore } from 'src/app/store/session.service';
import { NotificationsService } from 'src/app/services/notifications.service'
import { environment } from 'src/environments/environment';
@Component({
selector: 'app-gabinete-digital',
templateUrl: './gabinete-digital.page.html',
@@ -107,7 +108,7 @@ export class GabineteDigitalPage implements OnInit {
AllProcess = []
// workerList : Worker
environment = environment
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
+8 -1
View File
@@ -18,7 +18,14 @@ export class PermissionService {
args = [args]
}
return args.includes(this.SessionStore.user.Profile)
for(const arg of args) {
if(arg == this.SessionStore.user.Profile) {
return true
}
}
return false
}
userPermission(args) {
+7 -7
View File
@@ -19,7 +19,7 @@
</div>
<div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content">
<p class="logo-description-text tp-5" >doneIT</p>
<p class="logo-description-text tp-5" >{{ environment.logoLabel }}</p>
<div class="add-line"></div>
<p class="logo-description-text tp-5" >GABINETE DIGITAL</p>
@@ -27,7 +27,7 @@
</div>
<div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content">
<p class="logo-description-text tp-5 color-white" >doneIT</p>
<p class="logo-description-text tp-5 color-white" >{{ environment.logoLabel }}</p>
<div class="add-line-white"></div>
<p class="logo-description-text tp-5 color-white" >GABINETE DIGITAL</p>
</div>
@@ -55,15 +55,15 @@
<div class="logo-description-content">
<div *ngIf="ThemeService.currentTheme == 'gov' " class="logo-description-content">
<p *ngIf="environment.presidencia" class="logo-description-text">Calendário Partilhado</p>
<p *ngIf="!environment.presidencia" class="logo-description-text" >doneIT</p>
<p class="logo-description-text" >{{ environment.logoLabel }}</p>
<div class="add-line"></div>
<p *ngIf="!environment.presidencia" class="logo-description-text" >GABINETE DIGITAL</p>
<p class="logo-description-text" >GABINETE DIGITAL</p>
</div>
<div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description-content">
<p *ngIf="environment.presidencia" class="logo-description-text">Calendário Partilhado</p>
<p *ngIf="!environment.presidencia" class="logo-description-text" style="color: white;">GABINETE DIGITAL</p>
<p class="logo-description-text" style="color: white;">GABINETE DIGITAL</p>
<div class="add-line" style="border-bottom: 1px solid white;"></div>
</div>
+1 -1
View File
@@ -7,7 +7,7 @@ import { environment } from 'src/environments/environment';
})
export class LocalstoreService {
private prefix = environment.version.lastCommitNumber+"-";
private prefix = environment.version.lastCommitNumber + environment.id+"-";
private previewPrefix = 'v17-';
callbacks: {[key: string]: {
+24
View File
@@ -16,6 +16,30 @@ class SessionService {
forceToLoginWithForceToLogInWithPassword = false
permission = {
Agenda: {
access: false
},
Gabinete: {
access: false,
pr_tasks: false,
md_tasks: false,
aprove_event: false
},
Actions: {
access : false,
create : false,
delete : false,
edit : false,
createPost : false,
deletePost : false,
editPost : false
},
Chat: {
access: false
}
}
constructor() {
this.keyName = (SHA1("SessionService")).toString()
+5 -24
View File
@@ -1,25 +1,6 @@
import { versionData } from '../../version/git-version'
import { Environment } from './../app/models/envarioment'
import { oaprProd } from './suport/oapr'
import { doneITProd } from './suport/doneIt'
export const environment = {
// apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
apiURL: 'https://API.DONEIT.CO.AO/api/',
//apiURL: 'https://gd-api.oapr.gov.ao/api/',
//apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/',
// apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
//apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
//apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
/* apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', */
//apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
// apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
production: true,
domain: 'equilibrium.co.ao',
defaultuser: 'evandre.dasilva@equilibrium.co.ao',//paulo.pinto@gabinetedigital.local
defaultuserpwd: 'Luand@1219', //tabteste@006,06,
chatOffline: true,
presidencia: false,
version: versionData,
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712'
};
export const environment: Environment = oaprProd;
+6 -24
View File
@@ -1,24 +1,6 @@
import { versionData } from '../../version/git-version'
export const environment = {
// apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
apiURL: 'https://gd-api.oapr.gov.ao/api/',
//apiURL: 'https://API.DONEIT.CO.AO/api/',
//apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/',
// apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
// apiChatUrl: 'http://192.168.0.29:3000/api/v1/',
// apiWsChatUrl: 'wss://192.168.0.29:3000/websocket',
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
//apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
//apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
/* apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket', */
production: false,
domain: 'equilibrium.co.ao',
defaultuser: 'evandre.dasilva@equilibrium.co.ao',//evandre.dasilva@equilibrium.co.ao
defaultuserpwd: 'Luand@1219', //Luand@1219,
chatOffline: true,
presidencia: false,
version: versionData,
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712'
};
import { Environment } from './../app/models/envarioment'
import { oaprDev } from './suport/oapr'
import { doneITDev } from './suport/doneIt'
export const environment: Environment = oaprDev;
+36
View File
@@ -0,0 +1,36 @@
import { versionData } from '../../../version/git-version'
import { Environment } from './../../app/models/envarioment'
export const doneITProd: Environment = {
id:'1',
apiURL: 'https://API.DONEIT.CO.AO/api/',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
production: true,
domain: 'equilibrium.co.ao',
defaultuser: '',
defaultuserpwd: '',
chatOffline: true,
presidencial: false,
version: versionData,
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
logoLabel: 'doneIT',
despachoLabel: 'Titular',
};
export const doneITDev: Environment = {
id:'1',
apiURL: 'https://API.DONEIT.CO.AO/api/',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
production: true,
domain: 'equilibrium.co.ao',
defaultuser: 'evandre.dasilva@equilibrium.co.ao',
defaultuserpwd: 'Luand@1219',
chatOffline: true,
presidencial: false,
version: versionData,
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
logoLabel: 'doneIT',
despachoLabel: 'Titular',
};
+37
View File
@@ -0,0 +1,37 @@
import { versionData } from '../../../version/git-version'
import { Environment } from './../../app/models/envarioment'
export const oaprProd: Environment = {
id: '0',
apiURL: 'https://gd-api.oapr.gov.ao/api/',
apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket',
logoLabel: 'Presidente da República',
despachoLabel: 'Presidente da República',
production: false,
domain: 'oapr.gov.ao',
defaultuser: '',
defaultuserpwd: '',
chatOffline: true,
presidencial: true,
version: versionData,
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712'
};
export const oaprDev: Environment = {
id: '0',
apiURL: 'https://gd-api.oapr.gov.ao/api/',
apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket',
logoLabel: 'Presidente da República',
despachoLabel: 'Presidente da República',
production: false,
domain: 'oapr.gov.ao',
defaultuser: 'gmanuel@oapr.gov.ao',
defaultuserpwd: 'Tabteste@006',
chatOffline: true,
presidencial: true,
version: versionData,
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
};
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "652cc0146",
"SHA": "652cc014602759f5120049b3ceb27413a24a8737",
"shortSHA": "f44505082",
"SHA": "f44505082108e12aa7ab360be9af64b347b61803",
"branch": "feature_build_ios_v1_3",
"lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Wed Jan 25 10:21:28 2023 +0100'",
"lastCommitMessage": "improve",
"lastCommitNumber": "4687",
"lastCommitTime": "'Wed Jan 25 10:28:55 2023 +0100'",
"lastCommitMessage": "save",
"lastCommitNumber": "4688",
"change": "",
"changeStatus": "On branch feature_build_ios_v1_3\nYour branch and 'origin/feature_build_ios_v1_3' have diverged,\nand have 59 and 1 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/shared/header-pr/header-pr.page.ts\n\tmodified: src/environments/environment.ts",
"changeStatus": "On branch feature_build_ios_v1_3\nYour branch and 'origin/feature_build_ios_v1_3' have diverged,\nand have 60 and 1 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: android/app/src/main/AndroidManifest.xml\n\tmodified: src/app/models/beast-orm.ts\n\tnew file: src/app/models/envarioment.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/services/permission.service.ts\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/store/localstore.service.ts\n\tmodified: src/app/store/session.service.ts\n\tmodified: src/environments/environment.prod.ts\n\tmodified: src/environments/environment.ts\n\tnew file: src/environments/suport/doneIt.ts\n\tnew file: src/environments/suport/oapr.ts\n\tmodified: version/git-version.ts",
"changeAuthor": "peter.maquiran"
}