SUPPORT-8426 remove security files and some unused
This commit is contained in:
parent
96e0db491c
commit
001f8683c8
31 changed files with 12 additions and 1444 deletions
|
|
@ -18,7 +18,7 @@
|
|||
});
|
||||
</script>
|
||||
</head>
|
||||
<body preview-container id="webbpm-angular-application-container ervu_lkrp_ul" class="webbpm">
|
||||
<body preview-container id="webbpm-angular-application-container" class="webbpm ervu_lkrp_ul">
|
||||
<div class="loader"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
<div *ngIf="(currentSession | async)?.authorities.includes('BPMN.ADMIN.PROCESS_INSTANCE.LIST') ||
|
||||
(currentSession | async)?.authorities.includes('USER_MANAGEMENT.USER.LIST') ||
|
||||
(currentSession | async)?.authorities.includes('USER_MANAGEMENT.GROUP.LIST') ||
|
||||
(currentSession | async)?.authorities.includes('USER_MANAGEMENT.ROLE.LIST') ||
|
||||
(currentSession | async)?.authorities.includes('USER_MANAGEMENT.ORG_UNIT.LIST') ||
|
||||
(currentSession | async)?.authorities.includes('USER_MANAGEMENT.AUTHORITY.LIST')" ngbDropdown class="nav-item" [placement]="placement">
|
||||
<button class="nav-link bi bi-gear-fill" id="adminDropdownMenu" ngbDropdownToggle title="Администрирование"></button>
|
||||
<div ngbDropdownMenu aria-labelledby="adminDropdownMenu">
|
||||
<button *ngIf="(currentSession | async)?.authorities.includes('BPMN.ADMIN.PROCESS_INSTANCE.LIST')"
|
||||
routerLink="/process/instance" ngbDropdownItem>
|
||||
Экземпляры процессов
|
||||
</button>
|
||||
<button *ngIf="(currentSession | async)?.authorities.includes('USER_MANAGEMENT.USER.LIST')"
|
||||
routerLink="/user-management/users" ngbDropdownItem>
|
||||
Пользователи
|
||||
</button>
|
||||
<button *ngIf="(currentSession | async)?.authorities.includes('USER_MANAGEMENT.GROUP.LIST')"
|
||||
routerLink="/user-management/groups" ngbDropdownItem>
|
||||
Группы
|
||||
</button>
|
||||
<button *ngIf="(currentSession | async)?.authorities.includes('USER_MANAGEMENT.ROLE.LIST')"
|
||||
routerLink="/user-management/roles" ngbDropdownItem>
|
||||
Роли
|
||||
</button>
|
||||
<button *ngIf="(currentSession | async)?.authorities.includes('USER_MANAGEMENT.ORG_UNIT.LIST')"
|
||||
routerLink="/user-management/org-units" ngbDropdownItem>
|
||||
Организации
|
||||
</button>
|
||||
<button *ngIf="(currentSession | async)?.authorities.includes('USER_MANAGEMENT.AUTHORITY.LIST')"
|
||||
routerLink="/user-management/authorities" ngbDropdownItem>
|
||||
Безопасность действий
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,17 +1,10 @@
|
|||
<nav class="header" *ngIf="currentSession | async as session" id="webbpm-header">
|
||||
<nav class="header" id="webbpm-header">
|
||||
<div class="header-logo">
|
||||
<div class="logo"><a routerLink="/"></a></div>
|
||||
<div class="main-page"><a routerLink="/">Главная</a></div>
|
||||
<div class="header-menu-left"><a routerLink="/filesentlog">Журнал взаимодействий</a></div>
|
||||
</div>
|
||||
<div class="header-menu">
|
||||
<!--
|
||||
<process *ngIf="session.authorities.includes('BPMN.USER.START_PROCESS')"></process>
|
||||
<div *ngIf="session.authorities.includes('BPMN.USER.TASK_LIST')">
|
||||
<button class="nav-link bi bi-file-text-fill" (click)="openTaskList()" title="Задачи"></button>
|
||||
</div>
|
||||
<admin-menu [placement]="'bottom'"></admin-menu>
|
||||
-->
|
||||
<div ngbDropdown class="logout" log-out></div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
<div class="confirm">
|
||||
<div class="form-logo">
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div>
|
||||
<h2>Подтверждение почты</h2>
|
||||
|
||||
<div *ngIf="verificationStatus.toString() === 'VERIFYING'">
|
||||
Подтверждение...
|
||||
</div>
|
||||
<div *ngIf="verificationStatus.toString() === 'VERIFIED'">
|
||||
<div class="alert alert-success">
|
||||
Адрес электронной почты успешно подтвержден
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="verificationStatus.toString() === 'FAILED'">
|
||||
<div class="alert alert-danger">{{ errorMessage }}</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="(currentSession | async) == null">
|
||||
<a href="#/login"><span class="fa fa-lock"></span>Войти</a><br/>
|
||||
<a href="#/registration">Зарегистрироваться</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<button class="user-info" ngbDropdownToggle *ngIf="currentSession | async as session">{{session.fullUserName}}</button>
|
||||
<div ngbDropdownMenu *ngIf="currentSession | async as session">
|
||||
<!--
|
||||
<div class="user-info">
|
||||
<div class="user-login">{{session.username}}</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="user-department">{{getOrgUnitName()}}</div>
|
||||
<a routerLink="/mydata" class="data">Данные организации</a>
|
||||
<button ngbDropdownItem class="exit" *ngIf="isLogoutButtonVisible()" (click)="logout()">Выйти</button>
|
||||
</div>
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<div class="form-signin">
|
||||
<form #formComponent="ngForm">
|
||||
<div class="alert alert-success" [hidden]="!confirmationSent">На ваш почтовый адрес было отправлено письмо. Подтвердите почту, чтобы войти в систему
|
||||
</div>
|
||||
<div class="alert alert-danger" [hidden]="!errorMessage">{{errorMessage}}</div>
|
||||
|
||||
<div class="logo">
|
||||
<h2>Воинский учет в организациях</h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-group">
|
||||
<input type="text" name="username" class="form-control" placeholder=" " required autofocus [(ngModel)]="username" maxlength="100">
|
||||
<label>Логин</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-group">
|
||||
<input
|
||||
[type]="passwordType ? 'text' : 'password'"
|
||||
name="password"
|
||||
class="form-control field-password-view"
|
||||
placeholder=" " required
|
||||
[(ngModel)]="password"
|
||||
maxlength="100"
|
||||
>
|
||||
<label>Пароль</label>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i
|
||||
(click)="togglePasswordType()"
|
||||
class="fa"
|
||||
[ngClass]="{
|
||||
'fa-eye': passwordType,
|
||||
'fa-eye-slash': !passwordType
|
||||
}"
|
||||
></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="msg-text"><a href="#/reset-password">Восстановить пароль</a></div>
|
||||
</div>
|
||||
<div class="btn-box">
|
||||
<!--<esia-login-button></esia-login-button>-->
|
||||
<button type="submit" class="btn btn-primary" (click)="formComponent.form.valid && login()">Войти</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
<div class="form-signup">
|
||||
<div class="form-logo">
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="form-new-password">
|
||||
<form #formComponent="ngForm">
|
||||
<div [hidden]="!errorMessage" class="alert alert-danger">{{ errorMessage }}</div>
|
||||
<p class="has-account">Вспомнили пароль?
|
||||
<a href="#/login"><span class="fa fa-lock"></span>Войти</a></p>
|
||||
|
||||
<p class="has-account">Задайте новый пароль</p>
|
||||
|
||||
<div class="row">
|
||||
<label>Пароль</label>
|
||||
<div class="input-group">
|
||||
<input
|
||||
#passwordInput="ngModel"
|
||||
[(ngModel)]="password"
|
||||
[type]="passwordType ? 'text' : 'password'"
|
||||
class="form-control"
|
||||
maxlength="32"
|
||||
minlength="6"
|
||||
name="password"
|
||||
pattern="^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]+$"
|
||||
required
|
||||
(change)="validPasswords()"
|
||||
>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i
|
||||
(click)="togglePasswordType()"
|
||||
class="fa"
|
||||
[ngClass]="{
|
||||
'fa-eye': passwordType,
|
||||
'fa-eye-slash': !passwordType
|
||||
}"
|
||||
></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="passwordInput.invalid && (passwordInput.dirty || passwordInput.touched)">
|
||||
<div *ngIf="passwordInput.errors.required" class="msg-alert">Поле обязательно
|
||||
</div>
|
||||
<div *ngIf="passwordInput.errors.minlength" class="msg-alert">Пароль должен
|
||||
содержать как минимум 6 символов
|
||||
</div>
|
||||
<div *ngIf="passwordInput.errors.pattern" class="msg-alert">Пароль должен
|
||||
содержать заглавные и прописные буквы и как минимум 1 цифру
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Подтверждение пароля</label>
|
||||
<div class="input-group">
|
||||
<input
|
||||
#confirmPasswordInput="ngModel"
|
||||
[(ngModel)]="confirmPassword"
|
||||
[type]="confirmPasswordType ? 'text' : 'password'"
|
||||
class="form-control"
|
||||
maxlength="32"
|
||||
minlength="6"
|
||||
name="confirmPassword"
|
||||
pattern="^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]+$"
|
||||
required
|
||||
(change)="validPasswords()"
|
||||
>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i
|
||||
(click)="toggleConfirmPasswordType()"
|
||||
class="fa"
|
||||
[ngClass]="{
|
||||
'fa-eye': confirmPasswordType,
|
||||
'fa-eye-slash': !confirmPasswordType
|
||||
}"
|
||||
></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="confirmPasswordInput.invalid && (confirmPasswordInput.dirty || confirmPasswordInput.touched)">
|
||||
<div *ngIf="confirmPasswordInput.errors.required" class="msg-alert">Поле обязательно
|
||||
</div>
|
||||
<div *ngIf="confirmPasswordInput.errors.minlength" class="msg-alert">Пароль должен
|
||||
содержать как минимум 6 символов
|
||||
</div>
|
||||
<div *ngIf="confirmPasswordInput.errors.pattern" class="msg-alert">Пароль должен
|
||||
содержать заглавные и прописные буквы и как минимум 1 цифру
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="reset-password-btn-box">
|
||||
<button
|
||||
(click)="formComponent.form.valid && validPasswords() && changePassword()"
|
||||
[disabled]="!formComponent.form.valid && !validPasswords()"
|
||||
class="btn btn-primary"
|
||||
type="submit"
|
||||
>
|
||||
Изменить пароль
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<div ngbDropdown class="nav-item">
|
||||
<button class="nav-link bi bi-clipboard-plus-fill" id="startProcessDropdownMenu" ngbDropdownToggle title="Создать"></button>
|
||||
<div ngbDropdownMenu aria-labelledby="startProcessDropdownMenu">
|
||||
<div class="dropdown-menu-inner">
|
||||
<div *ngFor="let process of processList">
|
||||
<button (click)="startProcess(process.processDefId)" ngbDropdownItem>
|
||||
{{ process.name }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
</div><!-- TODO: move to directive or something else -->
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
<div class="form-signup">
|
||||
<div class="form-logo">
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="form-register">
|
||||
<form #formComponent="ngForm">
|
||||
<div [hidden]="!errorMessage" class="alert alert-danger">{{ errorMessage }}</div>
|
||||
<h2>Регистрация</h2>
|
||||
<p class="has-account">Уже зарегистрированы?
|
||||
<a href="#/login"><span class="fa fa-lock"></span>Войти</a></p>
|
||||
|
||||
<div class="row">
|
||||
<label>Имя</label>
|
||||
<input
|
||||
#name="ngModel"
|
||||
[(ngModel)]="username"
|
||||
class="form-control"
|
||||
maxlength="100"
|
||||
name="username"
|
||||
required
|
||||
type="text"
|
||||
>
|
||||
<div *ngIf="name.invalid && (name.dirty || name.touched)">
|
||||
<div *ngIf="name.errors.required" class="msg-alert">Поле обязательно</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Адрес эл. почты</label>
|
||||
<input
|
||||
#emailInput="ngModel"
|
||||
[(ngModel)]="email"
|
||||
class="form-control"
|
||||
email
|
||||
maxlength="100"
|
||||
name="email"
|
||||
required
|
||||
type="email"
|
||||
>
|
||||
<div *ngIf="emailInput.invalid && (emailInput.dirty || emailInput.touched)">
|
||||
<div *ngIf="emailInput.errors.required" class="msg-alert">Поле обязательно</div>
|
||||
<div *ngIf="emailInput.errors.email" class="msg-alert">Неверный формат адреса
|
||||
эл. почты
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Номер телефона</label>
|
||||
<international-phone-number
|
||||
#phoneInput="ngModel"
|
||||
[(ngModel)]="phoneNumber"
|
||||
[defaultCountry]="'ru'"
|
||||
[pattern]="'^\\+(?!7 ?\\d{11})[0-9 ]+$'"
|
||||
maxlength="20"
|
||||
minlength="8"
|
||||
name="phoneNumber"
|
||||
placeholder="+79991112233"
|
||||
(focusout)="phoneInputFocusOut()"
|
||||
required
|
||||
></international-phone-number>
|
||||
<div *ngIf="phoneInput.invalid && (phoneInput.dirty || phoneIsTouched)">
|
||||
<div *ngIf="phone.selectedCountry">
|
||||
<div *ngIf="phoneHasOnlyDialCode()" class="msg-alert">Поле обязательно</div>
|
||||
<div *ngIf="!phoneHasOnlyDialCode()" class="msg-alert">Введите корректный номер</div>
|
||||
</div>
|
||||
<div *ngIf="!phone.selectedCountry">
|
||||
<div *ngIf="phoneInput.errors.required" class="msg-alert">Поле обязательно</div>
|
||||
<div *ngIf="!phoneInput.errors.required" class="msg-alert">Введите код страны</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Пароль</label>
|
||||
<div class="input-group">
|
||||
<input
|
||||
#passwordInput="ngModel"
|
||||
[(ngModel)]="password"
|
||||
[type]="fieldType ? 'text' : 'password'"
|
||||
class="form-control"
|
||||
maxlength="32"
|
||||
minlength="8"
|
||||
name="password"
|
||||
[pattern]="passwordPattern"
|
||||
required
|
||||
>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i
|
||||
(click)="toggleFieldType()"
|
||||
class="fa"
|
||||
[ngClass]="{
|
||||
'fa-eye': fieldType,
|
||||
'fa-eye-slash': !fieldType
|
||||
}"
|
||||
></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="passwordInput.invalid && (passwordInput.dirty || passwordInput.touched)">
|
||||
<div *ngIf="passwordInput.errors.required" class="msg-alert">Поле обязательно
|
||||
</div>
|
||||
<div *ngIf="passwordInput.errors.minlength" class="msg-alert">Пароль должен
|
||||
содержать как минимум 8 символов
|
||||
</div>
|
||||
<div *ngIf="passwordInput.errors.pattern" class="msg-alert" [innerText]="passwordPatternErrorMessage">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="register-btn-box">
|
||||
<button
|
||||
(click)="formComponent.form.valid && register()"
|
||||
[disabled]="!formComponent.form.valid"
|
||||
class="btn btn-primary"
|
||||
type="submit"
|
||||
>
|
||||
Зарегистрироваться
|
||||
</button>
|
||||
</div>
|
||||
<div *ngIf="consent" [innerHTML]="consent" class="consent"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<div class="form-signup">
|
||||
<div class="form-logo">
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="form-reset-password">
|
||||
<form #formComponent="ngForm">
|
||||
<div [hidden]="!errorMessage" class="alert alert-danger">{{ errorMessage }}</div>
|
||||
<p class="has-account">Вспомнили пароль?
|
||||
<a href="#/login"><span class="fa fa-lock"></span>Войти</a></p>
|
||||
|
||||
<p class="has-account">Укажите адрес эл. почты, который был указан при регистрации,
|
||||
на него пришлем временный пароль. Пароль сможете поменять в личном кабинете.
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<input
|
||||
#emailInput="ngModel"
|
||||
[(ngModel)]="email"
|
||||
class="form-control"
|
||||
email
|
||||
maxlength="100"
|
||||
name="email"
|
||||
required
|
||||
type="email"
|
||||
>
|
||||
<label>Адрес эл. почты</label>
|
||||
<div *ngIf="emailInput.invalid && (emailInput.dirty || emailInput.touched)" class="msg-text">
|
||||
<div *ngIf="emailInput.errors.required" class="msg-alert">Поле обязательно</div>
|
||||
<div *ngIf="emailInput.errors.email" class="msg-alert">Неверный формат адреса эл. почты
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-box">
|
||||
<button
|
||||
(click)="formComponent.form.valid && resetPassword()"
|
||||
[disabled]="!formComponent.form.valid"
|
||||
class="btn btn-primary"
|
||||
type="submit"
|
||||
>
|
||||
Восстановить
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<div id="page">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<div class="inner">
|
||||
<div class="task-list">
|
||||
<div class="task-list-tree-panel">
|
||||
<div class="task-list-filter">
|
||||
<ul>
|
||||
<li>Фильтры</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="radio" name="task-filter" value="All" [(ngModel)]="showMode" (ngModelChange)="filterVisibleTasks()">
|
||||
<span>Все [{{tasks.length}}]</span>
|
||||
</label></li>
|
||||
<li class="ontime">
|
||||
<label>
|
||||
<input type="radio" name="task-filter" value="OnTime" [(ngModel)]="showMode" (ngModelChange)="filterVisibleTasks()">
|
||||
<span><div></div>Без превышения срока [{{onTimeTasks.length}}]</span>
|
||||
</label></li>
|
||||
<li class="overdue">
|
||||
<label>
|
||||
<input type="radio" name="task-filter" value="Overdue" [(ngModel)]="showMode" (ngModelChange)="filterVisibleTasks()">
|
||||
<span><div></div>С превышением срока [{{overdueTasks.length}}]</span>
|
||||
</label></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="task-list-workplace">
|
||||
<div class="alert alert-danger" [hidden]="!errorMessage">{{errorMessage}}</div>
|
||||
<div class="table task-tbl">
|
||||
<div class="thead">
|
||||
<div class="tr">
|
||||
<div class="th">Процесс</div>
|
||||
<div class="th">Версия</div>
|
||||
<div class="th">Задача</div>
|
||||
<div class="th">Дата создания</div>
|
||||
<div class="th">Срок</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngFor="let task of visibleTasks"
|
||||
class="tr" [ngClass]="{'task-overdue': isOverdue(task), 'task-ontime': isOnTime(task)}"
|
||||
(click)="startTask(task)">
|
||||
<div class="td">{{ task.processName }}</div>
|
||||
<div class="td">{{ task.processVersion }}</div>
|
||||
<div class="td task">{{ task.name }}</div>
|
||||
<div class="td">{{ task.createdOn | date:'dd.MM.yyyy HH:mm:ss' }}</div>
|
||||
<div class="td">{{ task.expirationTime | date:'dd.MM.yyyy HH:mm:ss' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<div class="task-not-found-page">
|
||||
<div class="task-not-found-container">
|
||||
<div>:(</div>
|
||||
<div><h2>Ошибка</h2>
|
||||
Данная задача не существует.<br/>
|
||||
Перейти к <a (click)="goToTaskList()" tabindex>списку задач</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,65 +1,13 @@
|
|||
import {NgModule} from "@angular/core";
|
||||
import {RouterModule, Routes} from "@angular/router";
|
||||
import {AccessDeniedComponent} from "./component/access-denied.component";
|
||||
import {LoginComponent} from "./component/login.component";
|
||||
import {AuthenticationGuard, ConfirmExitGuard, SignedInGuard, ProcessInstanceRouteResolver} from "@webbpm/base-package";
|
||||
import {RegisterComponent} from "./component/register.component";
|
||||
import {ConfirmUserEmailComponent} from "./component/confirm-user-email.component";
|
||||
import {ResetPasswordComponent} from "./component/reset-password.component";
|
||||
import {NewPasswordComponent} from "./component/new-password.component";
|
||||
import {TaskListComponent} from "./component/task-list.component";
|
||||
import {ConfirmExitGuard} from "@webbpm/base-package";
|
||||
|
||||
const appRoutes: Routes = [
|
||||
{
|
||||
path: 'login',
|
||||
component: LoginComponent,
|
||||
canActivate: [SignedInGuard]
|
||||
},
|
||||
{
|
||||
path: 'access-denied',
|
||||
component: AccessDeniedComponent,
|
||||
canActivate: [AuthenticationGuard, ConfirmExitGuard]
|
||||
},
|
||||
{
|
||||
path: 'registration',
|
||||
component: RegisterComponent,
|
||||
canActivate: [SignedInGuard]
|
||||
},
|
||||
{
|
||||
path: 'confirm',
|
||||
component: ConfirmUserEmailComponent
|
||||
},
|
||||
{
|
||||
path: 'reset-password',
|
||||
component: ResetPasswordComponent
|
||||
},
|
||||
{
|
||||
path: 'new-password',
|
||||
component: NewPasswordComponent
|
||||
},
|
||||
{
|
||||
path: 'process',
|
||||
canActivate: [AuthenticationGuard, ConfirmExitGuard],
|
||||
children: [
|
||||
{
|
||||
path: 'instance',
|
||||
loadChildren: 'generated-sources/page-process-instance-list.module#PageprocessinstancelistModule',
|
||||
resolve: {
|
||||
processInstanceId: ProcessInstanceRouteResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'instance/:processInstanceId',
|
||||
loadChildren: 'generated-sources/page-process-instance.module#PageprocessinstanceModule',
|
||||
resolve: {
|
||||
processInstanceId: ProcessInstanceRouteResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'tasks',
|
||||
component: TaskListComponent,
|
||||
}
|
||||
]
|
||||
canActivate: [ConfirmExitGuard]
|
||||
},
|
||||
{
|
||||
path: 'mydata',
|
||||
|
|
@ -69,8 +17,8 @@ const appRoutes: Routes = [
|
|||
path: 'filesentlog',
|
||||
loadChildren: 'generated-sources/page-filesentlog.module#PagefilesentlogModule',
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
|
|
|||
|
|
@ -11,44 +11,23 @@ import {
|
|||
ProgressIndicationService,
|
||||
SecurityModule
|
||||
} from "@webbpm/base-package";
|
||||
import {AdminMenuComponent} from "./component/admin-menu.component";
|
||||
import {AppHeaderComponent} from "./component/app-header.component";
|
||||
import {AppFooterComponent} from "./component/app-footer.component";
|
||||
import {LogOutComponent} from "./component/logout.component";
|
||||
import {LoginComponent} from "./component/login.component";
|
||||
import {AccessDeniedComponent} from "./component/access-denied.component";
|
||||
import {ApplicationVersionComponent} from "./component/application-version.component";
|
||||
import {RouterModule} from "@angular/router";
|
||||
import {RegisterComponent} from "./component/register.component";
|
||||
import {ConfirmUserEmailComponent} from "./component/confirm-user-email.component";
|
||||
import {InternationalPhoneNumberModule} from "ngx-international-phone-number";
|
||||
import {ResetPasswordComponent} from "./component/reset-password.component";
|
||||
import {NewPasswordComponent} from "./component/new-password.component";
|
||||
import {AppProgressIndicationComponent} from "./component/app-progress-indication.component";
|
||||
import {AppProgressIndicationService} from "./service/app-progress-indication.service";
|
||||
import {TaskListComponent} from "./component/task-list.component";
|
||||
import {ProcessListComponent} from "./component/process-list.component";
|
||||
import {TaskComponent} from "./component/task.component";
|
||||
import {TaskNotFoundComponent} from "./component/task-not-found.component";
|
||||
|
||||
|
||||
registerLocaleData(localeRu);
|
||||
export const DIRECTIVES = [
|
||||
forwardRef(() => AppHeaderComponent),
|
||||
forwardRef(() => AppFooterComponent),
|
||||
forwardRef(() => AdminMenuComponent),
|
||||
forwardRef(() => ApplicationVersionComponent),
|
||||
forwardRef(() => LogOutComponent),
|
||||
forwardRef(() => LoginComponent),
|
||||
forwardRef(() => AccessDeniedComponent),
|
||||
forwardRef(() => RegisterComponent),
|
||||
forwardRef(() => ConfirmUserEmailComponent),
|
||||
forwardRef(() => ResetPasswordComponent),
|
||||
forwardRef(() => NewPasswordComponent),
|
||||
forwardRef(() => AppProgressIndicationComponent),
|
||||
forwardRef(() => TaskListComponent),
|
||||
forwardRef(() => ProcessListComponent),
|
||||
forwardRef(() => TaskComponent),
|
||||
forwardRef(() => TaskNotFoundComponent)
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
|
@ -74,7 +53,7 @@ export const DIRECTIVES = [
|
|||
{ provide: ProgressIndicationService, useClass: AppProgressIndicationService }
|
||||
],
|
||||
bootstrap: [],
|
||||
entryComponents: [AppProgressIndicationComponent, TaskNotFoundComponent]
|
||||
entryComponents: [AppProgressIndicationComponent]
|
||||
})
|
||||
export class AppModule {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import {ChangeDetectionStrategy, Component, Input} from "@angular/core";
|
||||
import {UserService, Session} from "@webbpm/base-package";
|
||||
import {NgbDropdownConfig, Placement} from "@ng-bootstrap/ng-bootstrap";
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'admin-menu',
|
||||
templateUrl: '../../../../../src/resources/template/app/component/admin_menu.html',
|
||||
providers: [NgbDropdownConfig],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class AdminMenuComponent {
|
||||
|
||||
@Input()
|
||||
public placement: Placement = 'bottom';
|
||||
public currentSession: Observable<Session>;
|
||||
|
||||
constructor(protected userService: UserService, public config: NgbDropdownConfig) {
|
||||
this.config.placement = this.placement;
|
||||
this.currentSession = this.userService.getCurrentSession();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
import {ChangeDetectionStrategy, Component} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
import {UserService, Session} from "@webbpm/base-package";
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
|
|
@ -11,14 +9,6 @@ import {Observable} from "rxjs";
|
|||
})
|
||||
export class AppHeaderComponent {
|
||||
|
||||
public currentSession: Observable<Session>;
|
||||
|
||||
constructor(protected userService: UserService,
|
||||
protected router: Router) {
|
||||
this.currentSession = this.userService.getCurrentSession();
|
||||
}
|
||||
|
||||
public openTaskList(): void {
|
||||
this.router.navigateByUrl("/process/tasks");
|
||||
constructor(protected router: Router) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input} from "@angular/core";
|
||||
import {Session, UserService} from "@webbpm/base-package";
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
enum VerificationStatus {
|
||||
VERIFYING = "VERIFYING",
|
||||
VERIFIED = "VERIFIED",
|
||||
FAILED = "FAILED"
|
||||
}
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "confirm",
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
templateUrl: "../../../../../src/resources/template/app/component/confirm-user-email.html"
|
||||
})
|
||||
export class ConfirmUserEmailComponent {
|
||||
public verificationStatus = VerificationStatus.VERIFYING;
|
||||
public currentSession: Observable<Session>;
|
||||
|
||||
@Input()
|
||||
public errorMessage: string;
|
||||
|
||||
constructor(private router: Router, private userService: UserService,
|
||||
private route: ActivatedRoute, private cd: ChangeDetectorRef) {
|
||||
this.currentSession = this.userService.getCurrentSession();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const link: string = this.route.snapshot.queryParamMap.get("link");
|
||||
// remove link from url to prevent http referer leakage
|
||||
this.router.navigate([], { relativeTo: this.route, replaceUrl: true });
|
||||
this.userService.confirm(
|
||||
link,
|
||||
(reason) => {
|
||||
this.verificationStatus = VerificationStatus.FAILED;
|
||||
if (reason.status === 404) {
|
||||
this.errorMessage = 'Ссылка недействительна. Требуется повторная регистрация.';
|
||||
}
|
||||
else {
|
||||
this.errorMessage = 'Произошла ошибка, обратитесь в службу технической поддержки!';
|
||||
}
|
||||
this.cd.markForCheck();
|
||||
})
|
||||
.then(() => {
|
||||
this.verificationStatus = VerificationStatus.VERIFIED;
|
||||
this.cd.markForCheck();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
import {Component, Input} from "@angular/core";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {UserService, Credentials} from "@webbpm/base-package";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "login",
|
||||
templateUrl: "../../../../../src/resources/template/app/component/login.html"
|
||||
})
|
||||
export class LoginComponent {
|
||||
|
||||
@Input()
|
||||
public username: string;
|
||||
|
||||
@Input()
|
||||
public password: string;
|
||||
public passwordType: boolean;
|
||||
|
||||
@Input()
|
||||
public errorMessage: string;
|
||||
|
||||
@Input()
|
||||
public confirmationSent: boolean;
|
||||
|
||||
constructor(private router: Router, private userService: UserService,
|
||||
private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.confirmationSent = this.route.snapshot.queryParamMap.get('confirmationSent') === 'true';
|
||||
this.router.navigate([], { relativeTo: this.route, replaceUrl: true });
|
||||
}
|
||||
|
||||
public login(): void {
|
||||
let credentials: Credentials = new Credentials();
|
||||
credentials.username = this.username;
|
||||
credentials.password = this.password;
|
||||
|
||||
this.userService.login(credentials, "Password")
|
||||
.then(() => this.router.navigateByUrl("/"),
|
||||
(reason: any) => {
|
||||
switch (reason.status) {
|
||||
case 401: {
|
||||
this.errorMessage = "Неправильный логин или пароль";
|
||||
break;
|
||||
}
|
||||
case 404: {
|
||||
this.errorMessage = "Приложение стартует. Пожалуйста, подождите...";
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
this.errorMessage =
|
||||
"Произошла неизвестная ошибка, обратитесь в службу технической поддержки!";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public goToRegister(): void {
|
||||
this.router.navigateByUrl("/register");
|
||||
}
|
||||
|
||||
togglePasswordType(): void {
|
||||
this.passwordType = !this.passwordType;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
import {Component} from "@angular/core";
|
||||
import {UserService, Session, AuthenticationMethodService} from "@webbpm/base-package";
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "[log-out]",
|
||||
templateUrl: "../../../../../src/resources/template/app/component/log_out.html"
|
||||
})
|
||||
export class LogOutComponent {
|
||||
|
||||
public currentSession: Observable<Session>;
|
||||
|
||||
constructor(private userService: UserService, private authenticationMethodService: AuthenticationMethodService) {
|
||||
this.currentSession = userService.getCurrentSession();
|
||||
}
|
||||
|
||||
public logout(): void {
|
||||
this.userService.logout();
|
||||
}
|
||||
|
||||
public getCurrentUserName(): string {
|
||||
return this.userService.getCurrentUserName();
|
||||
}
|
||||
|
||||
public getFullUserName(): string {
|
||||
return this.userService.getFullUserName();
|
||||
}
|
||||
|
||||
public isLogoutButtonVisible(): boolean {
|
||||
return this.authenticationMethodService.isFormAuth();
|
||||
}
|
||||
|
||||
public getOrgUnitName(): string {
|
||||
return this.userService.getOrgUnitName();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {Component, Input} from "@angular/core";
|
||||
import {Session, UserPasswordResetRequestDto, UserService} from "@webbpm/base-package";
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "newPassword",
|
||||
templateUrl: "../../../../../src/resources/template/app/component/new_password.html"
|
||||
})
|
||||
export class NewPasswordComponent {
|
||||
public currentSession: Observable<Session>;
|
||||
|
||||
private token: string;
|
||||
|
||||
@Input()
|
||||
public password: string;
|
||||
public passwordType: boolean;
|
||||
|
||||
@Input()
|
||||
public confirmPassword: string;
|
||||
public confirmPasswordType: boolean;
|
||||
|
||||
@Input()
|
||||
public errorMessage: string;
|
||||
|
||||
constructor(private router: Router, private userService: UserService,
|
||||
private route: ActivatedRoute) {
|
||||
this.currentSession = this.userService.getCurrentSession();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.token = this.route.snapshot.queryParamMap.get("token");
|
||||
|
||||
this.router.navigate([], {relativeTo: this.route, replaceUrl: true});
|
||||
|
||||
if (this.token == undefined || this.token === '') {
|
||||
this.errorMessage = 'Ссылка недействительна. Требуется повторить восстановление пароля.';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public changePassword(): void {
|
||||
let dto: UserPasswordResetRequestDto = new UserPasswordResetRequestDto();
|
||||
dto.password = this.password;
|
||||
dto.passwordConfirm = this.confirmPassword;
|
||||
this.userService.changePassword(dto, this.token)
|
||||
.then(() => this.router.navigateByUrl("/"),
|
||||
() => {
|
||||
this.errorMessage =
|
||||
'Произошла неизвестная ошибка, обратитесь в службу технической поддержки!';
|
||||
});
|
||||
}
|
||||
|
||||
togglePasswordType(): void {
|
||||
this.passwordType = !this.passwordType;
|
||||
}
|
||||
|
||||
toggleConfirmPasswordType(): void {
|
||||
this.confirmPasswordType = !this.confirmPasswordType;
|
||||
}
|
||||
|
||||
validPasswords(): boolean {
|
||||
if (this.password === undefined || this.confirmPassword === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let eq = this.password === this.confirmPassword;
|
||||
if (!eq) {
|
||||
this.errorMessage = 'Введенные пароли не совпадают. Убедитесь, что данные, ' +
|
||||
'введенные в поле "Подтверждение пароля", совпадают с теми, ' +
|
||||
'которые указаны в поле "Пароль".';
|
||||
}
|
||||
else {
|
||||
this.errorMessage = '';
|
||||
}
|
||||
return eq;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input} from "@angular/core";
|
||||
import {Process, TaskService, ProcessDefinitionResource, ProcessService} from "@webbpm/base-package";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'process',
|
||||
templateUrl: '../../../../../src/resources/template/app/component/process_list.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ProcessListComponent {
|
||||
|
||||
@Input()
|
||||
public processList: Process[];
|
||||
@Input()
|
||||
public errorMessage: string;
|
||||
|
||||
constructor(private processDefinitionResource: ProcessDefinitionResource,
|
||||
private taskService: TaskService,
|
||||
private cd: ChangeDetectorRef,
|
||||
private processService: ProcessService) {
|
||||
this.processList = [];
|
||||
this.loadProcessList();
|
||||
}
|
||||
|
||||
loadProcessList() {
|
||||
this.processDefinitionResource.list().then(
|
||||
(processList) => {
|
||||
this.processList = processList;
|
||||
this.cd.markForCheck();
|
||||
},
|
||||
() => {
|
||||
this.errorMessage = "Error load process list";
|
||||
this.cd.markForCheck();
|
||||
})
|
||||
}
|
||||
|
||||
startProcess(processDefinitionId: string) {
|
||||
this.processService.start(processDefinitionId, null).then(
|
||||
(processInstanceId: number) => {
|
||||
this.taskService.startAndOpenNextTask(processInstanceId);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
import {Component, Input, ViewChild} from "@angular/core";
|
||||
import {AppConfigService, UserDto, UserService} from "@webbpm/base-package";
|
||||
import {Router} from "@angular/router";
|
||||
import {PhoneNumberComponent} from "ngx-international-phone-number";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "register",
|
||||
templateUrl: "../../../../../src/resources/template/app/component/register.html"
|
||||
})
|
||||
export class RegisterComponent {
|
||||
|
||||
public passwordPattern: string;
|
||||
public passwordPatternErrorMessage: string;
|
||||
public errorMessage: string;
|
||||
|
||||
@Input()
|
||||
public username: string;
|
||||
|
||||
@Input()
|
||||
public email: string;
|
||||
@ViewChild(PhoneNumberComponent)
|
||||
public phone: PhoneNumberComponent;
|
||||
public phoneNumber: string;
|
||||
|
||||
public phoneIsTouched: boolean = false;
|
||||
@Input()
|
||||
public password: string;
|
||||
|
||||
public fieldType: boolean;
|
||||
|
||||
@Input()
|
||||
public consent: string;
|
||||
|
||||
constructor(private router: Router, private userService: UserService,private appConfigService: AppConfigService) {
|
||||
this.passwordPattern = appConfigService.getParamValue("password_pattern");
|
||||
this.passwordPatternErrorMessage = appConfigService.getParamValue("password_pattern_error");
|
||||
}
|
||||
|
||||
public register(): void {
|
||||
let user: UserDto = new UserDto();
|
||||
user.username = this.username;
|
||||
user.email = this.email;
|
||||
user.name = this.username;
|
||||
user.phone = this.phone.value;
|
||||
user.password = this.password;
|
||||
|
||||
this.userService.register(user)
|
||||
.then(() => this.router.navigateByUrl("/login?confirmationSent=true"),
|
||||
(reason: any) => {
|
||||
if (reason.status === 409) {
|
||||
this.errorMessage = 'Пользователь с данным почтовым адресом уже существует';
|
||||
}
|
||||
else {
|
||||
this.errorMessage = 'Произошла неизвестная ошибка, обратитесь в службу технической поддержки!';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
toggleFieldType(): void {
|
||||
this.fieldType = !this.fieldType;
|
||||
}
|
||||
|
||||
phoneHasOnlyDialCode(): boolean {
|
||||
return this.phone.phoneNumber.trim() === this.phone.getSelectedCountryDialCode().trim()
|
||||
}
|
||||
|
||||
phoneInputFocusOut(): void {
|
||||
this.phoneIsTouched = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import {Component, Input} from "@angular/core";
|
||||
import {UserService} from "@webbpm/base-package";
|
||||
import {Router} from "@angular/router";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "resetPassword",
|
||||
templateUrl: "../../../../../src/resources/template/app/component/reset_password.html"
|
||||
})
|
||||
export class ResetPasswordComponent {
|
||||
|
||||
@Input()
|
||||
public email: string;
|
||||
|
||||
@Input()
|
||||
public errorMessage: string;
|
||||
|
||||
constructor(private router: Router, private userService: UserService) {
|
||||
}
|
||||
|
||||
resetPassword(): void {
|
||||
|
||||
this.userService.resetPassword(this.email)
|
||||
.then(() => this.router.navigateByUrl("/"),
|
||||
(reason: any) => {
|
||||
this.errorMessage =
|
||||
'Произошла неизвестная ошибка, обратитесь в службу технической поддержки!';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
import {Component, Input} from "@angular/core";
|
||||
import {Task, TaskService, TaskStatus, TaskReference, TaskResource, ProcessVariable, UserService, RolesService, ProcessService} from "@webbpm/base-package";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "task-list",
|
||||
templateUrl: "../../../../../src/resources/template/app/component/task_list.html"
|
||||
})
|
||||
export class TaskListComponent {
|
||||
@Input()
|
||||
public tasks: Task[];
|
||||
|
||||
@Input()
|
||||
public onTimeTasks: Task[];
|
||||
|
||||
@Input()
|
||||
public overdueTasks: Task[];
|
||||
|
||||
@Input()
|
||||
public visibleTasks: Task[];
|
||||
|
||||
@Input()
|
||||
public showMode: string;
|
||||
|
||||
@Input()
|
||||
public errorMessage: string;
|
||||
|
||||
@Input()
|
||||
public roles: string[];
|
||||
|
||||
constructor(private taskService: TaskService,
|
||||
private $taskResource: TaskResource,
|
||||
private userService: UserService,
|
||||
private rolesService: RolesService,
|
||||
private processService: ProcessService) {
|
||||
this.tasks = [];
|
||||
this.onTimeTasks = [];
|
||||
this.overdueTasks = [];
|
||||
this.visibleTasks = [];
|
||||
this.roles = [];
|
||||
this.showMode = 'All';
|
||||
|
||||
this.rolesService.getRoles().then((roles: string[]) => {
|
||||
this.roles = roles;
|
||||
});
|
||||
|
||||
this.loadTasks();
|
||||
}
|
||||
|
||||
private loadTasks(): void {
|
||||
this.$taskResource.list()
|
||||
.then(
|
||||
(tasks: Task[]) => this.initTasks(tasks),
|
||||
() => this.errorMessage = "Error load tasks"
|
||||
);
|
||||
}
|
||||
|
||||
public startTask(task: Task): Promise<any> {
|
||||
let taskRef: TaskReference = new TaskReference();
|
||||
taskRef.processInstanceId = task.processInstanceId;
|
||||
taskRef.taskId = task.id;
|
||||
|
||||
if (task.status == TaskStatus.InProgress) {
|
||||
return this.taskService.openTask(taskRef);
|
||||
}
|
||||
else if (task.status == TaskStatus.Reserved || task.status == TaskStatus.Ready) {
|
||||
return this.taskService.startAndOpenTask(taskRef);
|
||||
}
|
||||
}
|
||||
|
||||
private initTasks(tasks: Task[]): void {
|
||||
this.tasks = tasks;
|
||||
this.filterOnTimeTasks();
|
||||
this.filterOverdueTasks();
|
||||
this.filterVisibleTasks();
|
||||
}
|
||||
|
||||
public isVisible(task: Task): boolean {
|
||||
return this.showMode == 'All' ||
|
||||
this.showMode == 'OnTime' && !this.isOverdue(task) ||
|
||||
this.showMode == 'Overdue' && this.isOverdue(task);
|
||||
}
|
||||
|
||||
public isOverdue(task: Task): boolean {
|
||||
if (!task.expirationTime) {
|
||||
return false;
|
||||
}
|
||||
return new Date(task.expirationTime).getTime() <= new Date().getTime();
|
||||
}
|
||||
|
||||
public isOnTime(task: Task): boolean {
|
||||
return !this.isOverdue(task);
|
||||
}
|
||||
|
||||
public startProcess(processDefinitionId: string, processVars?: Array<ProcessVariable | any>) {
|
||||
this.processService.start(processDefinitionId, processVars).then(
|
||||
(processInstanceId: number) => {
|
||||
this.taskService.startAndOpenNextTask(processInstanceId);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public filterOnTimeTasks() {
|
||||
this.onTimeTasks = this.tasks
|
||||
.filter((task: Task) => this.isOnTime(task));
|
||||
}
|
||||
|
||||
public filterOverdueTasks() {
|
||||
this.overdueTasks = this.tasks
|
||||
.filter((task: Task) => this.isOverdue(task));
|
||||
}
|
||||
|
||||
public filterVisibleTasks() {
|
||||
this.visibleTasks = this.tasks
|
||||
.filter((task: Task) => this.isVisible(task));
|
||||
}
|
||||
|
||||
public hasRole(role: string) {
|
||||
return this.roles.includes(role);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import {ChangeDetectionStrategy, Component} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'task-not-found',
|
||||
templateUrl: '../../../../../src/resources/template/app/component/task_not_found.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class TaskNotFoundComponent {
|
||||
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
||||
goToTaskList() {
|
||||
return this.router.navigateByUrl("/process/tasks");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
import {Component} from "@angular/core";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: "[task]",
|
||||
templateUrl: "../../../../../src/resources/template/app/component/task.html"
|
||||
})
|
||||
export class TaskComponent {
|
||||
}
|
||||
|
|
@ -1,298 +0,0 @@
|
|||
import {Injectable, OnDestroy} from "@angular/core";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {UserService, AppConfigService, Session} from "@webbpm/base-package";
|
||||
import {
|
||||
JivoProfileDto
|
||||
} from "../../../generated/dto/jivoprofile/JivoProfileDto";
|
||||
import {Observable, Subscription} from "rxjs";
|
||||
|
||||
declare function jivo_InitProfile(name, email, phone);
|
||||
|
||||
declare function jivo_ClearHistory();
|
||||
|
||||
@Injectable()
|
||||
export class AppJivoChatWidgetService implements OnDestroy {
|
||||
|
||||
public static LIVE_CHAT_WIDGET_API_URL: string = "jivo_chat_widget_api_url";
|
||||
public static LIVE_CHAT_WIDGET_ENABLE: string = "jivo_chat_widget_enabled";
|
||||
public static LIVE_CHAT_WIDGET_DEFAULT_VALUE: boolean = false;
|
||||
|
||||
private JIVO_CSS: string = `
|
||||
/* hide the original widget - that there were no two labels on the screen*/
|
||||
#jivo_chat_widget{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* the default style - for offline messages if no one is online */
|
||||
#jivo_custom_widget{
|
||||
position: fixed;
|
||||
z-index: 300000;
|
||||
cursor: pointer;
|
||||
|
||||
display: block;
|
||||
right: 60px;
|
||||
bottom: 10px;
|
||||
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABmJLR0QA/wD/AP+gvaeTAAAI1UlEQVR4nO2ca5AUVxXH/+f29MzsEkDiWkQeZRLKKgsIC6EqlJgHpCKG6G6mezL5kCqTaBmifkiV5AMp83A1QavUpEiq/BC0SqxUIjo7D2ah1oohPBQSKYnJApZgECGy4ZUlIbLz6O57/DBb5e6Ghe7e7t7H3N/HmXPPOff+p2/PvX36AgqFQqFQKBQKhUKhUCgUCoVCoVAoFAqFQqEYJ9BYJ+AWzmS0/mp1pq7rsyTwWSHlDAiRBNBEUiYBgIWoAChDyooU4rwA3rcsq7c5kThN2awztj1wx7gUpJzJXCdsexmIbhBEC5j5BgCfA6D5dOk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AQRUn43qlg+OQEgT8y5WGvrXurokGORRDTHM9Xrq04AmBpFPJd8SPXCjV0s5U69WHwrynOxRiKSK6SmaY8Ts1cxjoD5BSa6hup/n68HcB2AmR79nAXRKWJ+VwIHwXwAwMF4a+vhsboKLkf452WlUvOEEIfgrRT1oG7bd1CpdHr4F9zW1lxJJlvItpOCeSrFYlPJtpugacRAjYGP4Ti2I8S5ZLl8irq7o3gHJDBCv0I0IZ5jL2IQva0LsYry+UveTKmrqx/1+X5SEuq6oGaaDzPg+vwPAgq6ECvGw+mgY0VoU1bVMBYS0T4ATS7ML4J5XbxQ+EVY+UwUQrlCOJOZTvU3k9yIsdkGvqDEqBP4PYQzmSbLcUogmn8ZsxoRbWHH+Xm8WNwXdA4TmUAF4fb2qZbjFAHceomvzxCwh4GSrmklymb7gow9WQhUEFvTFgLoIuZXIYTFzH0kxHu2bR8dj+esKxQKhUKhUCgUCoVCoVAoFAqFQqFQKBQKhUJxGf4HQacsFGPlFpMAAAAASUVORK5CYII=');
|
||||
background-size: 60px 60px;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#jivo_custom_widget:hover{
|
||||
bottom: 13px;
|
||||
}
|
||||
|
||||
/* if there are operators online - show other label*/
|
||||
#jivo_custom_widget.jivo_online{
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
background-size: 60px 60px;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABmJLR0QA/wD/AP+gvaeTAAAI/ElEQVR4nO2cbXBU1RnH/8+5m2wgAoLYZDcJbHZj2wGsOMzIlFYFx1K0hal0ygdnqtNOlbYfmJpkE8SXWYug7CaIzPiBtjNtx9FBnFoS6ehYUcCClharCB3B3Wxe7yaAYG0DSfbe8/RDsBNSAvfe3Lt52fP7kmT3f57nufe/59yce88eQKFQKBQKhUKhUCgUCoVCoVAoFAqFQqFQKBTjBBrrAiyzi7WKdEdJAXxB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7smg6VVN2aGqx7yYCNgE470WOMaKfGU8OaOZ8L8wAcrCTQ9WWznKp0UYw3YeJu2reYOAFjbWNybqSlJeJcrb5TCSur2DCa7nK5xL9DOwkNje11FV8kouElpeSjj6TmYQ51jswWYMZLQK8gwzx21zvoZUzQ9jQfj4+tksbkXYAr4Dwh3Rv4BBiJMeiiJycotAz6WuF4W8HMC0X+SzyGUDvMGG/AO9L1QTez+W+WCORkx6iGYWPsH0zTjLTdoBLiRAm5jCDKkEosRnnNBjdICQZOAamjyTzsbYLgROX9IJam1E9wvv/suI9EUnmcdhbinqMC7Q7078o6Rn+RjCmTy0qwmwUyCJiMY2YpjFhCksQSA5IaP/WSBoSOKMV9nYn192Qi++AuIbnPYQht8KeGR+ILC1PRksuezHVY8HzGBzvJyWezgsiCX0tE9vZ/+OPMIuWjofdQccKz4asSKJ7AUMeBjDFgryXmerTdYHnvKpnouBJDwk/fXYGQ74ES2bQTiHlV5UZg7h+DSnf2jEFZl8zgHlXkA0QoUma1JCuDxx2u4aJjKuGfGXL6WlZc2A3gNsu8/YpAAeJqbnfZzR3VlecdTP3ZMFVQ0zRvwAQrwL8BkBZYjrLmtkhB7TUeNxnXaFQKBQKhUKhUCgUCoVCoVAoFAqFQqFQKBSKK/Bf/RI0U2U6gOkAAAAASUVORK5CYII=');
|
||||
}`;
|
||||
|
||||
private JIVO_JS: string = `
|
||||
/* Callback function that is called immediately after JivoChat is loaded */
|
||||
function jivo_onLoadCallback() {
|
||||
window.jivo_cstm_widget = document.createElement('div');
|
||||
jivo_cstm_widget.setAttribute('id', 'jivo_custom_widget');
|
||||
document.body.appendChild(jivo_cstm_widget);
|
||||
|
||||
/* Adds handlers click on the icon - to maximize the window when clicked */
|
||||
jivo_cstm_widget.onclick = function () {
|
||||
jivo_api.open();
|
||||
}
|
||||
|
||||
/* Change the CSS class if there are agents online */
|
||||
if (jivo_config.chat_mode === "online") {
|
||||
jivo_cstm_widget.setAttribute("class", "jivo_online");
|
||||
}
|
||||
|
||||
/* Show the user a shortcut */
|
||||
window.jivo_cstm_widget.style.display = 'block';
|
||||
}
|
||||
|
||||
/*
|
||||
Callback function jivo_onOpen and jivo_onClose called whenever the chat window JivoChat
|
||||
is expanded or collapsed by the user or by the proactive invitations rule.
|
||||
*/
|
||||
function jivo_onOpen() {
|
||||
/* If chat is deployed - hide shortcut */
|
||||
if (jivo_cstm_widget)
|
||||
jivo_cstm_widget.style.display = 'none';
|
||||
}
|
||||
|
||||
function jivo_onClose() {
|
||||
/* If chat is minimized - show label */
|
||||
if (jivo_cstm_widget)
|
||||
jivo_cstm_widget.style.display = 'block';
|
||||
}
|
||||
|
||||
function jivo_ClearHistory() {
|
||||
jivo_api.clearHistory();
|
||||
jivo_api.close();
|
||||
}
|
||||
|
||||
function jivo_InitProfile(name, email, phone) {
|
||||
let chatMode = jivo_api.chatMode();
|
||||
|
||||
let args = {
|
||||
name: name ? name : '',
|
||||
email: email ? email : '',
|
||||
phone: phone ? phone : ''
|
||||
};
|
||||
|
||||
if (chatMode === 'offline') {
|
||||
jivo_api.sendOfflineMessage(args);
|
||||
}
|
||||
else {
|
||||
jivo_api.setContactInfo(args);
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
private currentUserName: string;
|
||||
private currentEmail: string;
|
||||
private currentPhone: string;
|
||||
|
||||
private jsLoaded = false;
|
||||
private jivoWidgetApiUrl: string;
|
||||
|
||||
private currentSession: Observable<Session>;
|
||||
private currentSessionSubscription: Subscription;
|
||||
private session: Session;
|
||||
private sessionInitJivoChatWidget: boolean;
|
||||
|
||||
constructor(private httpClient: HttpClient,
|
||||
private appConfigService: AppConfigService,
|
||||
private userService: UserService) {
|
||||
|
||||
this.currentSession = userService.getCurrentSession();
|
||||
this.currentSessionSubscription =
|
||||
this.currentSession.subscribe(val => {
|
||||
|
||||
if (!this.sessionInitJivoChatWidget || !this.session) {
|
||||
this.initJivoChatWidget();
|
||||
this.sessionInitJivoChatWidget = true;
|
||||
}
|
||||
|
||||
if (this.session && !val) {
|
||||
// logout
|
||||
this.clearJivoProfile();
|
||||
this.session = null;
|
||||
this.sessionInitJivoChatWidget = false;
|
||||
}
|
||||
|
||||
if (val) {
|
||||
this.session = val;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private initJivoChatWidget() {
|
||||
let liveChatWidgetEnabled = this.getValueFromAppConfig(
|
||||
AppJivoChatWidgetService.LIVE_CHAT_WIDGET_ENABLE,
|
||||
AppJivoChatWidgetService.LIVE_CHAT_WIDGET_DEFAULT_VALUE);
|
||||
|
||||
if (liveChatWidgetEnabled) {
|
||||
this.jivoWidgetApiUrl = this.getValueFromAppConfig(
|
||||
AppJivoChatWidgetService.LIVE_CHAT_WIDGET_API_URL,
|
||||
'');
|
||||
|
||||
if (!this.jivoWidgetApiUrl) {
|
||||
throw new Error(
|
||||
`The configuration file does not contain the 'Jivo API url'. Please check that '${AppJivoChatWidgetService.LIVE_CHAT_WIDGET_API_URL}' has data`);
|
||||
}
|
||||
|
||||
let userId = this.userService.getCurrentUserId();
|
||||
if (userId) {
|
||||
this.clearJivoProfile();
|
||||
this.httpClient.get('profile/jivo/' + userId)
|
||||
.toPromise()
|
||||
.then((profile: JivoProfileDto) => {
|
||||
|
||||
this.currentUserName = profile.username;
|
||||
this.currentEmail = profile.email;
|
||||
this.currentPhone = profile.phone;
|
||||
|
||||
let initProfileFunction = () => this.initProfile(this.currentUserName,
|
||||
this.currentEmail,
|
||||
this.currentPhone);
|
||||
this.loadScripts(initProfileFunction);
|
||||
});
|
||||
}
|
||||
else {
|
||||
let initProfileFunction = () => this.initProfile(this.currentUserName, this.currentEmail,
|
||||
this.currentPhone);
|
||||
this.loadScripts(initProfileFunction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private clearJivoProfile() {
|
||||
this.clearProfileData();
|
||||
try {
|
||||
jivo_ClearHistory();
|
||||
}
|
||||
catch (ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
private clearProfileData() {
|
||||
this.currentUserName = '';
|
||||
this.currentEmail = '';
|
||||
this.currentPhone = '';
|
||||
}
|
||||
|
||||
private loadScripts(initProfileFunction): void {
|
||||
let afterLoadMainJs = () => {
|
||||
this.loadScriptJsContent('jivoCustomJs', this.JIVO_JS, initProfileFunction);
|
||||
}
|
||||
this.loadScript('jivoWidget', this.jivoWidgetApiUrl, true, afterLoadMainJs);
|
||||
this.loadStyleContent('jivoCustomCss', this.JIVO_CSS);
|
||||
}
|
||||
|
||||
private initProfile(username: string, email: string, phone: string): void {
|
||||
try {
|
||||
jivo_InitProfile(username, email, phone);
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof ReferenceError) {
|
||||
if (!this.jsLoaded) {
|
||||
this.jsLoaded = true;
|
||||
setTimeout(() => {
|
||||
jivo_InitProfile(username, email, phone);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private loadScript(elementId, js, async, callback): void {
|
||||
let jivoJsLink = document.getElementById(elementId);
|
||||
if (!jivoJsLink) {
|
||||
let node = document.createElement('script');
|
||||
node.src = js;
|
||||
node.type = 'text/javascript';
|
||||
node.id = elementId;
|
||||
node.async = async;
|
||||
node.charset = 'utf-8';
|
||||
if (callback) {
|
||||
node.onload = function () {
|
||||
callback();
|
||||
};
|
||||
}
|
||||
document.getElementsByTagName('head')[0].appendChild(node);
|
||||
}
|
||||
else {
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private loadScriptJsContent(elementId, js, callback): void {
|
||||
let jivoJs = document.getElementById(elementId);
|
||||
if (!jivoJs) {
|
||||
let node = document.createElement('script');
|
||||
node.innerHTML = js;
|
||||
node.type = 'text/javascript';
|
||||
node.id = elementId;
|
||||
node.charset = 'utf-8';
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
document.getElementsByTagName('head')[0].appendChild(node);
|
||||
}
|
||||
else {
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private loadStyleContent(elementId, styleCss): void {
|
||||
let jivoCss = document.getElementById(elementId);
|
||||
if (!jivoCss) {
|
||||
const style = document.createElement('style');
|
||||
style.id = elementId;
|
||||
style.innerHTML = styleCss;
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
}
|
||||
}
|
||||
|
||||
private getValueFromAppConfig(key, defaultValue) {
|
||||
let enabled = this.appConfigService.getParamValue(key);
|
||||
if (enabled === undefined) {
|
||||
return defaultValue;
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.currentSessionSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -8,7 +8,6 @@ import {
|
|||
Router
|
||||
} from "@angular/router";
|
||||
import {ProgressIndicationService} from "@webbpm/base-package";
|
||||
import {AppJivoChatWidgetService} from "../../app/service/app-jivo-chat.service";
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
|
|
@ -20,8 +19,7 @@ export class WebbpmComponent {
|
|||
public footerVisible: boolean = true;
|
||||
|
||||
constructor(private router: Router,
|
||||
private progressIndicationService: ProgressIndicationService,
|
||||
private appJivoChatWidgetService: AppJivoChatWidgetService) {
|
||||
private progressIndicationService: ProgressIndicationService) {
|
||||
router.events.subscribe((event: Event) => {
|
||||
if (event instanceof NavigationStart) {
|
||||
progressIndicationService.showProgressBar();
|
||||
|
|
|
|||
|
|
@ -1,38 +1,16 @@
|
|||
import {NgModule} from "@angular/core";
|
||||
import {RouterModule, Routes} from "@angular/router";
|
||||
import {HomeComponent} from "./component/home.component";
|
||||
import {
|
||||
AuthenticationGuard,
|
||||
HistoryLocationGuard,
|
||||
TaskPageRouteResolver,
|
||||
ConfirmExitGuard
|
||||
} from "@webbpm/base-package";
|
||||
import {DYNAMIC_ROUTING} from "../../page.routing";
|
||||
import {TaskComponent} from "./../app/component/task.component";
|
||||
import {TaskNotFoundComponent} from "./../app/component/task-not-found.component";
|
||||
|
||||
const webbpmRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: 'generated-sources/page-lkul.module#PagelkulModule',
|
||||
canActivate: [AuthenticationGuard, ConfirmExitGuard],
|
||||
canActivate: [ConfirmExitGuard],
|
||||
pathMatch: 'full',
|
||||
},
|
||||
{
|
||||
path: 'process/:processInstanceId/task/:taskId',
|
||||
component: TaskComponent,
|
||||
children: DYNAMIC_ROUTING,
|
||||
canActivate: [HistoryLocationGuard],
|
||||
resolve: {
|
||||
taskPage: TaskPageRouteResolver
|
||||
},
|
||||
runGuardsAndResolvers: "always"
|
||||
},
|
||||
{
|
||||
path: 'process/task-not-found',
|
||||
component: TaskNotFoundComponent,
|
||||
canActivate: [AuthenticationGuard]
|
||||
},
|
||||
{
|
||||
path: '**',
|
||||
redirectTo: '',
|
||||
|
|
|
|||
|
|
@ -13,12 +13,8 @@ import {
|
|||
BpmnModule,
|
||||
ComponentsModule,
|
||||
CoreModule,
|
||||
SecurityModule,
|
||||
} from "@webbpm/base-package";
|
||||
import {TaskParamsProvider} from "@webbpm/base-package";
|
||||
import {ProcessInstanceParamsProvider} from "@webbpm/base-package";
|
||||
import {AppRoutingModule} from "../app/app-routing.module";
|
||||
import {AppJivoChatWidgetService} from "../app/service/app-jivo-chat.service";
|
||||
import {GlobalErrorHandler} from "./handler/global-error.handler.prod";
|
||||
import {DEFAULT_HTTP_INTERCEPTOR_PROVIDERS} from "./interceptor/default-interceptors.prod";
|
||||
|
||||
|
|
@ -45,9 +41,6 @@ let IMPORTS = [
|
|||
],
|
||||
exports: [],
|
||||
providers: [
|
||||
TaskParamsProvider,
|
||||
ProcessInstanceParamsProvider,
|
||||
AppJivoChatWidgetService,
|
||||
{provide: ErrorHandler, useClass: GlobalErrorHandler},
|
||||
DEFAULT_HTTP_INTERCEPTOR_PROVIDERS
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue