Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lamarts mobile app angular
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Arko Dey Bhowmick
Lamarts mobile app angular
Commits
3fb06089
Commit
3fb06089
authored
Apr 03, 2025
by
Arko Dey Bhowmick
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_achinta' into test-elements
parents
9cc07e50
8c8724bd
Changes
86
Hide whitespace changes
Inline
Side-by-side
Showing
86 changed files
with
1456 additions
and
616 deletions
+1456
-616
src/app/app.routes.ts
src/app/app.routes.ts
+14
-14
src/app/auth/guard/verify-role.guard.ts
src/app/auth/guard/verify-role.guard.ts
+2
-2
src/app/auth/login/login.component.ts
src/app/auth/login/login.component.ts
+2
-7
src/app/auth/service/auth.service.ts
src/app/auth/service/auth.service.ts
+23
-4
src/app/component-library/audit-log/audit-log-details/audit-log-details.component.html
...it-log/audit-log-details/audit-log-details.component.html
+0
-43
src/app/component-library/audit-log/audit-log-details/audit-log-details.component.scss
...it-log/audit-log-details/audit-log-details.component.scss
+0
-27
src/app/component-library/audit-log/audit-log-details/audit-log-details.component.spec.ts
...log/audit-log-details/audit-log-details.component.spec.ts
+0
-23
src/app/component-library/audit-log/audit-log-details/audit-log-details.component.ts
...udit-log/audit-log-details/audit-log-details.component.ts
+0
-35
src/app/component-library/audit-log/audit-log/audit-log.component.html
...nent-library/audit-log/audit-log/audit-log.component.html
+0
-75
src/app/component-library/audit-log/audit-log/audit-log.component.scss
...nent-library/audit-log/audit-log/audit-log.component.scss
+0
-33
src/app/component-library/audit-log/audit-log/audit-log.component.spec.ts
...t-library/audit-log/audit-log/audit-log.component.spec.ts
+0
-23
src/app/component-library/audit-log/audit-log/audit-log.component.ts
...ponent-library/audit-log/audit-log/audit-log.component.ts
+0
-115
src/app/component-library/audit-log/interface/audit-log-config.ts
...component-library/audit-log/interface/audit-log-config.ts
+0
-6
src/app/component-library/audit-log/interface/audit-log.ts
src/app/component-library/audit-log/interface/audit-log.ts
+0
-13
src/app/component-library/audit-log/interface/response-count.ts
...p/component-library/audit-log/interface/response-count.ts
+0
-4
src/app/component-library/audit-log/model/charts-of-account-log.spec.ts
...ent-library/audit-log/model/charts-of-account-log.spec.ts
+0
-7
src/app/component-library/audit-log/model/charts-of-account-log.ts
...omponent-library/audit-log/model/charts-of-account-log.ts
+0
-42
src/app/component-library/audit-log/model/mat-modal-config.ts
...app/component-library/audit-log/model/mat-modal-config.ts
+0
-17
src/app/component-library/custom-table/custom-table.component.html
...omponent-library/custom-table/custom-table.component.html
+3
-3
src/app/component-library/custom-table/custom-table.component.scss
...omponent-library/custom-table/custom-table.component.scss
+5
-0
src/app/component-library/custom-table/custom-table.component.ts
.../component-library/custom-table/custom-table.component.ts
+9
-2
src/app/mappers/request-mapper.service.ts
src/app/mappers/request-mapper.service.ts
+0
-3
src/app/mappers/role-mapper.service.ts
src/app/mappers/role-mapper.service.ts
+1
-1
src/app/mappers/transmission-mapper.service.spec.ts
src/app/mappers/transmission-mapper.service.spec.ts
+16
-0
src/app/mappers/transmission-mapper.service.ts
src/app/mappers/transmission-mapper.service.ts
+28
-19
src/app/pipe/format-date.pipe.ts
src/app/pipe/format-date.pipe.ts
+10
-10
src/app/portal/assignment/assignment/assignment.component.html
...pp/portal/assignment/assignment/assignment.component.html
+17
-6
src/app/portal/assignment/assignment/assignment.component.scss
...pp/portal/assignment/assignment/assignment.component.scss
+7
-0
src/app/portal/assignment/assignment/assignment.component.ts
src/app/portal/assignment/assignment/assignment.component.ts
+75
-26
src/app/portal/assignment/interface/assignment.ts
src/app/portal/assignment/interface/assignment.ts
+24
-0
src/app/portal/assignment/manage/manage.component.html
src/app/portal/assignment/manage/manage.component.html
+1
-1
src/app/portal/assignment/manage/manage.component.ts
src/app/portal/assignment/manage/manage.component.ts
+2
-1
src/app/portal/assignment/service/prepare-assignment-table-data.service.spec.ts
...ent/service/prepare-assignment-table-data.service.spec.ts
+16
-0
src/app/portal/assignment/service/prepare-assignment-table-data.service.ts
...signment/service/prepare-assignment-table-data.service.ts
+42
-0
src/app/portal/data-source/interface/class.ts
src/app/portal/data-source/interface/class.ts
+17
-0
src/app/portal/data-source/interface/data.ts
src/app/portal/data-source/interface/data.ts
+19
-0
src/app/portal/data-source/interface/foreignKeyListForDataSource.ts
...rtal/data-source/interface/foreignKeyListForDataSource.ts
+11
-0
src/app/portal/data-source/interface/foreignKeyMap.ts
src/app/portal/data-source/interface/foreignKeyMap.ts
+6
-0
src/app/portal/data-source/interface/localizedField.ts
src/app/portal/data-source/interface/localizedField.ts
+7
-0
src/app/portal/data-source/interface/section.ts
src/app/portal/data-source/interface/section.ts
+20
-0
src/app/portal/exam/exam/exam.component.html
src/app/portal/exam/exam/exam.component.html
+15
-1
src/app/portal/exam/exam/exam.component.scss
src/app/portal/exam/exam/exam.component.scss
+7
-0
src/app/portal/exam/exam/exam.component.ts
src/app/portal/exam/exam/exam.component.ts
+93
-1
src/app/portal/exam/interface/exam-schedule.ts
src/app/portal/exam/interface/exam-schedule.ts
+22
-0
src/app/portal/exam/manage/manage.component.html
src/app/portal/exam/manage/manage.component.html
+1
-1
src/app/portal/exam/manage/manage.component.ts
src/app/portal/exam/manage/manage.component.ts
+10
-2
src/app/portal/exam/service/prepare-exam-table-data.service.spec.ts
...rtal/exam/service/prepare-exam-table-data.service.spec.ts
+16
-0
src/app/portal/exam/service/prepare-exam-table-data.service.ts
...pp/portal/exam/service/prepare-exam-table-data.service.ts
+40
-0
src/app/portal/navigation/service/logout.service.ts
src/app/portal/navigation/service/logout.service.ts
+2
-2
src/app/portal/navigation/sidebar/sidebar.component.scss
src/app/portal/navigation/sidebar/sidebar.component.scss
+3
-2
src/app/portal/navigation/topbar/topbar.component.html
src/app/portal/navigation/topbar/topbar.component.html
+1
-1
src/app/portal/routine/interface/routine.ts
src/app/portal/routine/interface/routine.ts
+24
-0
src/app/portal/routine/manage/manage.component.html
src/app/portal/routine/manage/manage.component.html
+57
-1
src/app/portal/routine/manage/manage.component.ts
src/app/portal/routine/manage/manage.component.ts
+260
-5
src/app/portal/routine/routine/routine.component.html
src/app/portal/routine/routine/routine.component.html
+15
-1
src/app/portal/routine/routine/routine.component.scss
src/app/portal/routine/routine/routine.component.scss
+7
-0
src/app/portal/routine/routine/routine.component.ts
src/app/portal/routine/routine/routine.component.ts
+86
-1
src/app/portal/routine/service/prepare-routine-table-data.service.spec.ts
...outine/service/prepare-routine-table-data.service.spec.ts
+16
-0
src/app/portal/routine/service/prepare-routine-table-data.service.ts
...tal/routine/service/prepare-routine-table-data.service.ts
+42
-0
src/app/portal/service/data-source.service.spec.ts
src/app/portal/service/data-source.service.spec.ts
+16
-0
src/app/portal/service/data-source.service.ts
src/app/portal/service/data-source.service.ts
+16
-0
src/app/portal/service/url-config.service.spec.ts
src/app/portal/service/url-config.service.spec.ts
+16
-0
src/app/portal/service/url-config.service.ts
src/app/portal/service/url-config.service.ts
+15
-0
src/app/raintree/error-handler.service.ts
src/app/raintree/error-handler.service.ts
+2
-2
src/app/raintree/interface/assignment-respons.ts
src/app/raintree/interface/assignment-respons.ts
+7
-0
src/app/raintree/interface/auth-response.ts
src/app/raintree/interface/auth-response.ts
+2
-4
src/app/raintree/interface/class-respons.ts
src/app/raintree/interface/class-respons.ts
+8
-0
src/app/raintree/interface/exam-schedule-respons.ts
src/app/raintree/interface/exam-schedule-respons.ts
+6
-0
src/app/raintree/interface/raintree-response.ts
src/app/raintree/interface/raintree-response.ts
+1
-1
src/app/raintree/interface/response-count-response.ts
src/app/raintree/interface/response-count-response.ts
+0
-7
src/app/raintree/interface/routine-respons.ts
src/app/raintree/interface/routine-respons.ts
+6
-0
src/app/raintree/interface/section-respons.ts
src/app/raintree/interface/section-respons.ts
+8
-0
src/app/raintree/transmission/assignment-transmission.service.spec.ts
...tree/transmission/assignment-transmission.service.spec.ts
+16
-0
src/app/raintree/transmission/assignment-transmission.service.ts
.../raintree/transmission/assignment-transmission.service.ts
+30
-0
src/app/raintree/transmission/auth-transmission.service.ts
src/app/raintree/transmission/auth-transmission.service.ts
+0
-13
src/app/raintree/transmission/class-transmission.service.spec.ts
.../raintree/transmission/class-transmission.service.spec.ts
+16
-0
src/app/raintree/transmission/class-transmission.service.ts
src/app/raintree/transmission/class-transmission.service.ts
+47
-0
src/app/raintree/transmission/exam-schedule.service.spec.ts
src/app/raintree/transmission/exam-schedule.service.spec.ts
+16
-0
src/app/raintree/transmission/exam-schedule.service.ts
src/app/raintree/transmission/exam-schedule.service.ts
+29
-0
src/app/raintree/transmission/jwt.service.ts
src/app/raintree/transmission/jwt.service.ts
+8
-4
src/app/raintree/transmission/routine-transmission.service.spec.ts
...aintree/transmission/routine-transmission.service.spec.ts
+16
-0
src/app/raintree/transmission/routine-transmission.service.ts
...app/raintree/transmission/routine-transmission.service.ts
+49
-0
src/app/raintree/transmission/section-transmission.service.spec.ts
...aintree/transmission/section-transmission.service.spec.ts
+16
-0
src/app/raintree/transmission/section-transmission.service.ts
...app/raintree/transmission/section-transmission.service.ts
+9
-0
src/app/raintree/transmission/transmission.service.ts
src/app/raintree/transmission/transmission.service.ts
+6
-4
src/styles.scss
src/styles.scss
+1
-1
No files found.
src/app/app.routes.ts
View file @
3fb06089
...
...
@@ -7,20 +7,20 @@ import { RoleMapperService } from './mappers/role-mapper.service';
export
const
routes
:
Routes
=
[
{
path
:
RequestMapperService
.
STYLE_GUIDE
,
loadComponent
:
()
=>
import
(
'
./style-guide/style-guide/style-guide.component
'
).
then
((
m
)
=>
m
.
StyleGuideComponent
),
data
:
{
roles
:
[]
},
children
:
[
{
path
:
RequestMapperService
.
BASE_RELATIVE_URL
,
loadChildren
:
()
=>
import
(
'
./style-guide/style-guide.routes
'
)
.
then
(
r
=>
r
.
STYLE_GUIDE_ROTES
)
},
]
},
//
{
//
path: RequestMapperService.STYLE_GUIDE,
//
loadComponent: () =>
//
import('./style-guide/style-guide/style-guide.component').then((m) => m.StyleGuideComponent),
//
data: { roles: [] },
//
children: [
//
{
//
path: RequestMapperService.BASE_RELATIVE_URL,
//
loadChildren: () =>
//
import('./style-guide/style-guide.routes')
//
.then(r => r.STYLE_GUIDE_ROTES)
//
},
//
]
//
},
{
path
:
RequestMapperService
.
LOGIN_URL
,
loadComponent
:
()
=>
...
...
src/app/auth/guard/verify-role.guard.ts
View file @
3fb06089
...
...
@@ -13,8 +13,8 @@ export const verifyRoleGuard: CanActivateFn = (
const
requiredRoles
:
string
[]
=
route
.
data
[
'
roles
'
]
as
string
[];
const
userRole
:
string
=
localStorage
.
getItem
(
'
role
'
)
||
''
;
console
.
log
(
'
requiredRoles=>
'
,
requiredRoles
);
console
.
log
(
'
userRole=>
'
,
userRole
);
//
console.log('requiredRoles=>',requiredRoles);
//
console.log('userRole=>',userRole);
// return true;
if
(
userRole
&&
isRoleValid
(
requiredRoles
,
userRole
)
)
return
true
;
...
...
src/app/auth/login/login.component.ts
View file @
3fb06089
import
{
CommonModule
,
NgOptimizedImage
,
isPlatformBrowser
}
from
'
@angular/common
'
;
import
{
Component
,
Inject
,
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
Router
,
RouterModule
}
from
'
@angular/router
'
;
import
{
RequestMapperService
}
from
'
../../mappers/request-mapper.service
'
;
import
{
RoundedButtonComponent
}
from
'
../../component-library/rounded-button/rounded-button.component
'
;
import
{
RoundedButtonFullWidthComponent
}
from
'
../../component-library/rounded-button-full-width/rounded-button-full-width.component
'
;
import
{
AuthTransmissionService
}
from
'
../../raintree/transmission/auth-transmission.service
'
;
import
{
TransmissionMapperService
}
from
'
../../mappers/transmission-mapper.service
'
;
...
...
@@ -13,7 +11,6 @@ import { MatFormFieldModule } from '@angular/material/form-field';
import
{
MatInputModule
}
from
'
@angular/material/input
'
;
import
{
AbstractControl
,
FormControl
,
FormGroup
,
ReactiveFormsModule
,
Validators
}
from
'
@angular/forms
'
;
import
{
TransmissionMessageHandlerService
}
from
'
../../raintree/transmission-message-handler/transmission-message-handler
'
;
import
{
UserProfileResponse
}
from
'
../../raintree/interface/user-profile-response
'
;
import
{
UserProfile
}
from
'
../interface/user-profile
'
;
import
{
ToasterService
}
from
'
../../component-library/toaster/toaster.service
'
;
...
...
@@ -22,7 +19,6 @@ import { ToasterService } from '../../component-library/toaster/toaster.service'
imports
:
[
NgOptimizedImage
,
RouterModule
,
// RoundedButtonComponent,
RoundedButtonFullWidthComponent
,
MatFormFieldModule
,
MatInputModule
,
...
...
@@ -46,8 +42,8 @@ export class LoginComponent {
public
hidePassword
:
boolean
=
true
;
public
loginForm
=
new
FormGroup
({
email
:
new
FormControl
(
''
,
[
Validators
.
required
]),
password
:
new
FormControl
(
''
,
[
Validators
.
required
]),
email
:
new
FormControl
(
'
achintadey.websofttechs@gmail.com
'
,
[
Validators
.
required
]),
password
:
new
FormControl
(
'
P@$$w0rd
'
,
[
Validators
.
required
]),
});
public
authenticate
():
void
{
...
...
@@ -68,7 +64,6 @@ export class LoginComponent {
if
(
this
.
_transmissionMessageHandler
.
hasError
(
response
))
{
this
.
errorMessage
=
response
[
'
message
'
];
console
.
log
(
this
.
errorMessage
);
return
;
};
...
...
src/app/auth/service/auth.service.ts
View file @
3fb06089
...
...
@@ -22,14 +22,20 @@ export class AuthService {
}
public
prepareLoginProcess
(
userProfileData
:
UserProfile
):
void
{
console
.
log
(
userProfileData
);
this
.
_setProfileInformationInLocalStorage
(
userProfileData
);
if
(
this
.
isBrowser
)
{
localStorage
.
setItem
(
'
isLoggedIn
'
,
'
true
'
);
localStorage
.
setItem
(
'
role
'
,
userProfileData
.
role_name
);
// localStorage.setItem('role','FO,accountant'); //TODO: for testing
// TODO: This is for temporary
if
(
userProfileData
.
role_name
===
'
Teacher
'
)
{
localStorage
.
setItem
(
'
role
'
,
'
EDITOR
'
);
}
else
{
localStorage
.
setItem
(
'
role
'
,
userProfileData
.
role_name
);
}
this
.
_router
.
navigate
([
RequestMapperService
.
PORTAL_URL
]);
}
}
...
...
@@ -38,4 +44,17 @@ export class AuthService {
// console.log(jwtToken);
localStorage
.
setItem
(
'
userProfile
'
,
JSON
.
stringify
(
userProfileData
));
}
public
localStorageGetItemByKey
(
key
:
string
):
string
{
const
localStorageItem
=
JSON
.
parse
(
localStorage
.
getItem
(
'
userProfile
'
)
!
);
return
localStorageItem
[
key
]
||
''
;
}
public
getUserRole
():
string
{
return
this
.
localStorageGetItemByKey
(
'
role
'
);
}
}
src/app/component-library/audit-log/audit-log-details/audit-log-details.component.html
deleted
100644 → 0
View file @
9cc07e50
<div
class=
"log_viewer_component"
>
<div
class=
"log_col full_width"
>
<app-page-heading
[title]=
"'Audit Log Details'"
/>
</div>
<div
class=
"log_col"
>
<h3>
ID
</h3>
<p>
{{data.id}}
</p>
</div>
<div
class=
"log_col"
>
<h3>
User Id
</h3>
<p>
{{data.user_id}}
</p>
</div>
<div
class=
"log_col"
>
<h3>
User Name
</h3>
<p>
{{data.user_name}}
</p>
</div>
<div
class=
"log_col"
>
<h3>
Created At
</h3>
<p>
{{data.created_at}}
</p>
</div>
<div
class=
"log_col"
>
<h3>
IP Address
</h3>
<p>
{{data.ip_address}}
</p>
</div>
<div
class=
"log_col full_width"
>
<h3>
endpoint
</h3>
<p>
{{temp(data.request_payload)}}
</p>
</div>
<div
class=
"log_col full_width"
>
<h3>
Notes
</h3>
<p>
{{temp(data.request_payload) }}
</p>
</div>
</div>
src/app/component-library/audit-log/audit-log-details/audit-log-details.component.scss
deleted
100644 → 0
View file @
9cc07e50
.log_viewer_component
{
display
:
flex
;
flex-wrap
:
wrap
;
padding
:
20px
;
background-color
:
var
(
--
primary-bg-color
);
color
:
var
(
--
primary-color
);
.log_col
{
width
:
20%
;
h3
{
font-size
:
14px
;
}
&
.full_width
{
width
:
100%
;
}
}
}
.
mat-mdc-dialog-surface
:
:
ng-deep
{
background
:
var
(
--
secondary-bg-color
)
!
important
;
}
src/app/component-library/audit-log/audit-log-details/audit-log-details.component.spec.ts
deleted
100644 → 0
View file @
9cc07e50
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
AuditLogDetailsComponent
}
from
'
./audit-log-details.component
'
;
describe
(
'
AuditLogDetailsComponent
'
,
()
=>
{
let
component
:
AuditLogDetailsComponent
;
let
fixture
:
ComponentFixture
<
AuditLogDetailsComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
imports
:
[
AuditLogDetailsComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
AuditLogDetailsComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/component-library/audit-log/audit-log-details/audit-log-details.component.ts
deleted
100644 → 0
View file @
9cc07e50
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
MatDialogRef
,
MAT_DIALOG_DATA
,
MatDialogActions
,
MatDialogClose
,
MatDialogContent
,
MatDialogTitle
}
from
'
@angular/material/dialog
'
;
import
{
AuditLog
}
from
'
../interface/audit-log
'
;
import
{
PageHeadingComponent
}
from
'
../../page-heading/page-heading.component
'
;
@
Component
({
selector
:
'
app-audit-log-details
'
,
imports
:
[
// MatDialogTitle,
// MatDialogContent,
// MatDialogActions,
// MatDialogClose,
PageHeadingComponent
],
templateUrl
:
'
./audit-log-details.component.html
'
,
styleUrl
:
'
./audit-log-details.component.scss
'
})
export
class
AuditLogDetailsComponent
{
constructor
(
private
_dialogRef
:
MatDialogRef
<
AuditLogDetailsComponent
>
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
AuditLog
,
)
{}
public
onNoClick
():
void
{
this
.
_dialogRef
.
close
(
this
.
data
);
}
public
ngOnInit
():
void
{
console
.
log
(
this
.
data
)
}
public
temp
(
request_payload
:
any
):
any
{
return
JSON
.
stringify
(
request_payload
,
null
,
2
);
}
}
src/app/component-library/audit-log/audit-log/audit-log.component.html
deleted
100644 → 0
View file @
9cc07e50
<app-page-heading
[title]=
"'Audit Log'"
/>
<app-filter-with-export-and-print
[placeholder]=
"'Ex: User ID, User Name'"
(inputData)=
"applyFilter($event)"
[dropDownData]=
"endPoints"
(emitDropDownData)=
"selectDropdownFromFilter($event)"
></app-filter-with-export-and-print>
<table
mat-table
[dataSource]=
"dataSource"
>
<!-- ID Column -->
<ng-container
matColumnDef=
"id"
>
<th
mat-header-cell
*matHeaderCellDef
>
ID
</th>
<td
mat-cell
*matCellDef=
"let log"
data-label=
"id"
>
{{ log.id }}
</td>
</ng-container>
<!-- User ID Column -->
<ng-container
matColumnDef=
"user_id"
>
<th
mat-header-cell
*matHeaderCellDef
>
User ID
</th>
<td
mat-cell
*matCellDef=
"let log"
>
{{ log.user_id }}
</td>
</ng-container>
<!-- User Name Column -->
<ng-container
matColumnDef=
"user_name"
>
<th
mat-header-cell
*matHeaderCellDef
>
User Name
</th>
<td
mat-cell
*matCellDef=
"let log"
>
{{ log.user_name }}
</td>
</ng-container>
<!-- IP Address Column -->
<ng-container
matColumnDef=
"ip_address"
>
<th
mat-header-cell
*matHeaderCellDef
>
IP Address
</th>
<td
mat-cell
*matCellDef=
"let log"
>
{{ log.ip_address }}
</td>
</ng-container>
<!-- Method Column -->
<ng-container
matColumnDef=
"method"
>
<th
mat-header-cell
*matHeaderCellDef
>
Method
</th>
<td
mat-cell
*matCellDef=
"let log"
>
{{ log.method }}
</td>
</ng-container>
<!-- Created Column -->
<ng-container
matColumnDef=
"created_at"
>
<th
mat-header-cell
*matHeaderCellDef
>
Created
</th>
<td
mat-cell
*matCellDef=
"let log"
>
{{ log.created_at }}
</td>
</ng-container>
<!-- CTA Column -->
<ng-container
matColumnDef=
"action"
>
<th
mat-header-cell
*matHeaderCellDef
>
Action
</th>
<td
mat-cell
*matCellDef=
"let log"
>
<button
(click)=
"openDialog(log)"
class=
"view_button"
>
<span
class=
"material-symbols-outlined"
>
visibility
</span>
</button>
</td>
</ng-container>
<tr
mat-header-row
*matHeaderRowDef=
"displayedColumns"
></tr>
<tr
mat-row
*matRowDef=
"let row; columns: displayedColumns"
></tr>
</table>
<mat-paginator
[length]=
"totalItems"
[pageSize]=
"pageSize"
showFirstLastButtons
[pageSizeOptions]=
"[5, 10, 20]"
(page)=
"pageChanged($event)"
*ngIf=
"dataSource && dataSource.data.length"
#paginator
></mat-paginator>
src/app/component-library/audit-log/audit-log/audit-log.component.scss
deleted
100644 → 0
View file @
9cc07e50
// .mat-mdc-table::ng-deep {
// background: var(--secondary-bg-color);
// box-shadow: var(--box-shadow-small);
// font-family: var(--font-light);
// .mat-mdc-header-row {
// background: var(--accent-color);
// border: none;
// color: white;
// }
// .mdc-data-table__content{
// td {
// color: var(--primary-color);
// border-bottom: 1px solid var(--border-color);
// }
// .mdc-data-table__row:last-child .mat-mdc-cell {
// border-bottom: none;
// }
// }
// }
// .view_button {
// all: unset;
// display: block;
// text-align: center;
// width: 100%;
// cursor: pointer;
// }
src/app/component-library/audit-log/audit-log/audit-log.component.spec.ts
deleted
100644 → 0
View file @
9cc07e50
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
AuditLogComponent
}
from
'
./audit-log.component
'
;
describe
(
'
AuditLogComponent
'
,
()
=>
{
let
component
:
AuditLogComponent
;
let
fixture
:
ComponentFixture
<
AuditLogComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
imports
:
[
AuditLogComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
AuditLogComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/component-library/audit-log/audit-log/audit-log.component.ts
deleted
100644 → 0
View file @
9cc07e50
import
{
AfterViewInit
,
Component
,
Input
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
import
{
MatTableDataSource
,
MatTableModule
}
from
'
@angular/material/table
'
;
import
{
AuditLog
}
from
'
../interface/audit-log
'
;
import
{
MatDialog
,
MatDialogModule
}
from
'
@angular/material/dialog
'
;
import
{
AuditLogDetailsComponent
}
from
'
../audit-log-details/audit-log-details.component
'
;
import
{
MatPaginator
,
MatPaginatorModule
,
PageEvent
}
from
'
@angular/material/paginator
'
;
import
{
PipeModule
}
from
'
../../../pipe/pipe.module
'
;
import
{
FilterWithExportAndPrintComponent
}
from
'
../../filter-with-export-and-print/filter-with-export-and-print.component
'
;
import
{
PageHeadingComponent
}
from
'
../../page-heading/page-heading.component
'
;
import
{
MatModalConfig
}
from
'
../model/mat-modal-config
'
;
import
{
AuditLogTransmissionService
}
from
'
../../../raintree/transmission/audit-log-transmission.service
'
;
import
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Dropdown
}
from
'
../../dropdown/interface/dropdown
'
;
import
{
PaginationComponent
}
from
'
../../pagination/pagination/pagination.component
'
;
@
Component
({
selector
:
'
app-audit-log
'
,
imports
:
[
MatTableModule
,
PageHeadingComponent
,
PipeModule
,
MatDialogModule
,
MatPaginatorModule
,
FilterWithExportAndPrintComponent
,
CommonModule
,
// PaginationComponent
],
templateUrl
:
'
./audit-log.component.html
'
,
styleUrls
:
[
'
../../../style-guide/css/table-theme.scss
'
]
})
export
class
AuditLogComponent
implements
AfterViewInit
,
OnInit
{
@
ViewChild
(
MatPaginator
)
private
paginator
!
:
MatPaginator
;
@
Input
()
public
logs
:
AuditLog
[]
=
[];
@
Input
()
public
endPoints
:
Dropdown
[]
=
[];
public
displayedColumns
:
string
[]
=
[
'
id
'
,
'
user_id
'
,
'
user_name
'
,
'
ip_address
'
,
'
method
'
,
'
created_at
'
,
'
action
'
];
public
dataSource
:
MatTableDataSource
<
AuditLog
>
=
{}
as
MatTableDataSource
<
AuditLog
>
;
public
pageSize
:
number
=
5
;
public
pageNumber
:
number
=
1
;
public
totalItems
=
0
;
constructor
(
private
_dialog
:
MatDialog
,
private
_auditLogTransmission
:
AuditLogTransmissionService
)
{
this
.
dataSource
=
new
MatTableDataSource
(
this
.
logs
);
}
public
openDialog
(
log
:
AuditLog
):
void
{
this
.
_dialog
.
open
(
AuditLogDetailsComponent
,
{
data
:
log
,
...
MatModalConfig
.
getLogConfig
});
}
public
ngOnInit
():
void
{
this
.
_getLogCount
(
this
.
endPoints
[
0
].
value
,
this
.
pageNumber
,
this
.
pageSize
);
}
public
ngAfterViewInit
():
void
{
this
.
dataSource
.
paginator
=
this
.
paginator
;
}
public
applyFilter
(
filterString
:
string
):
void
{
this
.
dataSource
.
filter
=
filterString
.
trim
().
toLowerCase
();
if
(
this
.
dataSource
.
paginator
)
{
this
.
dataSource
.
paginator
.
firstPage
();
}
}
private
_getLogs
(
endPoint
:
string
,
pageNumber
:
number
,
pageSize
:
number
):
void
{
this
.
_auditLogTransmission
.
getLogs
(
TransmissionMapperService
.
AUDIT_LOG_TRANSMISSION_URL
+
`?endpoint=
${
endPoint
}
&page=
${
pageNumber
?
pageNumber
:
1
}
&page_size=
${
pageSize
}
`
,
()
=>
{},
()
=>
{},
(
response
)
=>
{
//success
this
.
logs
=
response
;
this
.
dataSource
=
new
MatTableDataSource
(
this
.
logs
);
},
()
=>
{},
//failure
()
=>
{},
);
}
private
_getLogCount
(
endPoint
:
string
,
pageNumber
:
number
,
pageSize
:
number
):
void
{
this
.
_auditLogTransmission
.
getLogCount
(
TransmissionMapperService
.
AUDIT_LOG_COUNT_TRANSMISSION_URL
+
`?endpoint=
${
endPoint
}
&page=
${
pageNumber
?
pageNumber
:
1
}
&page_size=
${
pageSize
}
`
,
()
=>
{},
()
=>
{},
(
response
)
=>
{
//success
this
.
totalItems
=
response
.
count
;
this
.
_getLogs
(
endPoint
,
pageNumber
,
pageSize
);
},
()
=>
{},
//failure
()
=>
{},
);
}
public
selectDropdownFromFilter
(
selectedData
:
string
):
void
{
let
endpoint
:
string
=
encodeURIComponent
(
selectedData
);
// this.paginator.firstPage();
this
.
_getLogCount
(
endpoint
,
1
,
this
.
pageSize
);
}
public
pageChanged
(
event
:
PageEvent
)
:
void
{
this
.
pageSize
=
event
.
pageSize
;
this
.
pageNumber
=
event
.
pageIndex
+
1
;
this
.
_getLogCount
(
this
.
endPoints
[
0
].
value
,
this
.
pageNumber
,
this
.
pageSize
);
}
}
src/app/component-library/audit-log/interface/audit-log-config.ts
deleted
100644 → 0
View file @
9cc07e50
export
interface
AuditLogConfig
{
width
:
string
,
height
:
string
,
maxWidth
:
string
,
maxHeight
:
string
,
}
src/app/component-library/audit-log/interface/audit-log.ts
deleted
100644 → 0
View file @
9cc07e50
export
interface
AuditLog
{
id
:
number
,
user_id
:
number
,
user_name
:
string
,
ip_address
:
string
,
endpoint
:
string
,
method
:
string
,
request_payload
:
any
,
query_params
:
any
,
created_at
:
string
}
src/app/component-library/audit-log/interface/response-count.ts
deleted
100644 → 0
View file @
9cc07e50
export
interface
ResponseCount
{
count
:
number
}
src/app/component-library/audit-log/model/charts-of-account-log.spec.ts
deleted
100644 → 0
View file @
9cc07e50
import
{
ChartsOfAccountLog
}
from
'
./charts-of-account-log
'
;
describe
(
'
ChartsOfAccountLog
'
,
()
=>
{
it
(
'
should create an instance
'
,
()
=>
{
expect
(
new
ChartsOfAccountLog
()).
toBeTruthy
();
});
});
src/app/component-library/audit-log/model/charts-of-account-log.ts
deleted
100644 → 0
View file @
9cc07e50
import
{
AuditLog
}
from
"
../interface/audit-log
"
;
export
class
ChartsOfAccountLog
{
private
static
readonly
_log1
:
AuditLog
=
{
id
:
1
,
user_id
:
123
,
user_name
:
'
Deep Dey
'
,
ip_address
:
'
103.220.209.138
'
,
endpoint
:
'
/nkda/v1/user/get
'
,
method
:
'
POST
'
,
request_payload
:
{
key1
:
'
value1
'
,
key2
:
'
value2
'
,
key3
:
'
value3
'
,
key4
:
'
value4
'
,
},
query_params
:
{
key1
:
'
value1
'
,
key2
:
'
value2
'
,
key3
:
'
value3
'
,
key4
:
'
value4
'
,
},
created_at
:
'
20-5-2024
'
}
private
static
readonly
_logItems
:
AuditLog
[]
=
[
ChartsOfAccountLog
.
_log1
,
ChartsOfAccountLog
.
_log1
,
ChartsOfAccountLog
.
_log1
,
ChartsOfAccountLog
.
_log1
,
ChartsOfAccountLog
.
_log1
,
ChartsOfAccountLog
.
_log1
,
];
public
static
get
getLogItems
():
AuditLog
[]
{
return
ChartsOfAccountLog
.
_logItems
;
}
}
src/app/component-library/audit-log/model/mat-modal-config.ts
deleted
100644 → 0
View file @
9cc07e50
import
{
AuditLogConfig
}
from
"
../interface/audit-log-config
"
;
export
class
MatModalConfig
{
private
static
readonly
_config
:
AuditLogConfig
=
{
width
:
'
98vw
'
,
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
maxHeight
:
'
70vh
'
,
}
public
static
get
getLogConfig
():
AuditLogConfig
{
return
MatModalConfig
.
_config
;
}
}
src/app/component-library/custom-table/custom-table.component.html
View file @
3fb06089
...
...
@@ -11,13 +11,13 @@
@for (item of element[column.key]; track item) {
<ng-container
*ngIf=
"item =='view'"
>
<button
class=
"view_button d_inline_block width_auto
ml_1
"
(click)=
"view(element)"
>
<button
class=
"view_button d_inline_block width_auto "
(click)=
"view(element)"
>
<span
class=
"material-symbols-outlined"
>
visibility
</span>
</button>
</ng-container>
<ng-container
*ngIf=
"item =='edit'"
>
<button
class=
"view_button d_inline_block width_auto
ml_1
"
(click)=
"edit(element)"
>
<ng-container
*ngIf=
"item =='edit'
&& authService.getUserRole() !== 'student'
"
>
<button
class=
"view_button d_inline_block width_auto "
(click)=
"edit(element)"
>
<span
class=
"material-symbols-outlined"
>
edit
</span>
</button>
</ng-container>
...
...
src/app/component-library/custom-table/custom-table.component.scss
View file @
3fb06089
// @media only screen and (max-width: 999px) and (min-width: 300px) {
// .mat-mdc-header-row{
// }
// }
\ No newline at end of file
src/app/component-library/custom-table/custom-table.component.ts
View file @
3fb06089
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
,
EventEmitter
,
Input
,
Output
}
from
'
@angular/core
'
;
import
{
Component
,
EventEmitter
,
inject
,
Input
,
Output
}
from
'
@angular/core
'
;
import
{
MatTableModule
}
from
'
@angular/material/table
'
;
import
{
MatPaginator
}
from
'
@angular/material/paginator
'
;
import
{
AuthService
}
from
'
../../auth/service/auth.service
'
;
@
Component
({
selector
:
'
app-custom-table
'
,
...
...
@@ -28,6 +29,8 @@ export class CustomTableComponent {
@
Output
()
emitEdit
:
EventEmitter
<
string
>
=
new
EventEmitter
<
string
>
();
public
authService
=
inject
(
AuthService
);
// totalRecords: number = 3400;
// pageSize: number = 50;
...
...
@@ -67,7 +70,11 @@ export class CustomTableComponent {
// ];
// data = [
// { id: 1, name: 'John Doe', age: 30 },
// {
// id: 1,
// name: 'John Doe',
// age: 30
// },
// { id: 2, name: 'Jane Doe', age: 28 },
// { id: 3, name: 'Alice', age: 25 }
// ];
...
...
src/app/mappers/request-mapper.service.ts
View file @
3fb06089
...
...
@@ -24,7 +24,4 @@ export class RequestMapperService {
public
static
readonly
ROUTINE_URL
:
string
=
'
routine
'
;
public
static
readonly
TEST_DRAG_AND_DROP
:
string
=
'
drag-and-drop
'
;
}
src/app/mappers/role-mapper.service.ts
View file @
3fb06089
...
...
@@ -9,7 +9,7 @@ export class RoleMapperService {
// NOTE:: this will be same value which is come from backend role
public
static
readonly
TEACHER_ROLE
:
string
=
'
Teacher
'
;
public
static
readonly
TEACHER_ROLE
:
string
=
'
EDITOR
'
;
public
static
readonly
STUDENT_ROLE
:
string
=
'
Student
'
;
public
static
get
getAllRole
():
string
[]
{
...
...
src/app/mappers/transmission-mapper.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
TransmissionMapperService
}
from
'
./transmission-mapper.service
'
;
describe
(
'
TransmissionMapperService
'
,
()
=>
{
let
service
:
TransmissionMapperService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
TransmissionMapperService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/mappers/transmission-mapper.service.ts
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
@
Injectable
({
providedIn
:
'
root
'
,
providedIn
:
'
root
'
})
export
class
TransmissionMapperService
{
constructor
()
{
}
public
static
readonly
DEV_TRANSMISSION_URL
:
string
=
'
https://magicoweb.com
'
;
...
...
@@ -14,24 +16,31 @@ export class TransmissionMapperService {
public
static
readonly
USER_PROFILE_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/user/get-profile
'
;
public
static
readonly
SCHEDULE_OF_RATES_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/schedule-of-rates/get-all
'
;
public
static
readonly
SCHEDULE_OF_RATES_ADD_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/schedule-of-rates/add
'
;
public
static
readonly
SCHEDULE_OF_RATES_UPDATE_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/schedule-of-rates/update
'
;
public
static
readonly
SCHEDULE_OF_RATE_TYPE_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/schedule-of-rate-type/get-all
'
;
public
static
readonly
AUDIT_LOG_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/entry-log/get
'
;
public
static
readonly
AUDIT_LOG_COUNT_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/entry-log/count
'
;
public
static
readonly
GET_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/getWebDataSourceByWebsiteDataSourceForFilter?
'
;
public
static
readonly
CHARTS_OF_ACCOUNT_TRANSMISION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/chart-of-account/get-all?head_type=income&get_only_head=false&get_nested_preview=true&page=1&page_size=100
'
;
public
static
readonly
SAVE_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/saveWebDataSourceFieldsBasedOnDataSourceType?
'
;
// aggregationOnUniqueFld=false&datasourceId=3188&dontIncludeForeignKey=false&expand=false&isUniqueValueRequiredForFieldToDisplay=false&language=en&limit=10&orderBy=ASC&page=1&user_id=206&roleBasedFiltering=true
// public static readonly SCHEDULE_OF_RATES_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// '/schedule-of-rates/get-all';
// public static readonly SCHEDULE_OF_RATES_ADD_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL + '/schedule-of-rates/add';
// public static readonly SCHEDULE_OF_RATES_UPDATE_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// '/schedule-of-rates/update';
// public static readonly SCHEDULE_OF_RATE_TYPE_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// '/schedule-of-rate-type/get-all';
// public static readonly AUDIT_LOG_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL + '/entry-log/get';
// public static readonly AUDIT_LOG_COUNT_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL + '/entry-log/count';
// public static readonly CHARTS_OF_ACCOUNT_TRANSMISION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// '/chart-of-account/get-all?head_type=income&get_only_head=false&get_nested_preview=true&page=1&page_size=100';
}
src/app/pipe/format-date.pipe.ts
View file @
3fb06089
import
{
Pipe
,
PipeTransform
}
from
"
@angular/core
"
;
import
{
Pipe
,
PipeTransform
}
from
"
@angular/core
"
;
@
Pipe
({
name
:
'
formatDate
'
,
standalone
:
false
})
export
class
FormatDatePipe
implements
PipeTransform
{
transform
(
timestamp
:
number
):
string
{
const
date
=
new
Date
(
timestamp
);
const
day
=
date
.
getDate
();
const
month
=
this
.
getMonthName
(
date
.
getMonth
());
const
year
=
date
.
getFullYear
();
const
ordinalSuffix
=
this
.
getOrdinalSuffix
(
day
);
return
`
${
day
}${
ordinalSuffix
}
${
month
}
,
${
year
}
`
;
}
private
getMonthName
(
month
:
number
):
string
{
const
months
=
[
'
Jan
'
,
'
Feb
'
,
'
Mar
'
,
'
Apr
'
,
'
May
'
,
'
Jun
'
,
'
Jul
'
,
'
Aug
'
,
'
Sep
'
,
'
Oct
'
,
'
Nov
'
,
'
Dec
'
];
return
months
[
month
];
}
private
getOrdinalSuffix
(
day
:
number
):
string
{
const
suffixes
=
[
'
th
'
,
'
st
'
,
'
nd
'
,
'
rd
'
];
const
teenDigits
=
[
11
,
12
,
13
];
const
lastDigit
=
day
%
10
;
if
(
teenDigits
.
includes
(
day
))
{
return
suffixes
[
0
];
}
return
suffixes
[
lastDigit
]
||
suffixes
[
0
];
}
}
src/app/portal/assignment/assignment/assignment.component.html
View file @
3fb06089
<app-custom-table
[columns]=
"columns"
[data]=
"data"
(emitEdit)=
"emitEditFromTable($event)"
(emitView)=
"emitViewFromTable($event)"
/>
<div
class=
"custom_table"
>
<app-custom-table
[columns]=
"columns"
[data]=
"data"
(emitEdit)=
"emitEditFromTable($event)"
(emitView)=
"emitViewFromTable($event)"
/>
</div>
<div
class=
"add_btn"
*ngIf=
"authService.getUserRole() !== 'student'"
>
<app-square-button
[buttonIcon]=
"'add'"
(emitSquareButtonClick)=
"addAssignment()"
/>
</div>
src/app/portal/assignment/assignment/assignment.component.scss
View file @
3fb06089
.add_btn
{
position
:
fixed
;
bottom
:
20px
;
right
:
0
;
padding
:
0px
15px
;
margin
:
auto
;
}
\ No newline at end of file
src/app/portal/assignment/assignment/assignment.component.ts
View file @
3fb06089
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
CustomTableComponent
}
from
'
../../../component-library/custom-table/custom-table.component
'
;
import
{
MatDialog
}
from
'
@angular/material/dialog
'
;
import
{
ManageComponent
}
from
'
../manage/manage.component
'
;
import
{
SquareButtonComponent
}
from
'
../../../component-library/square-button/square-button.component
'
;
import
{
AssignmentTransmissionService
}
from
'
../../../raintree/transmission/assignment-transmission.service
'
;
import
{
AssignmentsResponse
}
from
'
../../../raintree/interface/assignment-respons
'
;
import
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
UrlConfigService
}
from
'
../../service/url-config.service
'
;
import
{
Assignment
}
from
'
../interface/assignment
'
;
import
{
PrepareAssignmentTableDataService
}
from
'
../service/prepare-assignment-table-data.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
@
Component
({
selector
:
'
app-assignment
'
,
imports
:
[
CustomTableComponent
CustomTableComponent
,
CommonModule
,
SquareButtonComponent
],
templateUrl
:
'
./assignment.component.html
'
,
styleUrl
:
'
./assignment.component.scss
'
})
export
class
AssignmentComponent
{
export
class
AssignmentComponent
implements
OnInit
{
constructor
(
private
_dialog
:
MatDialog
,
){}
private
_assignmentTransmission
:
AssignmentTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
,
public
authService
:
AuthService
)
{
}
public
columns
=
[
{
key
:
'
class
'
,
label
:
'
Class
'
},
{
key
:
'
class
_subject_subject_txt
'
,
label
:
'
Class
'
},
{
key
:
'
subject
'
,
label
:
'
Subject
'
},
{
key
:
'
section
'
,
label
:
'
Section
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
public
data
=
[
{
class
:
"
VI
"
,
subject
:
"
Math
"
,
section
:
"
5A
"
,
action
:
[
'
view
'
,
'
edit
'
]
},
{
class
:
"
VI
"
,
subject
:
"
Math
"
,
section
:
"
5B
"
,
action
:
[
'
view
'
,
'
edit
'
]
}
];
public
emitViewFromTable
(
clickedData
:
string
){
public
data
:
any
[]
=
[];
public
ngOnInit
():
void
{
this
.
columns
=
this
.
_prepareAssignmentTableData
.
prepareMatTableColumn
();
this
.
_getAssignments
();
}
private
_getAssignments
():
void
{
this
.
_assignmentTransmission
.
getAssignment
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
ASSIGNMENT_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
100
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
AssignmentsResponse
)
=>
{
this
.
data
=
this
.
_prepareAssignmentTableData
.
prepareMatTableData
(
response
.
data
.
themeDataSourceFields
);
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
public
emitViewFromTable
(
clickedData
:
string
):
void
{
alert
(
"
Have to view the doc in another page
"
);
}
public
emitEditFromTable
(
clicked
Data
:
string
):
void
{
public
emitEditFromTable
(
emit
Data
:
string
):
void
{
// rate ? rate.is_edit_enable = true : '';
console
.
log
(
clickedData
);
let
dialogRef
=
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
clicked
Data
,
data
:
emit
Data
,
width
:
'
98vw
'
,
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
...
...
@@ -62,4 +101,14 @@ export class AssignmentComponent {
// });
}
public
addAssignment
():
void
{
let
dialogRef
=
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
''
,
width
:
'
98vw
'
,
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
maxHeight
:
'
70vh
'
,
});
}
}
src/app/portal/assignment/interface/assignment.ts
0 → 100644
View file @
3fb06089
import
{
Data
}
from
"
../../data-source/interface/data
"
;
import
{
LocalizedField
}
from
"
../../data-source/interface/localizedField
"
;
// ThemeDataSourceField Interface
export
interface
Assignments
extends
Data
{
themeDataSourceFields
:
Assignment
[];
}
// ThemeDataSourceField Interface
export
interface
Assignment
{
session
:
LocalizedField
;
subject
:
LocalizedField
;
assigned_on
:
LocalizedField
;
last_submission_date
:
LocalizedField
;
section
:
LocalizedField
;
docs
:
LocalizedField
;
class_subject
:
LocalizedField
;
session_session_name
:
LocalizedField
;
section_details
:
LocalizedField
;
id
:
string
;
subject_subject_name
:
LocalizedField
;
class_subject_subject_txt
:
LocalizedField
;
}
src/app/portal/assignment/manage/manage.component.html
View file @
3fb06089
<p
>
{{ data }}
</p
>
<p
re>
{{ data | json }}
</pre
>
src/app/portal/assignment/manage/manage.component.ts
View file @
3fb06089
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
MAT_DIALOG_DATA
}
from
'
@angular/material/dialog
'
;
@
Component
({
selector
:
'
app-manage
'
,
imports
:
[],
imports
:
[
CommonModule
],
templateUrl
:
'
./manage.component.html
'
,
styleUrl
:
'
./manage.component.scss
'
})
...
...
src/app/portal/assignment/service/prepare-assignment-table-data.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
PrepareAssignmentTableDataService
}
from
'
./prepare-assignment-table-data.service
'
;
describe
(
'
PrepareAssignmentTableDataService
'
,
()
=>
{
let
service
:
PrepareAssignmentTableDataService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
PrepareAssignmentTableDataService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/portal/assignment/service/prepare-assignment-table-data.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Assignment
}
from
'
../interface/assignment
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
PrepareAssignmentTableDataService
{
constructor
()
{
}
public
prepareMatTableData
(
data
:
Assignment
[]):
any
{
let
dataArray
=
data
.
map
((
assignment
:
Assignment
)
=>
{
return
{
[
'
subject
'
]:
assignment
.
class_subject_subject_txt
[
'
en
'
],
[
'
section_details
'
]:
assignment
.
section_details
[
'
en
'
],
[
'
session_name
'
]:
assignment
.
session_session_name
[
'
en
'
],
[
'
id
'
]:
assignment
.
id
,
[
'
action
'
]:
[
'
view
'
,
'
edit
'
]
}
})
return
dataArray
;
// return [];
}
public
prepareMatTableColumn
():
any
[]
{
let
columnArray
=
[
{
key
:
'
subject
'
,
label
:
'
Subject
'
},
{
key
:
'
section_details
'
,
label
:
'
Subject Details
'
},
{
key
:
'
session_name
'
,
label
:
'
Session Name
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
console
.
log
(
columnArray
);
return
columnArray
;
}
}
src/app/portal/data-source/interface/class.ts
0 → 100644
View file @
3fb06089
import
{
Data
}
from
"
./data
"
;
import
{
LocalizedField
}
from
"
./localizedField
"
;
// ThemeDataSourceField Interface
export
interface
Classes
extends
Data
{
themeDataSourceFields
:
StudentClass
[];
}
// ThemeDataSourceField Interface
export
interface
StudentClass
{
id
:
string
;
className
:
LocalizedField
;
details
:
LocalizedField
;
school
:
LocalizedField
;
}
src/app/portal/data-source/interface/data.ts
0 → 100644
View file @
3fb06089
import
{
ForeignKeyMap
}
from
"
./foreignKeyMap
"
;
// Data Interface
export
interface
Data
{
count
:
number
;
id
:
number
|
string
;
dataSourceName
:
string
;
websiteId
:
number
;
type
:
string
;
foreignKeyMapping
:
any
;
foreignKeyMap
:
ForeignKeyMap
;
requiredPresentationField
:
string
;
favourite
:
boolean
;
icon
:
string
;
dependentFields
:
any
;
dsType
:
any
;
[
index
:
string
]:
any
;
}
\ No newline at end of file
src/app/portal/data-source/interface/foreignKeyListForDataSource.ts
0 → 100644
View file @
3fb06089
// ForeignKeyListForDataSource Interface
export
interface
ForeignKeyListForDataSource
{
fieldName
:
string
;
foreignTableId
:
number
;
presentationFieldPattern
:
any
;
presenterField
:
any
;
isMultiSelect
:
boolean
;
foreignUniqueField
:
any
;
id
:
any
;
remotePresenterField
:
string
;
}
\ No newline at end of file
src/app/portal/data-source/interface/foreignKeyMap.ts
0 → 100644
View file @
3fb06089
import
{
ForeignKeyListForDataSource
}
from
"
./foreignKeyListForDataSource
"
;
export
interface
ForeignKeyMap
{
dataSourceId
:
number
;
foreignKeyListForDataSource
:
ForeignKeyListForDataSource
[];
}
\ No newline at end of file
src/app/portal/data-source/interface/localizedField.ts
0 → 100644
View file @
3fb06089
// LocalizedField Interface (replaces repeated language-specific fields)
export
interface
LocalizedField
{
default
?:
string
;
beng
:
string
;
hindi
:
string
;
en
:
string
;
}
\ No newline at end of file
src/app/portal/data-source/interface/section.ts
0 → 100644
View file @
3fb06089
import
{
Data
}
from
"
./data
"
;
import
{
LocalizedField
}
from
"
./localizedField
"
;
// ThemeDataSourceField Interface
export
interface
Sections
extends
Data
{
themeDataSourceFields
:
StudentSection
[];
}
// ThemeDataSourceField Interface
export
interface
StudentSection
{
id
:
string
;
class
:
LocalizedField
;
section
:
LocalizedField
;
class_teacher
:
LocalizedField
;
details
:
LocalizedField
;
class_details
:
LocalizedField
;
class_teacher_name
:
LocalizedField
;
}
src/app/portal/exam/exam/exam.component.html
View file @
3fb06089
<p>
exam works!
</p>
<div
class=
"custom_table"
>
<app-custom-table
[columns]=
"columns"
[data]=
"data"
(emitEdit)=
"emitEditFromTable($event)"
(emitView)=
"emitViewFromTable($event)"
/>
</div>
<div
class=
"add_btn"
>
<app-square-button
[buttonIcon]=
"'add'"
(emitSquareButtonClick)=
"addExam()"
/>
</div>
\ No newline at end of file
src/app/portal/exam/exam/exam.component.scss
View file @
3fb06089
.add_btn
{
position
:
fixed
;
bottom
:
20px
;
right
:
0
;
padding
:
0px
15px
;
margin
:
auto
;
}
\ No newline at end of file
src/app/portal/exam/exam/exam.component.ts
View file @
3fb06089
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
}
from
'
@angular/core
'
;
import
{
CustomTableComponent
}
from
'
../../../component-library/custom-table/custom-table.component
'
;
import
{
SquareButtonComponent
}
from
'
../../../component-library/square-button/square-button.component
'
;
import
{
MatDialog
}
from
'
@angular/material/dialog
'
;
import
{
ManageComponent
}
from
'
../manage/manage.component
'
;
import
{
ExamScheduleService
}
from
'
../../../raintree/transmission/exam-schedule.service
'
;
import
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
UrlConfigService
}
from
'
../../service/url-config.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
PrepareExamTableDataService
}
from
'
../service/prepare-exam-table-data.service
'
;
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
@
Component
({
selector
:
'
app-exam
'
,
imports
:
[],
imports
:
[
CommonModule
,
CustomTableComponent
,
SquareButtonComponent
],
templateUrl
:
'
./exam.component.html
'
,
styleUrl
:
'
./exam.component.scss
'
})
export
class
ExamComponent
{
constructor
(
private
_dialog
:
MatDialog
,
private
_examSchedule
:
ExamScheduleService
,
private
_urlConfig
:
UrlConfigService
,
private
_prepareExamTableData
:
PrepareExamTableDataService
)
{
}
public
columns
:
any
=
[];
public
data
:
any
=
[];
ngOnInit
():
void
{
this
.
columns
=
this
.
_prepareExamTableData
.
prepareMatTableColumn
();
this
.
_getExamSchedule
();
}
public
emitViewFromTable
(
emitData
:
any
)
{
let
docLink
=
emitData
.
image
.
replace
(
'
BASE_URL
'
,
TransmissionMapperService
.
DEV_TRANSMISSION_URL
);
window
.
open
(
docLink
,
'
_blank
'
);
}
private
matModalConfig
=
{
width
:
'
98vw
'
,
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
maxHeight
:
'
70vh
'
,
}
public
emitEditFromTable
(
emitData
:
string
):
void
{
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
emitData
,
...
this
.
matModalConfig
});
}
public
addExam
():
void
{
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
''
,
...
this
.
matModalConfig
});
}
private
_getExamSchedule
():
void
{
this
.
_examSchedule
.
getExamSchedule
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
EXAM_SCHEDULE_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
10
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
data
=
this
.
_prepareExamTableData
.
prepareMatTableData
(
response
[
'
data
'
].
themeDataSourceFields
);
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
}
src/app/portal/exam/interface/exam-schedule.ts
0 → 100644
View file @
3fb06089
import
{
RaintreeResponse
}
from
"
../../../raintree/interface/raintree-response
"
;
import
{
Data
}
from
"
../../data-source/interface/data
"
;
import
{
LocalizedField
}
from
"
../../data-source/interface/localizedField
"
;
// ThemeDataSourceField Interface
export
interface
ExamSchedules
extends
Data
{
themeDataSourceFields
:
ExamSchedule
[];
}
// ThemeDataSourceField Interface
export
interface
ExamSchedule
{
id
:
string
;
session
:
LocalizedField
;
Term
:
LocalizedField
;
image
:
LocalizedField
;
details
:
LocalizedField
;
class
:
LocalizedField
;
session_session_name
:
LocalizedField
;
class_details
:
LocalizedField
;
}
src/app/portal/exam/manage/manage.component.html
View file @
3fb06089
<p
>
manage works!
</p
>
<p
re>
{{data|json}}
</pre
>
\ No newline at end of file
src/app/portal/exam/manage/manage.component.ts
View file @
3fb06089
import
{
Component
}
from
'
@angular/core
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
MAT_DIALOG_DATA
}
from
'
@angular/material/dialog
'
;
@
Component
({
selector
:
'
app-manage
'
,
imports
:
[],
imports
:
[
CommonModule
],
templateUrl
:
'
./manage.component.html
'
,
styleUrl
:
'
./manage.component.scss
'
})
export
class
ManageComponent
{
constructor
(
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
,
)
{
}
}
src/app/portal/exam/service/prepare-exam-table-data.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
PrepareExamTableDataService
}
from
'
./prepare-exam-table-data.service
'
;
describe
(
'
PrepareExamTableDataService
'
,
()
=>
{
let
service
:
PrepareExamTableDataService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
PrepareExamTableDataService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/portal/exam/service/prepare-exam-table-data.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
ExamSchedule
}
from
'
../interface/exam-schedule
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
PrepareExamTableDataService
{
constructor
()
{
}
public
prepareMatTableData
(
data
:
ExamSchedule
[]):
any
{
let
dataArray
=
data
.
map
((
schedule
:
ExamSchedule
)
=>
{
return
{
[
'
id
'
]:
schedule
.
id
,
[
'
Term
'
]:
schedule
.
Term
[
'
en
'
],
[
'
image
'
]:
schedule
.
image
[
'
en
'
],
[
'
details
'
]:
schedule
.
details
[
'
en
'
],
[
'
class_details
'
]:
schedule
.
class_details
[
'
en
'
],
[
'
action
'
]:
[
'
view
'
,
'
edit
'
]
}
})
return
dataArray
;
}
public
prepareMatTableColumn
():
any
[]
{
let
columnArray
=
[
{
key
:
'
Term
'
,
label
:
'
Term
'
},
{
key
:
'
details
'
,
label
:
'
Details
'
},
{
key
:
'
class_details
'
,
label
:
'
Class
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
return
columnArray
;
}
}
src/app/portal/navigation/service/logout.service.ts
View file @
3fb06089
...
...
@@ -20,7 +20,7 @@ export class LogoutService {
}
public
logout
():
void
{
public
logout
(
message
:
string
=
'
Successfully Logged out
'
):
void
{
if
(
this
.
isBrowser
)
{
...
...
@@ -30,7 +30,7 @@ export class LogoutService {
this
.
_router
.
navigate
([
RequestMapperService
.
LOGIN_URL
]).
then
(()
=>
{
// window.location.reload();
this
.
_toaster
.
success
(
'
Successfully Logged out
'
,
'
Ok
'
);
this
.
_toaster
.
success
(
message
,
'
Ok
'
);
});
}
}
...
...
src/app/portal/navigation/sidebar/sidebar.component.scss
View file @
3fb06089
...
...
@@ -3,7 +3,7 @@
flex-direction
:
column
;
height
:
100%
;
justify-content
:
space-between
;
position
:
relative
;
//
position: relative;
}
.sidebar_navigation_container
a
{
...
...
@@ -85,8 +85,9 @@
}
.theme_mode_changer
{
position
:
absolute
;
position
:
fixed
;
bottom
:
0
;
transform
:
translate
(
50px
,
-30px
);
}
@media
only
screen
and
(
max-width
:
999px
)
and
(
min-width
:
300px
)
{
...
...
src/app/portal/navigation/topbar/topbar.component.html
View file @
3fb06089
...
...
@@ -30,7 +30,7 @@
{{userProfileInformation.name}}
<span
class=
"material-symbols-outlined"
>
keyboard_arrow_down
</span>
</p>
<p
class=
"user_role"
>
{{userProfileInformation.
user_typ
e}}
</p>
<p
class=
"user_role"
>
{{userProfileInformation.
role_nam
e}}
</p>
</div>
</div>
...
...
src/app/portal/routine/interface/routine.ts
0 → 100644
View file @
3fb06089
import
{
Data
}
from
"
../../data-source/interface/data
"
;
import
{
LocalizedField
}
from
"
../../data-source/interface/localizedField
"
;
// ThemeDataSourceField Interface
export
interface
Routines
extends
Data
{
themeDataSourceFields
:
Routine
[];
dataSourceTypeFieldsList
?:
Routine
[]
}
// ThemeDataSourceField Interface
export
interface
Routine
{
id
:
string
;
class
:
LocalizedField
;
section
:
LocalizedField
;
schedule
:
LocalizedField
;
details
:
LocalizedField
;
session
:
LocalizedField
;
document
:
LocalizedField
;
routine_type
:
LocalizedField
;
session_session_name
?:
LocalizedField
;
class_details
?:
LocalizedField
;
section_details
?:
LocalizedField
;
}
src/app/portal/routine/manage/manage.component.html
View file @
3fb06089
<p>
manage works!
</p>
<!-- <h1> Hi Manage </h1> -->
<form
class=
"login_form"
[formGroup]=
"routineForm"
>
<div
class=
"mat_input_container"
>
<div
class=
"class_dropdown"
>
<app-drop-down
[dropDownData] =
"classDropDownData"
(emitDropDownData)=
"classOnChange($event)"
/>
</div>
<div
class=
"section_dropdown"
>
<app-drop-down
[dropDownData] =
"sectionDropDownData"
(emitDropDownData)=
"sectionOnChange($event)"
/>
</div>
<div
class=
"details_field"
>
<mat-form-field
class=
"full_width"
>
<span
class=
"material-symbols-outlined"
matPrefix
>
person
</span>
<input
matInput
placeholder=
"{{ 'Enter details' }}"
#input
formControlName=
"details"
/>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<mat-form-field
style=
"width: 100%;"
>
<mat-label>
Schedule
</mat-label>
<button
mat-icon-button
matPrefix
(click)=
"f_input.click()"
>
<mat-icon>
attach_file
</mat-icon>
</button>
<input
type=
"text"
readonly
matInput
/>
<input
type=
"file"
multiple
hidden
#f_input
/>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<div
class=
"add_btn"
>
<app-square-button
[buttonIcon]=
"''"
[buttonText]=
"'submit'"
(emitSquareButtonClick)=
"submitRoutine()"
/>
</div>
</form>
\ No newline at end of file
src/app/portal/routine/manage/manage.component.ts
View file @
3fb06089
import
{
Component
}
from
'
@angular/core
'
;
import
{
CommonModule
}
from
"
@angular/common
"
;
import
{
Component
,
Inject
}
from
"
@angular/core
"
;
import
{
MAT_DIALOG_DATA
}
from
"
@angular/material/dialog
"
;
import
{
ClassTransmissionService
}
from
"
../../../raintree/transmission/class-transmission.service
"
;
import
{
TransmissionMapperService
}
from
"
../../../mappers/transmission-mapper.service
"
;
import
{
DataSourceService
}
from
"
../../service/data-source.service
"
;
import
{
classResponse
}
from
"
../../../raintree/interface/class-respons
"
;
import
{
UrlConfigService
}
from
"
../../service/url-config.service
"
;
import
{
DropDownComponent
}
from
"
../../../component-library/dropdown/drop-down/drop-down.component
"
;
import
{
Dropdown
}
from
"
../../../component-library/dropdown/interface/dropdown
"
;
import
{
StudentClass
}
from
"
../../data-source/interface/class
"
;
import
{
FormControl
,
FormControlName
,
FormGroup
,
ReactiveFormsModule
,
Validators
,
}
from
"
@angular/forms
"
;
import
{
MatFormFieldModule
}
from
"
@angular/material/form-field
"
;
import
{
MatInputModule
}
from
"
@angular/material/input
"
;
import
{
MatIconModule
}
from
"
@angular/material/icon
"
;
import
{
SquareButtonComponent
}
from
"
../../../component-library/square-button/square-button.component
"
;
import
{
SectionResponse
}
from
"
../../../raintree/interface/section-respons
"
;
import
{
StudentSection
}
from
"
../../data-source/interface/section
"
;
import
{
RoutineTransmissionService
}
from
"
../../../raintree/transmission/routine-transmission.service
"
;
import
{
AuthService
}
from
"
../../../auth/service/auth.service
"
;
import
{
RaintreeResponse
}
from
"
../../../raintree/interface/raintree-response
"
;
import
{
Routines
}
from
"
../interface/routine
"
;
import
{
ForeignKeyMap
}
from
"
../../data-source/interface/foreignKeyMap
"
;
@
Component
({
selector
:
'
app-manage
'
,
imports
:
[],
templateUrl
:
'
./manage.component.html
'
,
styleUrl
:
'
./manage.component.scss
'
selector
:
"
app-manage
"
,
imports
:
[
CommonModule
,
DropDownComponent
,
ReactiveFormsModule
,
MatFormFieldModule
,
MatInputModule
,
MatIconModule
,
SquareButtonComponent
,
],
templateUrl
:
"
./manage.component.html
"
,
styleUrl
:
"
./manage.component.scss
"
,
})
export
class
ManageComponent
{
constructor
(
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
,
private
_classTransmission
:
ClassTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_routineTransmission
:
RoutineTransmissionService
,
private
_auth
:
AuthService
)
{}
public
classDropDownData
:
Dropdown
[]
=
[];
public
sectionDropDownData
:
Dropdown
[]
=
[];
public
routineForm
=
new
FormGroup
({
details
:
new
FormControl
(
""
,
[
Validators
.
required
]),
});
ngOnInit
():
void
{
this
.
_getClasses
();
this
.
_getSection
();
}
public
classOnChange
(
value
:
string
)
{
console
.
log
(
value
);
}
public
sectionOnChange
(
value
:
string
)
{
console
.
log
(
value
);
}
public
submitRoutine
():
void
{
// alert("Submit Clicked!!");
// console.log(this.routineFormPayload);
console
.
log
(
this
.
routineForm
.
value
)
// this._routineTransmission.submitRoutine(
// TransmissionMapperService.SAVE_TRANSMISSION_URL + `websiteId=${this._auth.localStorageGetItemByKey('project_id')}`,
// this.routineFormPayload,
// () => { },
// () => { },
// (response: RaintreeResponse) => {
// console.log(response);
// },
// (error) => {
// console.log(error);
// },
// () => { }
// );
}
private
_getClasses
()
{
this
.
_classTransmission
.
getClasses
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
CLASS_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
100
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
,
}),
()
=>
{},
(
response
)
=>
{},
(
response
:
classResponse
)
=>
{
this
.
classDropDownData
=
response
.
data
[
"
themeDataSourceFields
"
].
map
(
(
sClass
:
StudentClass
)
=>
{
return
{
[
"
name
"
]:
sClass
.
details
[
"
en
"
],
[
"
value
"
]:
sClass
.
id
,
};
}
);
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{}
);
}
private
_getSection
()
{
this
.
_classTransmission
.
getSection
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
SECTION_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
100
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
,
}),
()
=>
{},
(
response
)
=>
{},
(
response
:
SectionResponse
)
=>
{
this
.
sectionDropDownData
=
response
.
data
[
"
themeDataSourceFields
"
].
map
(
(
sSection
:
StudentSection
)
=>
{
return
{
[
"
name
"
]:
sSection
.
section
[
"
en
"
],
[
"
value
"
]:
sSection
.
id
,
};
}
);
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{}
);
}
private
routineFormPayload
:
Routines
=
{
themeDataSourceFields
:
[
{
id
:
""
,
class
:
{
en
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
beng
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
hindi
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
},
section
:
{
en
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
beng
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
hindi
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
},
schedule
:
{
en
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
beng
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
hindi
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
},
details
:
{
en
:
"
test 1 c
"
,
beng
:
"
test 1 c
"
,
hindi
:
"
test 1 c
"
,
},
session
:
{
en
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
beng
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
hindi
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
},
document
:
{
en
:
""
,
beng
:
""
,
hindi
:
""
,
},
routine_type
:
{
en
:
"
class_routine
"
,
beng
:
"
class_routine
"
,
hindi
:
"
class_routine
"
,
},
},
],
dataSourceName
:
"
Routine
"
,
id
:
"
3021
"
,
type
:
"
1327
"
,
themeId
:
"
278
"
,
slideLst
:
null
,
heading
:
"
undefined
"
,
dataSourceTypeFieldsList
:
[
{
id
:
""
,
class
:
{
en
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
beng
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
hindi
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
},
section
:
{
en
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
beng
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
hindi
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
},
schedule
:
{
en
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
beng
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
hindi
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
},
details
:
{
en
:
"
test 1 c
"
,
beng
:
"
test 1 c
"
,
hindi
:
"
test 1 c
"
,
},
session
:
{
en
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
beng
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
hindi
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
},
document
:
{
en
:
""
,
beng
:
""
,
hindi
:
""
,
},
routine_type
:
{
en
:
"
class_routine
"
,
beng
:
"
class_routine
"
,
hindi
:
"
class_routine
"
,
},
},
],
count
:
10
,
websiteId
:
1
,
foreignKeyMapping
:
{},
foreignKeyMap
:
{}
as
ForeignKeyMap
,
requiredPresentationField
:
""
,
favourite
:
true
,
icon
:
""
,
dependentFields
:
{},
dsType
:
{}
};
}
src/app/portal/routine/routine/routine.component.html
View file @
3fb06089
<p>
routine works!
</p>
<div
class=
"custom_table"
>
<app-custom-table
[columns]=
"columns"
[data]=
"data"
(emitEdit)=
"emitEditFromTable($event)"
(emitView)=
"emitViewFromTable($event)"
/>
</div>
<div
class=
"add_btn"
>
<app-square-button
[buttonIcon]=
"'add'"
(emitSquareButtonClick)=
"addRoutine()"
/>
</div>
\ No newline at end of file
src/app/portal/routine/routine/routine.component.scss
View file @
3fb06089
.add_btn
{
position
:
fixed
;
bottom
:
20px
;
right
:
0
;
padding
:
0px
15px
;
margin
:
auto
;
}
\ No newline at end of file
src/app/portal/routine/routine/routine.component.ts
View file @
3fb06089
import
{
Component
}
from
'
@angular/core
'
;
import
{
RoutineTransmissionService
}
from
'
../../../raintree/transmission/routine-transmission.service
'
;
import
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
RoutineResponse
}
from
'
../../../raintree/interface/routine-respons
'
;
import
{
UrlConfigService
}
from
'
../../service/url-config.service
'
;
import
{
CustomTableComponent
}
from
'
../../../component-library/custom-table/custom-table.component
'
;
import
{
SquareButtonComponent
}
from
'
../../../component-library/square-button/square-button.component
'
;
import
{
MatDialog
}
from
'
@angular/material/dialog
'
;
import
{
ManageComponent
}
from
'
../manage/manage.component
'
;
import
{
PrepareRoutineTableDataService
}
from
'
../service/prepare-routine-table-data.service
'
;
@
Component
({
selector
:
'
app-routine
'
,
imports
:
[],
standalone
:
true
,
imports
:
[
CustomTableComponent
,
SquareButtonComponent
],
templateUrl
:
'
./routine.component.html
'
,
styleUrl
:
'
./routine.component.scss
'
})
export
class
RoutineComponent
{
constructor
(
private
_routineTransmission
:
RoutineTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_dialog
:
MatDialog
,
private
_prepareRoutineTableData
:
PrepareRoutineTableDataService
)
{
}
public
columns
:
any
[]
=
[];
public
data
:
any
[]
=
[];
ngOnInit
():
void
{
this
.
columns
=
this
.
_prepareRoutineTableData
.
prepareMatTableColumn
();
this
.
_getRoutines
();
}
public
addRoutine
():
void
{
let
dialogRef
=
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
''
,
width
:
'
98vw
'
,
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
maxHeight
:
'
70vh
'
,
});
}
public
emitViewFromTable
(
emitData
:
any
)
{
let
docLink
=
emitData
.
schedule
.
replace
(
'
BASE_URL
'
,
TransmissionMapperService
.
DEV_TRANSMISSION_URL
);
window
.
open
(
docLink
,
'
_blank
'
);
}
public
emitEditFromTable
(
emitData
:
string
):
void
{
let
dialogRef
=
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
emitData
,
width
:
'
98vw
'
,
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
maxHeight
:
'
70vh
'
,
});
}
private
_getRoutines
():
void
{
this
.
_routineTransmission
.
getRoutine
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
ROUTINE_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
10
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
RoutineResponse
)
=>
{
this
.
data
=
this
.
_prepareRoutineTableData
.
prepareMatTableData
(
response
.
data
.
themeDataSourceFields
);
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
}
src/app/portal/routine/service/prepare-routine-table-data.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
PrepareRoutineTableDataService
}
from
'
./prepare-routine-table-data.service
'
;
describe
(
'
PrepareRoutineTableDataService
'
,
()
=>
{
let
service
:
PrepareRoutineTableDataService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
PrepareRoutineTableDataService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/portal/routine/service/prepare-routine-table-data.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Routine
}
from
'
../interface/routine
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
PrepareRoutineTableDataService
{
constructor
()
{
}
public
prepareMatTableData
(
data
:
Routine
[]):
any
{
let
dataArray
=
data
.
map
((
routine
:
Routine
)
=>
{
return
{
[
'
id
'
]:
routine
.
id
,
[
'
session_session_name
'
]:
routine
.
session_session_name
?[
'
en
'
]:
''
,
[
'
class_details
'
]:
routine
.
class_details
?[
'
en
'
]:
''
,
[
'
section_details
'
]:
routine
.
section_details
?[
'
en
'
]:
''
,
[
'
schedule
'
]:
routine
.
schedule
[
'
en
'
],
[
'
action
'
]:
[
'
view
'
,
'
edit
'
]
}
})
return
dataArray
;
}
public
prepareMatTableColumn
():
any
[]
{
let
columnArray
=
[
{
key
:
'
session_session_name
'
,
label
:
'
Session
'
},
{
key
:
'
class_details
'
,
label
:
'
Class
'
},
{
key
:
'
section_details
'
,
label
:
'
Section
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
return
columnArray
;
}
}
src/app/portal/service/data-source.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
DataSourceService
}
from
'
./data-source.service
'
;
describe
(
'
DataSourceService
'
,
()
=>
{
let
service
:
DataSourceService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
DataSourceService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/portal/service/data-source.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
DataSourceService
{
constructor
()
{
}
public
static
readonly
ASSIGNMENT_DATA_SOURCE_ID
:
number
=
3188
;
public
static
readonly
ROUTINE_DATA_SOURCE_ID
:
number
=
3021
;
public
static
readonly
CLASS_DATA_SOURCE_ID
:
number
=
3008
;
public
static
readonly
SECTION_DATA_SOURCE_ID
:
number
=
3013
;
public
static
readonly
EXAM_SCHEDULE_DATA_SOURCE_ID
:
number
=
3018
;
}
src/app/portal/service/url-config.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
UrlConfigService
}
from
'
./url-config.service
'
;
describe
(
'
UrlConfigService
'
,
()
=>
{
let
service
:
UrlConfigService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
UrlConfigService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/portal/service/url-config.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
UrlConfigService
{
constructor
()
{}
public
generateDatasourceConfigUrl
(
obj
:
any
):
string
{
return
Object
.
entries
(
obj
)
.
map
(([
key
,
value
])
=>
`
${
key
}
=
${
encodeURIComponent
(
value
as
string
|
number
|
boolean
)}
`
)
.
join
(
'
&
'
);
}
}
src/app/raintree/error-handler.service.ts
View file @
3fb06089
...
...
@@ -12,12 +12,12 @@ export class ErrorHandlerService {
public
handle
(
error
:
number
):
void
{
if
(
error
===
401
)
this
.
_handle401Error
(
error
);
if
(
error
===
401
||
error
===
400
)
this
.
_handle401Error
(
error
);
else
if
(
error
===
422
)
this
.
_handle422Error
(
error
);
}
private
_handle401Error
(
error
:
number
):
void
{
this
.
_logoutService
.
logout
();
this
.
_logoutService
.
logout
(
'
Session expired !
'
);
}
private
_handle422Error
(
error
:
number
):
void
{
...
...
src/app/raintree/interface/assignment-respons.ts
0 → 100644
View file @
3fb06089
import
{
Assignments
}
from
"
../../portal/assignment/interface/assignment
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
AssignmentsResponse
extends
RaintreeResponse
{
data
:
Assignments
;
}
\ No newline at end of file
src/app/raintree/interface/auth-response.ts
View file @
3fb06089
import
{
Jwt
}
from
"
./jwt
"
;
import
{
UserProfile
}
from
"
../../auth/interface/user-profile
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
AUthResponse
extends
RaintreeResponse
{
data
:
Jwt
;
data
:
UserProfile
;
}
src/app/raintree/interface/class-respons.ts
0 → 100644
View file @
3fb06089
import
{
Classes
}
from
"
../../portal/data-source/interface/class
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
classResponse
extends
RaintreeResponse
{
data
:
Classes
;
}
\ No newline at end of file
src/app/raintree/interface/exam-schedule-respons.ts
0 → 100644
View file @
3fb06089
import
{
ExamSchedules
}
from
"
../../portal/exam/interface/exam-schedule
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
ExamScheduleResponse
extends
RaintreeResponse
{
data
:
ExamSchedules
}
\ No newline at end of file
src/app/raintree/interface/raintree-response.ts
View file @
3fb06089
export
interface
RaintreeResponse
{
[
index
:
string
]:
any
;
status_code
:
number
;
message
:
string
;
[
index
:
string
]:
any
;
}
src/app/raintree/interface/response-count-response.ts
deleted
100644 → 0
View file @
9cc07e50
import
{
ResponseCount
}
from
"
../../component-library/audit-log/interface/response-count
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
ResponseCountResponse
extends
RaintreeResponse
{
data
:
ResponseCount
;
}
src/app/raintree/interface/routine-respons.ts
0 → 100644
View file @
3fb06089
import
{
Routines
}
from
"
../../portal/routine/interface/routine
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
RoutineResponse
extends
RaintreeResponse
{
data
:
Routines
}
\ No newline at end of file
src/app/raintree/interface/section-respons.ts
0 → 100644
View file @
3fb06089
import
{
Sections
}
from
"
../../portal/data-source/interface/section
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
SectionResponse
extends
RaintreeResponse
{
data
:
Sections
;
}
\ No newline at end of file
src/app/raintree/transmission/assignment-transmission.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
AssignmentTransmissionService
}
from
'
./assignment-transmission.service
'
;
describe
(
'
AssignmentTransmissionService
'
,
()
=>
{
let
service
:
AssignmentTransmissionService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
AssignmentTransmissionService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/assignment-transmission.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
import
{
AssignmentsResponse
}
from
'
../interface/assignment-respons
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
AssignmentTransmissionService
extends
TransmissionService
{
public
getAssignment
(
url
:
string
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
):
void
{
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
}
src/app/raintree/transmission/auth-transmission.service.ts
View file @
3fb06089
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
HttpErrorHandlerService
}
from
'
../http-error-handler.service
'
;
import
{
JWTService
}
from
'
./jwt.service
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
Auth
}
from
'
../../auth/interface/auth
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
import
{
UserProfileResponse
}
from
'
../interface/user-profile-response
'
;
import
{
UserProfile
}
from
'
../../auth/interface/user-profile
'
;
import
{
ErrorHandlerService
}
from
'
../error-handler.service
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
AuthTransmissionService
extends
TransmissionService
{
constructor
(
_http
:
HttpClient
,
_httpErrorHandler
:
HttpErrorHandlerService
,
_jwt
:
JWTService
,
_errorHandler
:
ErrorHandlerService
)
{
super
(
_http
,
_httpErrorHandler
,
_jwt
,
_errorHandler
);
}
public
getAuthToken
(
url
:
string
,
...
...
src/app/raintree/transmission/class-transmission.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
ClassTransmissionService
}
from
'
./class-transmission.service
'
;
describe
(
'
ClassTransmissionService
'
,
()
=>
{
let
service
:
ClassTransmissionService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
ClassTransmissionService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/class-transmission.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
ClassTransmissionService
extends
TransmissionService
{
public
getClasses
(
url
:
string
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
):
void
{
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
public
getSection
(
url
:
string
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
){
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
}
src/app/raintree/transmission/exam-schedule.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
ExamScheduleService
}
from
'
./exam-schedule.service
'
;
describe
(
'
ExamScheduleService
'
,
()
=>
{
let
service
:
ExamScheduleService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
ExamScheduleService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/exam-schedule.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
ExamScheduleService
extends
TransmissionService
{
public
getExamSchedule
(
url
:
string
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
RaintreeResponse
)
=>
void
,
onSuccess
:
(
response
:
RaintreeResponse
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
):
void
{
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
}
src/app/raintree/transmission/jwt.service.ts
View file @
3fb06089
import
{
HttpHeaders
}
from
'
@angular/common/http
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
AuthService
}
from
'
../../auth/service/auth.service
'
;
@
Injectable
({
providedIn
:
'
root
'
,
})
export
class
JWTService
{
constructor
()
{}
constructor
(
private
_auth
:
AuthService
)
{}
private
_jwtToken
:
string
|
null
=
null
;
private
_expirationDate
:
Date
|
null
=
null
;
...
...
@@ -13,11 +16,12 @@ export class JWTService {
public
injectToken
(
token
:
string
):
HttpHeaders
{
let
authorizationToken
:
string
=
localStorage
.
getItem
(
'
Bearer
'
)
||
''
;
let
userId
=
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
);
// TODO: check if token exist in Local storage and handle accordingly
return
new
HttpHeaders
({
Authorization
:
`Bearer
${
authorizationToken
}
`
,
"
user-id
"
:
userId
,
"
apikey
"
:
authorizationToken
,
'
Content-Type
'
:
'
application/json
'
,
});
}
...
...
src/app/raintree/transmission/routine-transmission.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
RoutineTransmissionService
}
from
'
./routine-transmission.service
'
;
describe
(
'
RoutineTransmissionService
'
,
()
=>
{
let
service
:
RoutineTransmissionService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
RoutineTransmissionService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/routine-transmission.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
RoutineTransmissionService
extends
TransmissionService
{
public
getRoutine
(
url
:
string
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
):
void
{
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
public
submitRoutine
(
url
:
string
,
payload
:
any
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
){
this
.
executePostPayload
(
url
,
payload
,
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
}
src/app/raintree/transmission/section-transmission.service.spec.ts
0 → 100644
View file @
3fb06089
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
SectionTransmissionService
}
from
'
./section-transmission.service
'
;
describe
(
'
SectionTransmissionService
'
,
()
=>
{
let
service
:
SectionTransmissionService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
SectionTransmissionService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/section-transmission.service.ts
0 → 100644
View file @
3fb06089
import
{
Injectable
}
from
'
@angular/core
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
SectionTransmissionService
{
constructor
()
{
}
}
src/app/raintree/transmission/transmission.service.ts
View file @
3fb06089
...
...
@@ -5,6 +5,8 @@ import { catchError } from 'rxjs/operators';
import
{
HttpErrorHandlerService
}
from
'
../http-error-handler.service
'
;
import
{
JWTService
}
from
'
./jwt.service
'
;
import
{
ErrorHandlerService
}
from
'
../error-handler.service
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
RequestMapperService
}
from
'
../../mappers/request-mapper.service
'
;
@
Injectable
({
providedIn
:
'
root
'
,
...
...
@@ -14,7 +16,7 @@ export class TransmissionService {
private
_http
:
HttpClient
,
private
_httpErrorHandler
:
HttpErrorHandlerService
,
private
_jwt
:
JWTService
,
private
_errorHandler
:
ErrorHandlerService
private
_errorHandler
:
ErrorHandlerService
,
)
{}
public
executeBasicGet
(
...
...
@@ -103,13 +105,13 @@ export class TransmissionService {
if
(
response
.
status_code
)
onSuccess
(
response
);
// else
// onFailure(
// isEmptyString(response.message)
// ? MessageService.RESOURCE_VALIDATION_FAILED
// : response.message
// );
},
(
error
)
=>
{
onFailure
(
error
);
// TODO:handle 401 and 422 error
this
.
_errorHandler
.
handle
(
error
);
onComplete
();
},
()
=>
onComplete
()
...
...
src/styles.scss
View file @
3fb06089
@
import
"./app/style-guide/css/theme.scss"
;
// main theme
@
use
"./app/style-guide/css/theme.scss"
;
// main theme
.material-symbols-outlined
{
font-variation-settings
:
"FILL"
0
,
"wght"
300
,
"GRAD"
0
,
"opsz"
24
;
...
...
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