Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
85659d99
Commit
85659d99
authored
Jun 28, 2020
by
chamath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View MC user Audit trial added.
parent
7113eeee
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
290 additions
and
117 deletions
+290
-117
app.module.ts
frontend/angular/src/app/app.module.ts
+3
-1
audit-trail.module.ts
frontend/angular/src/app/audit-trail/audit-trail.module.ts
+37
-0
audit-tab.component.html
...audit-trail/components/audit-tab/audit-tab.component.html
+122
-0
audit-tab.component.scss
...audit-trail/components/audit-tab/audit-tab.component.scss
+8
-0
audit-tab.component.ts
...p/audit-trail/components/audit-tab/audit-tab.component.ts
+78
-0
audit-tab.service.ts
...app/audit-trail/components/audit-tab/audit-tab.service.ts
+34
-0
audit.model.ts
...r/src/app/audit-trail/components/audit-tab/audit.model.ts
+6
-0
view-career-user.component.html
...y-career/view-career-user/view-career-user.component.html
+2
-116
No files found.
frontend/angular/src/app/app.module.ts
View file @
85659d99
...
...
@@ -10,6 +10,7 @@ import { ConfirmationService, DragDropModule, FileUploadModule, InputMaskModule,
import
{
AppComponent
}
from
'./app.component'
;
import
{
AppRoutingModule
}
from
'./app.routing'
;
import
{
AppService
}
from
'./app.service'
;
import
{
AuditTrailModule
}
from
'./audit-trail/audit-trail.module'
;
import
{
AdminIframePageComponent
}
from
'./components/admin-portal/admin-iframe-page/admin-iframe-page.component'
;
import
{
AdminPortalLayoutComponent
}
from
'./components/admin-portal/admin-portal-layout/admin-portal-layout.component'
;
import
{
AdminPortalLayoutService
}
from
'./components/admin-portal/admin-portal-layout/admin-portal-layout.service'
;
...
...
@@ -52,7 +53,8 @@ import { GoogleTagManagerService } from './services/google-tag-manager.service';
MultiSelectModule
,
DndModule
,
FileUploadModule
,
KeyFilterModule
KeyFilterModule
,
AuditTrailModule
],
declarations
:
[
AppComponent
,
...
...
frontend/angular/src/app/audit-trail/audit-trail.module.ts
0 → 100644
View file @
85659d99
import
{
PrimeNGModules
}
from
'../utils/common.modules.import'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
OneITModule
}
from
'../oneit/oneit.module'
;
import
{
AuditTabService
}
from
'./components/audit-tab/audit-tab.service'
;
import
{
AuditTabComponent
}
from
'./components/audit-tab/audit-tab.component'
;
let
components
=
[
AuditTabComponent
];
let
services
=
[
AuditTabService
];
@
NgModule
({
imports
:
[
...
PrimeNGModules
,
CommonModule
,
FormsModule
,
OneITModule
,
],
declarations
:
[
...
components
,
],
exports
:
[
...
components
,
],
providers
:
[
...
services
,
]
})
export
class
AuditTrailModule
{
}
frontend/angular/src/app/audit-trail/components/audit-tab/audit-tab.component.html
0 → 100644
View file @
85659d99
<p-progressSpinner
*
ngIf=
"showLoader"
></p-progressSpinner>
<div
class=
"ui-g-12 ui-md-12"
*
ngIf=
"!showLoader && BO"
>
<div
class=
"tab-content"
id=
"v-pills-tabContent"
>
<div
class=
"tab-pane show active"
id=
"v-pills-details"
role=
"tabpanel"
aria-labelledby=
"v-pills-details-tab"
>
<h3
class=
"tab-header"
>
Audit Trail
</h3>
<div
class=
"dashboard"
>
<div
class=
"chat"
>
<div
class=
"event"
*
ngFor=
"let event of events"
>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
<h4
class=
"event-header"
>
Audit Event:
</h4>
</div>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
</div>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
<div
class=
"ui-g-12 ui-md-3 ui-lg-3"
>
<strong>
User
</strong>
</div>
<div
class=
"ui-g-12 ui-md-3 ui-lg-3"
>
{{event.UserName}}({{event.UserID}})
</div>
</div>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
<div
class=
"ui-g-12 ui-md-3 ui-lg-3"
>
<strong>
Date
</strong>
</div>
<div
class=
"ui-g-12 ui-md-3 ui-lg-3"
>
{{event.ObjectCreated | date: 'dd MMM yyyy hh:mm'}}
</div>
</div>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
*
ngIf=
"event.Description"
>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
<strong>
Description
</strong>
</div>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
{{event.Description}}
</div>
</div>
<div
*
ngFor=
"let changeSet of event.DirectChangeSets"
>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
<p>
Change Set : {{changeSet.ReferenceClass}} : {{changeSet.ReferenceID}} ({{changeSet.ObjectStatus?.Name}})
</p>
</div>
</div>
<p-table
#
notesTablesTable
[
columns
]="
changeTablesCols
"
[
value
]="
changeSet
.
Changes
"
[
paginator
]="
false
"
>
<ng-template
pTemplate=
"colgroup"
let-columns
>
<colgroup>
<col
*
ngFor=
"let col of columns"
[
style
.
width
]="
col
.
width
"
>
</colgroup>
</ng-template>
<ng-template
pTemplate=
"header"
let-columns
>
<tr>
<th
*
ngFor=
"let col of columns"
[
pSortableColumn
]="
col
.
field
"
[
pSortableColumnDisabled
]="
col
.
noSort
"
>
{{col.header}}
<p-sortIcon
[
field
]="
col
.
field
"
*
ngIf=
"!col.noSort"
></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template
pTemplate=
"body"
let-rowData
let-rowIndex=
"rowIndex"
>
<tr>
<td>
<label>
{{rowData.FieldName}}
</label>
</td>
<td>
<label>
{{rowData.ChangeType.Description}}
</label>
</td>
<td>
<label>
{{rowData.OldValue}}
</label>
</td>
<td>
<label>
{{rowData.NewValue}}
</label>
</td>
</tr>
</ng-template>
</p-table>
<br><br>
</div>
<div
*
ngFor=
"let changeSet of event.ChangeSet"
>
<div
*
ngFor=
"let affectedScope of changeSet.UnallocatedAffectedScopes"
>
<div
class=
"ui-g-12 ui-md-12 ui-lg-12"
>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
{{affectedScope.Relationship}}
</div>
</div>
<div
class=
"ui-g-12 ui-md-12 ui-lg-12"
>
<div
class=
"ui-g-12 ui-md-6 ui-lg-6"
>
Change Set : {{affectedScope.ChangeSet?.ReferenceClass}} : {{affectedScope.ChangeSet?.ReferenceID}} ({{affectedScope.ChangeSet?.ObjectStatus?.Name}})
</div>
</div>
<p-table
#
notesTablesTable
[
columns
]="
changeTablesCols
"
[
value
]="
affectedScope
.
ChangeSet
?.
Changes
"
[
paginator
]="
false
"
>
<ng-template
pTemplate=
"colgroup"
let-columns
>
<colgroup>
<col
*
ngFor=
"let col of columns"
[
style
.
width
]="
col
.
width
"
>
</colgroup>
</ng-template>
<ng-template
pTemplate=
"header"
let-columns
>
<tr>
<th
*
ngFor=
"let col of columns"
[
pSortableColumn
]="
col
.
field
"
[
pSortableColumnDisabled
]="
col
.
noSort
"
>
{{col.header}}
<p-sortIcon
[
field
]="
col
.
field
"
*
ngIf=
"!col.noSort"
></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template
pTemplate=
"body"
let-rowData
let-rowIndex=
"rowIndex"
>
<tr>
<td>
<label>
{{rowData.FieldName}}
</label>
</td>
<td>
<label>
{{rowData.ChangeType.Description}}
</label>
</td>
<td>
<label>
{{rowData.OldValue}}
</label>
</td>
<td>
<label>
{{rowData.NewValue}}
</label>
</td>
</tr>
</ng-template>
</p-table>
<br><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
frontend/angular/src/app/audit-trail/components/audit-tab/audit-tab.component.scss
0 → 100644
View file @
85659d99
h4
.event-header
{
margin
:
0px
;
}
div
.ui-g-12.ui-md-6
{
padding
:
0px
;
}
\ No newline at end of file
frontend/angular/src/app/audit-trail/components/audit-tab/audit-tab.component.ts
0 → 100644
View file @
85659d99
import
{
Component
,
Input
,
OnDestroy
,
OnInit
,
ViewChild
,
OnChanges
,
SimpleChange
}
from
'@angular/core'
;
import
{
NgForm
}
from
'@angular/forms'
;
import
{
Subscription
}
from
'rxjs'
;
import
{
UtilsService
}
from
'../../../oneit/services/utils.service'
;
import
{
UserService
}
from
'../../../oneit/services/user.service'
;
import
{
AuditTabService
}
from
'./audit-tab.service'
;
@
Component
({
selector
:
'app-audit-tab'
,
templateUrl
:
'./audit-tab.component.html'
,
styleUrls
:
[
'./audit-tab.component.scss'
],
})
export
class
AuditTabComponent
implements
OnInit
,
OnDestroy
,
OnChanges
{
subscriptions
:
Array
<
Subscription
>
=
[];
@
ViewChild
(
'form'
)
form
:
NgForm
;
@
Input
()
BO
:
any
;
@
Input
()
ShowAffectedObjects
:
boolean
=
true
;
events
:
any
[]
=
[];
showLoader
:
boolean
=
false
;
reloadTextarea
:
boolean
=
false
;
showScrollToBottom
:
boolean
=
false
;
currentUserID
:
string
;
inProgress
:
boolean
=
false
;
changeTablesCols
=
[
{
field
:
'Field'
,
header
:
'Field'
,
width
:
'25%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
'ChangeType.Description'
,
header
:
'Change Type'
,
width
:
'25%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
'OldValue'
,
header
:
'Old'
,
width
:
'25%'
,
noSort
:
true
,
noFilter
:
true
},
{
field
:
'NewValue'
,
header
:
'New'
,
width
:
'25%'
,
noSort
:
true
,
noFilter
:
true
},
];
constructor
(
private
utilsService
:
UtilsService
,
private
auditTabService
:
AuditTabService
,
private
userService
:
UserService
,
)
{
}
ngOnInit
()
{
this
.
currentUserID
=
this
.
userService
.
getUserid
();
}
ngOnChanges
(
changes
:
{[
propKey
:
string
]:
SimpleChange
})
{
for
(
let
propName
in
changes
)
{
if
(
propName
==
'BO'
)
{
setTimeout
(()
=>
{
if
(
this
.
BO
&&
this
.
BO
.
ObjectID
)
{
this
.
getEvents
();
}
},
500
);
}
}
}
ngOnDestroy
(){
this
.
utilsService
.
unsubscribeSubscriptions
(
this
.
subscriptions
);
}
private
getEvents
()
{
if
(
this
.
BO
&&
this
.
BO
.
ObjectID
)
{
this
.
subscriptions
.
push
(
this
.
auditTabService
.
getAuditEvents
(
this
.
BO
,
[
'ChangeSet'
,
'ChangeSet.Changes'
,
'ChangeSet.AffectedScope'
,
'ChangeSet.AffectedScope.ChangeSet'
,
'DirectChangeSets'
,
'DirectChangeSets.Changes'
,
'ChangeSet.UnallocatedAffectedScopes'
,
'ChangeSet.UnallocatedAffectedScopes.ChangeSet'
],
this
.
ShowAffectedObjects
)
.
subscribe
(
data
=>
{
this
.
events
=
data
;
},
error
=>
{
this
.
utilsService
.
handleError
(
error
);
}
)
);
}
}
}
frontend/angular/src/app/audit-trail/components/audit-tab/audit-tab.service.ts
0 → 100644
View file @
85659d99
import
{
SearchAudit
}
from
'./audit.model'
;
import
{
Observable
}
from
'rxjs/Observable'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Subject
}
from
'rxjs'
;
import
{
SearchService
}
from
'../../../oneit/services/search.service'
;
import
{
UtilsService
}
from
'../../../oneit/services/utils.service'
;
@
Injectable
()
export
class
AuditTabService
{
DocumentTypes
:
any
;
openDocument
=
new
Subject
<
any
>
();
constructor
(
private
searchService
:
SearchService
,
private
utilsService
:
UtilsService
,
)
{
}
getAuditEvents
(
bo
,
assocs
,
ShowAffectedObjects
):
Observable
<
any
>
{
let
searchAudit
=
new
SearchAudit
();
searchAudit
.
RelatesToID
=
parseInt
(
this
.
utilsService
.
getId
(
bo
.
ObjectID
));
searchAudit
.
RelatesToClass
=
bo
.
ObjectClass
;
searchAudit
.
ShowAffectedObjects
=
ShowAffectedObjects
;
return
this
.
searchService
.
getObjects
(
"AuditEvents"
,
"All"
,
searchAudit
,
assocs
,
null
,
null
,
null
,
null
,
null
)
.
map
(
data
=>
{
return
this
.
utilsService
.
convertResponseToObjects
(
data
,
assocs
);
}
);
}
}
\ No newline at end of file
frontend/angular/src/app/audit-trail/components/audit-tab/audit.model.ts
0 → 100644
View file @
85659d99
export
class
SearchAudit
{
RelatesToID
:
number
;
RelatesToClass
:
string
;
ShowAffectedObjects
:
boolean
;
}
\ No newline at end of file
frontend/angular/src/app/components/my-career/view-career-user/view-career-user.component.html
View file @
85659d99
...
...
@@ -98,122 +98,8 @@
</div>
</div>
</p-tabPanel>
<p-tabPanel
header=
"Audit Trail"
>
<div
class=
"ui-g-12 ui-md-12"
>
<div
class=
"tab-content"
id=
"v-pills-tabContent"
>
<div
class=
"tab-pane fade show active"
id=
"v-pills-details"
role=
"tabpanel"
aria-labelledby=
"v-pills-details-tab"
>
<h2
class=
"tab-header"
>
Audit Trail
</h2>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-5"
>
<label>
Audit Event: by Peter Smith (25585)
</label>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-5"
>
<label>
10 Feb 2020 15:45
</label>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-5"
>
<label>
Changeset: Update Profile: 2568554 (Edit)
</label>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-12"
>
<p-table
#
bosTable
[
columns
]="
bosCols
"
[
value
]="
bos
"
[
paginator
]="
false
"
>
<ng-template
pTemplate=
"colgroup"
let-columns
>
<colgroup>
<col
*
ngFor=
"let col of columns"
[
style
.
width
]="
col
.
width
"
>
</colgroup>
</ng-template>
<ng-template
pTemplate=
"header"
let-columns
>
<tr>
<th
*
ngFor=
"let col of columns"
[
pSortableColumn
]="
col
.
field
"
[
pSortableColumnDisabled
]="
col
.
noSort
"
>
{{col.header}}
<p-sortIcon
[
field
]="
col
.
field
"
*
ngIf=
"!col.noSort"
></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template
pTemplate=
"body"
let-rowData
let-rowIndex=
"rowIndex"
>
<tr>
<td>
{{rowData.Field}}
</td>
<td>
{{rowData.ChangeType}}
</td>
<td>
{{rowData.Old}}
</td>
<td>
{{rowData.New}}
</td>
</tr>
</ng-template>
</p-table>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-12"
>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-5"
>
<label>
Audit Event: by Peter Smith (25585)
</label>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-5"
>
<label>
02 Feb 2020 15:45
</label>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-5"
>
<label>
Changeset: Workplace Preference (Culture) : 2568554 (NEW)
</label>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-12"
>
<p-table
#
bosTable
[
columns
]="
bosCols
"
[
value
]="
bos
"
[
paginator
]="
false
"
>
<ng-template
pTemplate=
"colgroup"
let-columns
>
<colgroup>
<col
*
ngFor=
"let col of columns"
[
style
.
width
]="
col
.
width
"
>
</colgroup>
</ng-template>
<ng-template
pTemplate=
"header"
let-columns
>
<tr>
<th
*
ngFor=
"let col of columns"
[
pSortableColumn
]="
col
.
field
"
[
pSortableColumnDisabled
]="
col
.
noSort
"
>
{{col.header}}
<p-sortIcon
[
field
]="
col
.
field
"
*
ngIf=
"!col.noSort"
></p-sortIcon>
</th>
</tr>
</ng-template>
<ng-template
pTemplate=
"body"
let-rowData
let-rowIndex=
"rowIndex"
>
<tr>
<td>
{{rowData.Field}}
</td>
<td>
{{rowData.ChangeType}}
</td>
<td>
{{rowData.Old}}
</td>
<td>
{{rowData.New}}
</td>
</tr>
</ng-template>
</p-table>
</div>
</div>
<div
class=
"ui-g form-group"
>
<div
class=
"ui-g-12 ui-md-12"
>
</div>
</div>
</div>
</div>
</div>
<p-tabPanel
header=
"Audit Trail"
headerStyleClass=
"contactdetails"
>
<app-audit-tab
[
BO
]="
careerUser
.
Candidate
.
User
"
></app-audit-tab>
</p-tabPanel>
</p-tabView>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment