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
b18b2f83
Commit
b18b2f83
authored
Mar 26, 2025
by
achinta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: routine and fix user_id
parent
daddc8c2
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
363 additions
and
180 deletions
+363
-180
src/app/app.routes.ts
src/app/app.routes.ts
+14
-14
src/app/auth/service/auth.service.ts
src/app/auth/service/auth.service.ts
+11
-3
src/app/component-library/custom-table/custom-table.component.scss
...omponent-library/custom-table/custom-table.component.scss
+5
-0
src/app/mappers/request-mapper.service.ts
src/app/mappers/request-mapper.service.ts
+0
-1
src/app/mappers/transmission-mapper.service.ts
src/app/mappers/transmission-mapper.service.ts
+1
-1
src/app/portal/assignment/assignment/assignment.component.ts
src/app/portal/assignment/assignment/assignment.component.ts
+39
-134
src/app/portal/assignment/service/prepare-assignment-table-data.service.ts
...signment/service/prepare-assignment-table-data.service.ts
+4
-4
src/app/portal/routine/interface/routine.ts
src/app/portal/routine/interface/routine.ts
+23
-0
src/app/portal/routine/manage/manage.component.html
src/app/portal/routine/manage/manage.component.html
+1
-1
src/app/portal/routine/manage/manage.component.ts
src/app/portal/routine/manage/manage.component.ts
+10
-2
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
+87
-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
+41
-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
+13
-0
src/app/raintree/interface/raintree-response.ts
src/app/raintree/interface/raintree-response.ts
+1
-1
src/app/raintree/interface/routine-respons.ts
src/app/raintree/interface/routine-respons.ts
+6
-0
src/app/raintree/transmission/assignment-transmission.service.ts
.../raintree/transmission/assignment-transmission.service.ts
+3
-14
src/app/raintree/transmission/jwt.service.ts
src/app/raintree/transmission/jwt.service.ts
+6
-3
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
+28
-0
No files found.
src/app/app.routes.ts
View file @
b18b2f83
...
...
@@ -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/service/auth.service.ts
View file @
b18b2f83
...
...
@@ -22,14 +22,13 @@ 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
this
.
_router
.
navigate
([
RequestMapperService
.
PORTAL_URL
]);
}
}
...
...
@@ -38,4 +37,13 @@ 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
];
}
}
src/app/component-library/custom-table/custom-table.component.scss
View file @
b18b2f83
// @media only screen and (max-width: 999px) and (min-width: 300px) {
// .mat-mdc-header-row{
// }
// }
\ No newline at end of file
src/app/mappers/request-mapper.service.ts
View file @
b18b2f83
...
...
@@ -23,5 +23,4 @@ export class RequestMapperService {
public
static
readonly
EXAM_URL
:
string
=
'
exam
'
;
public
static
readonly
ROUTINE_URL
:
string
=
'
routine
'
;
}
src/app/mappers/transmission-mapper.service.ts
View file @
b18b2f83
...
...
@@ -17,7 +17,7 @@ export class TransmissionMapperService {
public
static
readonly
USER_PROFILE_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/user/get-profile
'
;
public
static
readonly
ASSIGNMEN
T_TRANSMISSION_URL
:
string
=
public
static
readonly
GE
T_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/getWebDataSourceByWebsiteDataSourceForFilter?
'
;
// aggregationOnUniqueFld=false&datasourceId=3188&dontIncludeForeignKey=false&expand=false&isUniqueValueRequiredForFieldToDisplay=false&language=en&limit=10&orderBy=ASC&page=1&user_id=206&roleBasedFiltering=true
...
...
src/app/portal/assignment/assignment/assignment.component.ts
View file @
b18b2f83
...
...
@@ -9,13 +9,14 @@ import { TransmissionMapperService } from '../../../mappers/transmission-mapper.
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
'
;
@
Component
({
selector
:
'
app-assignment
'
,
imports
:
[
CustomTableComponent
,
SquareButtonComponent
],
],
templateUrl
:
'
./assignment.component.html
'
,
styleUrl
:
'
./assignment.component.scss
'
})
...
...
@@ -23,10 +24,10 @@ import { PrepareAssignmentTableDataService } from '../service/prepare-assignment
export
class
AssignmentComponent
{
constructor
(
private
_dialog
:
MatDialog
,
private
_assignmentTransmission
Service
:
AssignmentTransmissionService
,
private
_urlConfig
Service
:
UrlConfigService
,
private
_assignmentTransmission
:
AssignmentTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
)
{
}
)
{
}
public
columns
=
[
{
key
:
'
class_subject_subject_txt
'
,
label
:
'
Class
'
},
...
...
@@ -34,157 +35,56 @@ export class AssignmentComponent {
{
key
:
'
section
'
,
label
:
'
Section
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
public
data
:
any
[]
=
[];
private
_temp
:
Assignment
[]
=
[
{
"
session
"
:
{
"
default
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
beng
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
hindi
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
en
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
},
"
subject
"
:
{
"
default
"
:
""
,
"
beng
"
:
""
,
"
hindi
"
:
""
,
"
en
"
:
"
46486ae5e9470245652c77dbe9329136
"
},
"
assigned_on
"
:
{
"
default
"
:
"
2025-03-21
"
,
"
beng
"
:
"
2025-03-21
"
,
"
hindi
"
:
"
2025-03-21
"
,
"
en
"
:
"
2025-03-21
"
},
"
last_submission_date
"
:
{
"
default
"
:
"
2025-03-21
"
,
"
beng
"
:
"
2025-03-21
"
,
"
hindi
"
:
"
2025-03-21
"
,
"
en
"
:
"
2025-03-21
"
},
"
section
"
:
{
"
default
"
:
"
1628f1d3368d31b75447ca348c1add5e
"
,
"
beng
"
:
"
1628f1d3368d31b75447ca348c1add5e
"
,
"
hindi
"
:
"
1628f1d3368d31b75447ca348c1add5e
"
,
"
en
"
:
"
1628f1d3368d31b75447ca348c1add5e
"
},
"
docs
"
:
{
"
default
"
:
""
,
"
beng
"
:
""
,
"
hindi
"
:
""
,
"
en
"
:
""
},
"
class_subject
"
:
{
"
default
"
:
"
7f8aa0e3b9fb526fbc77cb4e190b0965
"
,
"
beng
"
:
"
7f8aa0e3b9fb526fbc77cb4e190b0965
"
,
"
hindi
"
:
"
7f8aa0e3b9fb526fbc77cb4e190b0965
"
,
"
en
"
:
"
7f8aa0e3b9fb526fbc77cb4e190b0965
"
},
"
session_session_name
"
:
{
"
default
"
:
"
2024-2025
"
,
"
beng
"
:
"
2024-2025
"
,
"
hindi
"
:
"
2024-2025
"
,
"
en
"
:
"
2024-2025 session
"
},
"
section_details
"
:
{
"
default
"
:
"
test 12 b
"
,
"
beng
"
:
"
test 12 b
"
,
"
hindi
"
:
"
test 12 b
"
,
"
en
"
:
"
test 12 b
"
},
"
id
"
:
"
893121387a9b65a4474402f09046c724
"
,
"
subject_subject_name
"
:
{
"
default
"
:
"
Physics
"
,
"
beng
"
:
"
Physics
"
,
"
hindi
"
:
"
Physics
"
,
"
en
"
:
"
Physics
"
},
"
class_subject_subject_txt
"
:
{
"
default
"
:
"
Math
"
,
"
beng
"
:
"
Math
"
,
"
hindi
"
:
"
Math
"
,
"
en
"
:
"
Math
"
}
}
]
ngOnInit
():
void
{
this
.
_getAssignment
();
}
private
_getAssignment
()
:
void
{
public
data
:
any
[]
=
[];
ngOnInit
():
void
{
this
.
columns
=
this
.
_prepareAssignmentTableData
.
prepareMatTableColumn
();
this
.
data
=
this
.
_prepareAssignmentTableData
.
prepareMatTableData
(
this
.
_temp
);
this
.
_getAssignments
();
}
this
.
columns
=
this
.
_prepareAssignmentTableData
.
prepareMatTableColumn
(
this
.
_temp
);
private
_getAssignments
():
void
{
this
.
_assignmentTransmission
Service
.
getAssignment
(
TransmissionMapperService
.
ASSIGNMENT_TRANSMISSION_URL
+
this
.
_urlConfigService
.
generateDatasourceConfigUrl
({
this
.
_assignmentTransmission
.
getAssignment
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
3188
,
datasourceId
:
DataSourceService
.
ASSIGNMENT_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
1
0
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
}),
limit
:
10
0
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
AssignmentsResponse
)
=>
{
// this.data = response.data.themeDataSourceFields
// response['data']['themeDataSourceFields'].map((assignment:Assignment) => {
// return{
// assignment.
// }
// })
// this.data = this._prepareAssignmentTableData.prepareMatTableData(
// response.data.themeDataSourceFields
// );
// this.columns = this._prepareAssignmentTableData.prepareMatTableData(
// response.data.themeDataSourceFields
// );
// this.data = [
// { id: 1, name: 'John Doe', age: 30 },
// { id: 2, name: 'Jane Doe', age: 28 },
// { id: 3, name: 'Alice', age: 25 }
// ];
// this.columns = [
// { key: 'id', label: 'ID' },
// { key: 'name', label: 'Name' },
// { key: 'age', label: 'Age' }
// ];
console
.
log
(
this
.
data
);
this
.
data
=
this
.
_prepareAssignmentTableData
.
prepareMatTableData
(
response
.
data
.
themeDataSourceFields
);
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
},
()
=>
{
}
)
}
public
emitViewFromTable
(
clickedData
:
string
){
public
emitViewFromTable
(
clickedData
:
string
)
{
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
'
,
...
...
@@ -197,9 +97,14 @@ export class AssignmentComponent {
// });
}
public
addAssignment
(){
alert
(
"
Add assignment
"
);
public
addAssignment
():
void
{
let
dialogRef
=
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
''
,
width
:
'
98vw
'
,
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
maxHeight
:
'
70vh
'
,
});
}
}
src/app/portal/assignment/service/prepare-assignment-table-data.service.ts
View file @
b18b2f83
...
...
@@ -9,8 +9,7 @@ export class PrepareAssignmentTableDataService {
constructor
()
{
}
public
prepareMatTableData
(
data
:
Assignment
[]):
any
{
debugger
let
dataArray
=
data
.
map
((
assignment
:
Assignment
)
=>
{
return
{
...
...
@@ -27,7 +26,7 @@ export class PrepareAssignmentTableDataService {
// return [];
}
public
prepareMatTableColumn
(
data
:
Assignment
[]
):
any
[]
{
public
prepareMatTableColumn
():
any
[]
{
let
columnArray
=
[
{
key
:
'
subject
'
,
label
:
'
Subject
'
},
...
...
@@ -35,7 +34,8 @@ export class PrepareAssignmentTableDataService {
{
key
:
'
session_name
'
,
label
:
'
Session Name
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
console
.
log
(
columnArray
);
return
columnArray
;
}
...
...
src/app/portal/routine/interface/routine.ts
0 → 100644
View file @
b18b2f83
import
{
Data
}
from
"
../../data-source/interface/data
"
;
import
{
LocalizedField
}
from
"
../../data-source/interface/localizedField
"
;
// ThemeDataSourceField Interface
export
interface
Routines
extends
Data
{
themeDataSourceFields
:
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 @
b18b2f83
<p
>
manage works!
</p
>
<p
re>
{{data | json}}
</pre
>
src/app/portal/routine/manage/manage.component.ts
View file @
b18b2f83
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/routine/routine/routine.component.html
View file @
b18b2f83
<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 @
b18b2f83
.add_btn
{
position
:
fixed
;
bottom
:
20px
;
right
:
0
;
padding
:
0px
20px
;
margin
:
auto
;
}
\ No newline at end of file
src/app/portal/routine/routine/routine.component.ts
View file @
b18b2f83
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
(
clickedData
:
string
)
{
alert
(
"
Have to view the doc in another page
"
);
}
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 @
b18b2f83
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 @
b18b2f83
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
'
],
[
'
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 @
b18b2f83
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 @
b18b2f83
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
;
}
src/app/raintree/interface/raintree-response.ts
View file @
b18b2f83
export
interface
RaintreeResponse
{
[
index
:
string
]:
any
;
status_code
:
number
;
message
:
string
;
[
index
:
string
]:
any
;
}
src/app/raintree/interface/routine-respons.ts
0 → 100644
View file @
b18b2f83
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/transmission/assignment-transmission.service.ts
View file @
b18b2f83
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
HttpErrorHandlerService
}
from
'
../http-error-handler.service
'
;
import
{
JWTService
}
from
'
./jwt.service
'
;
import
{
ErrorHandlerService
}
from
'
../error-handler.service
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
import
{
AssignmentsResponse
}
from
'
../interface/assignment-respons
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
AssignmentTransmissionService
extends
TransmissionService
{
// constructor(
// _http: HttpClient,
// _httpErrorHandler: HttpErrorHandlerService,
// _jwt: JWTService,
// _errorHandler: ErrorHandlerService
// ) {
// super(_http, _httpErrorHandler, _jwt, _errorHandler);
// }
public
getAssignment
(
url
:
string
,
onPreExecute
:
()
=>
void
,
...
...
@@ -27,7 +16,7 @@ export class AssignmentTransmissionService extends TransmissionService {
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
):
void
{
this
.
executePostPayload
<
any
>
(
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
...
...
src/app/raintree/transmission/jwt.service.ts
View file @
b18b2f83
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
;
...
...
@@ -15,9 +18,9 @@ export class JWTService {
let
authorizationToken
:
string
=
localStorage
.
getItem
(
'
Bearer
'
)
||
''
;
// TODO: check if token exist in Local storage and handle accordingly
return
new
HttpHeaders
({
"
user-id
"
:
'
206
'
,
"
user-id
"
:
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
)
,
"
apikey
"
:
authorizationToken
,
'
Content-Type
'
:
'
application/json
'
,
});
...
...
src/app/raintree/transmission/routine-transmission.service.spec.ts
0 → 100644
View file @
b18b2f83
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 @
b18b2f83
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
);
}
}
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