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
7b70909f
Commit
7b70909f
authored
Apr 11, 2025
by
achinta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: date-range in assignment
parent
44642347
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
410 additions
and
217 deletions
+410
-217
src/app/component-library/date-range/date-range.component.html
...pp/component-library/date-range/date-range.component.html
+10
-0
src/app/component-library/date-range/date-range.component.scss
...pp/component-library/date-range/date-range.component.scss
+0
-0
src/app/component-library/date-range/date-range.component.spec.ts
...component-library/date-range/date-range.component.spec.ts
+23
-0
src/app/component-library/date-range/date-range.component.ts
src/app/component-library/date-range/date-range.component.ts
+36
-0
src/app/mappers/transmission-mapper.service.ts
src/app/mappers/transmission-mapper.service.ts
+1
-21
src/app/portal/assignment/assignment/assignment.component.html
...pp/portal/assignment/assignment/assignment.component.html
+18
-12
src/app/portal/assignment/assignment/assignment.component.scss
...pp/portal/assignment/assignment/assignment.component.scss
+6
-1
src/app/portal/assignment/assignment/assignment.component.ts
src/app/portal/assignment/assignment/assignment.component.ts
+45
-12
src/app/portal/assignment/manage/manage.component.ts
src/app/portal/assignment/manage/manage.component.ts
+6
-6
src/app/portal/navigation/model/sidebar/menu.ts
src/app/portal/navigation/model/sidebar/menu.ts
+3
-2
src/app/portal/portal-dashboard/portal-dashboard.component.ts
...app/portal/portal-dashboard/portal-dashboard.component.ts
+3
-2
src/app/portal/routine/interface/routine-table.ts
src/app/portal/routine/interface/routine-table.ts
+1
-1
src/app/portal/routine/interface/routine.ts
src/app/portal/routine/interface/routine.ts
+2
-1
src/app/portal/routine/manage/manage.component.html
src/app/portal/routine/manage/manage.component.html
+12
-8
src/app/portal/routine/manage/manage.component.ts
src/app/portal/routine/manage/manage.component.ts
+125
-108
src/app/portal/routine/routine.routes.ts
src/app/portal/routine/routine.routes.ts
+1
-1
src/app/portal/routine/routine/routine.component.ts
src/app/portal/routine/routine/routine.component.ts
+39
-13
src/app/portal/routine/service/prepare-routine-table-data.service.ts
...tal/routine/service/prepare-routine-table-data.service.ts
+3
-2
src/app/portal/service/data-source.service.ts
src/app/portal/service/data-source.service.ts
+6
-0
src/app/portal/service/url-config.service.ts
src/app/portal/service/url-config.service.ts
+70
-27
No files found.
src/app/component-library/date-range/date-range.component.html
0 → 100644
View file @
7b70909f
<mat-form-field>
<mat-label>
Enter a date range
</mat-label>
<mat-date-range-input
[formGroup]=
"range"
[rangePicker]=
"picker"
>
<input
formControlName=
"start"
matStartDate
placeholder=
"Start date"
(dateChange)=
"onDateChange()"
>
<input
formControlName=
"end"
matEndDate
placeholder=
"End date"
(dateChange)=
"onDateChange()"
>
</mat-date-range-input>
<mat-hint>
MM/DD/YYYY – MM/DD/YYYY
</mat-hint>
<mat-datepicker-toggle
matIconSuffix
[for]=
"picker"
></mat-datepicker-toggle>
<mat-date-range-picker
#picker
></mat-date-range-picker>
</mat-form-field>
src/app/component-library/date-range/date-range.component.scss
0 → 100644
View file @
7b70909f
src/app/component-library/date-range/date-range.component.spec.ts
0 → 100644
View file @
7b70909f
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
DateRangeComponent
}
from
'
./date-range.component
'
;
describe
(
'
DateRangeComponent
'
,
()
=>
{
let
component
:
DateRangeComponent
;
let
fixture
:
ComponentFixture
<
DateRangeComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
imports
:
[
DateRangeComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
DateRangeComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/component-library/date-range/date-range.component.ts
0 → 100644
View file @
7b70909f
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
,
signal
}
from
'
@angular/core
'
;
import
{
FormControl
,
FormGroup
,
FormsModule
,
ReactiveFormsModule
}
from
'
@angular/forms
'
;
import
{
provideNativeDateAdapter
}
from
'
@angular/material/core
'
;
import
{
MatDatepickerModule
}
from
'
@angular/material/datepicker
'
;
import
{
MatFormFieldModule
}
from
'
@angular/material/form-field
'
;
import
{
MatInputModule
}
from
'
@angular/material/input
'
;
@
Component
({
selector
:
'
app-date-range
'
,
imports
:
[
CommonModule
,
MatInputModule
,
MatDatepickerModule
,
ReactiveFormsModule
,
MatFormFieldModule
,
FormsModule
],
standalone
:
true
,
templateUrl
:
'
./date-range.component.html
'
,
styleUrl
:
'
./date-range.component.scss
'
,
providers
:
[
provideNativeDateAdapter
()],
})
export
class
DateRangeComponent
{
public
startDate
=
signal
<
string
[]
>
([]);
public
range
=
new
FormGroup
({
start
:
new
FormControl
<
Date
|
null
>
(
null
),
end
:
new
FormControl
<
Date
|
null
>
(
null
),
});
public
onDateChange
():
void
{
// this.startDate.update(startDate => [...startDate ,this.range.value.start])
}
}
src/app/mappers/transmission-mapper.service.ts
View file @
7b70909f
...
@@ -29,24 +29,4 @@ export class TransmissionMapperService {
...
@@ -29,24 +29,4 @@ export class TransmissionMapperService {
public
static
readonly
DELETE_RECORD_TRANSMISSION_URL
:
string
=
public
static
readonly
DELETE_RECORD_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/deleteWebsiteDataSourceFieldsBasedOnDataSourceType?
'
;
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/deleteWebsiteDataSourceFieldsBasedOnDataSourceType?
'
;
// 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/portal/assignment/assignment/assignment.component.html
View file @
7b70909f
<h3>
Assignments
</h3>
<h3>
Assignments
</h3>
<div
class=
"date_range_picker"
>
<mat-form-field>
<mat-label>
Enter a date range
</mat-label>
<mat-date-range-input
[formGroup]=
"range"
[rangePicker]=
"picker"
>
<input
formControlName=
"start"
matStartDate
placeholder=
"Start date"
(dateChange)=
"onDateChange()"
>
<input
formControlName=
"end"
matEndDate
placeholder=
"End date"
(dateChange)=
"onDateChange()"
>
</mat-date-range-input>
<mat-hint>
MM/DD/YYYY – MM/DD/YYYY
</mat-hint>
<mat-datepicker-toggle
matIconSuffix
[for]=
"picker"
></mat-datepicker-toggle>
<mat-date-range-picker
#picker
></mat-date-range-picker>
</mat-form-field>
</div>
<div
class=
"custom_table"
>
<div
class=
"custom_table"
>
<app-custom-table
<app-custom-table
[columns]=
"columns"
[data]=
"data"
(emitDelete)=
"emitDeleteFromTable($event)"
[columns]=
"columns"
(emitView)=
"emitViewFromTable($event)"
/>
[data]=
"data"
(emitDelete)=
"emitDeleteFromTable($event)"
(emitView)=
"emitViewFromTable($event)"
/>
</div>
</div>
<div
class=
"add_btn"
*ngIf=
"authService.getUserRole() !== 'Parent'"
>
<div
class=
"add_btn"
*ngIf=
"authService.getUserRole() !== 'Parent'"
>
<app-square-button
<app-square-button
[buttonIcon]=
"'add'"
(emitSquareButtonClick)=
"addAssignment()"
/>
[buttonIcon]=
"'add'"
(emitSquareButtonClick)=
"addAssignment()"
/>
</div>
</div>
<!-- <app-mat-confirm-dialog /> -->
<!-- <app-mat-confirm-dialog /> -->
\ No newline at end of file
src/app/portal/assignment/assignment/assignment.component.scss
View file @
7b70909f
...
@@ -5,3 +5,8 @@
...
@@ -5,3 +5,8 @@
padding
:
0px
15px
;
padding
:
0px
15px
;
margin
:
auto
;
margin
:
auto
;
}
}
.date_range_picker
{
margin-bottom
:
20px
;
}
src/app/portal/assignment/assignment/assignment.component.ts
View file @
7b70909f
...
@@ -9,7 +9,7 @@ import { UrlConfigService } from '../../service/url-config.service';
...
@@ -9,7 +9,7 @@ import { UrlConfigService } from '../../service/url-config.service';
import
{
PrepareAssignmentTableDataService
}
from
'
../service/prepare-assignment-table-data.service
'
;
import
{
PrepareAssignmentTableDataService
}
from
'
../service/prepare-assignment-table-data.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
CommonModule
,
DatePipe
}
from
'
@angular/common
'
;
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
import
{
MatDialogConfigService
}
from
'
../../service/mat-dialog-config.service
'
;
import
{
MatDialogConfigService
}
from
'
../../service/mat-dialog-config.service
'
;
import
{
DeleteRecordTransmissionService
}
from
'
../../../raintree/transmission/delete-record-transmission.service
'
;
import
{
DeleteRecordTransmissionService
}
from
'
../../../raintree/transmission/delete-record-transmission.service
'
;
...
@@ -17,17 +17,25 @@ import { ToasterService } from '../../../component-library/toaster/toaster.servi
...
@@ -17,17 +17,25 @@ import { ToasterService } from '../../../component-library/toaster/toaster.servi
import
{
CustomTableColumn
}
from
'
../../../component-library/interface/custom-table-column
'
;
import
{
CustomTableColumn
}
from
'
../../../component-library/interface/custom-table-column
'
;
import
{
AssignmentTable
}
from
'
../interface/assignment-table
'
;
import
{
AssignmentTable
}
from
'
../interface/assignment-table
'
;
import
{
MatConfirmDialogComponent
}
from
"
../../../component-library/mat-confirm-dialog/mat-confirm-dialog.component
"
;
import
{
MatConfirmDialogComponent
}
from
"
../../../component-library/mat-confirm-dialog/mat-confirm-dialog.component
"
;
import
{
RoleMapperService
}
from
'
../../../mappers/role-mapper.service
'
;
import
{
MatFormFieldModule
}
from
'
@angular/material/form-field
'
;
import
{
MatDatepickerModule
}
from
'
@angular/material/datepicker
'
;
import
{
FormControl
,
FormGroup
,
FormsModule
,
ReactiveFormsModule
}
from
'
@angular/forms
'
;
import
{
provideNativeDateAdapter
}
from
'
@angular/material/core
'
;
@
Component
({
@
Component
({
selector
:
'
app-assignment
'
,
selector
:
'
app-assignment
'
,
imports
:
[
imports
:
[
CustomTableComponent
,
CustomTableComponent
,
CommonModule
,
CommonModule
,
SquareButtonComponent
SquareButtonComponent
,
],
MatFormFieldModule
,
MatDatepickerModule
,
ReactiveFormsModule
],
standalone
:
true
,
templateUrl
:
'
./assignment.component.html
'
,
templateUrl
:
'
./assignment.component.html
'
,
styleUrl
:
'
./assignment.component.scss
'
styleUrl
:
'
./assignment.component.scss
'
,
providers
:
[
provideNativeDateAdapter
(),
provideNativeDateAdapter
(),
DatePipe
],
})
})
export
class
AssignmentComponent
implements
OnInit
{
export
class
AssignmentComponent
implements
OnInit
{
...
@@ -38,10 +46,16 @@ export class AssignmentComponent implements OnInit {
...
@@ -38,10 +46,16 @@ export class AssignmentComponent implements OnInit {
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
,
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
,
public
matConfig
:
MatDialogConfigService
,
public
matConfig
:
MatDialogConfigService
,
public
authService
:
AuthService
,
public
authService
:
AuthService
,
private
_deleteTransmission
:
DeleteRecordTransmissionService
,
private
_deleteTransmission
:
DeleteRecordTransmissionService
,
private
_toaster
:
ToasterService
private
_toaster
:
ToasterService
,
private
_datePipe
:
DatePipe
,
)
{
}
)
{
}
public
range
=
new
FormGroup
({
start
:
new
FormControl
<
Date
|
null
>
(
null
),
end
:
new
FormControl
<
Date
|
null
>
(
null
),
});
public
columns
:
CustomTableColumn
[]
=
[];
public
columns
:
CustomTableColumn
[]
=
[];
public
data
:
AssignmentTable
[]
=
[];
public
data
:
AssignmentTable
[]
=
[];
...
@@ -59,6 +73,19 @@ export class AssignmentComponent implements OnInit {
...
@@ -59,6 +73,19 @@ export class AssignmentComponent implements OnInit {
}
}
private
_getAssignments
():
void
{
private
_getAssignments
():
void
{
// fieldName: assigned_on,assigned_on
// operators: gt,lt
// fieldValues: hhfj,nfw
let
dateRangeFieldname
=
''
;
let
dateRangeFieldOperator
=
''
;
let
dateRangeFieldValue
=
''
;
if
(
this
.
range
.
value
.
start
&&
this
.
range
.
value
.
end
){
dateRangeFieldname
=
'
assigned_on,assigned_on
'
;
dateRangeFieldOperator
=
'
ge,le
'
;
dateRangeFieldValue
=
`
${
this
.
_datePipe
.
transform
(
this
.
range
.
value
.
start
,
'
yyyy-MM-dd
'
)}
,
${
this
.
_datePipe
.
transform
(
this
.
range
.
value
.
end
,
'
yyyy-MM-dd
'
)}
`
}
this
.
_assignmentTransmission
.
getAssignment
(
this
.
_assignmentTransmission
.
getAssignment
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
...
@@ -71,9 +98,9 @@ export class AssignmentComponent implements OnInit {
...
@@ -71,9 +98,9 @@ export class AssignmentComponent implements OnInit {
limit
:
100
,
limit
:
100
,
orderBy
:
"
ASC
"
,
orderBy
:
"
ASC
"
,
page
:
1
,
page
:
1
,
fieldName
:
this
.
_urlConfig
.
getFiledNameFilter
(
'
assignment
'
)
,
fieldName
:
`
${
this
.
_urlConfig
.
getFiledNameFilter
(
'
assignment
'
)}
,
${
dateRangeFieldname
}
`
,
operators
:
this
.
_urlConfig
.
getFieldOperatorFilter
(
'
assignment
'
)
,
operators
:
`
${
this
.
_urlConfig
.
getFieldOperatorFilter
(
'
assignment
'
)}
,
${
dateRangeFieldOperator
}
`
,
fieldValues
:
this
.
_urlConfig
.
getFieldValuesFilter
(
'
assignment
'
)
,
fieldValues
:
`
${
this
.
_urlConfig
.
getFieldValuesFilter
(
'
assignment
'
)}
,
${
dateRangeFieldValue
}
`
,
// this.authService.localStorageGetItemByKey("user_id"),
// this.authService.localStorageGetItemByKey("user_id"),
}),
}),
()
=>
{
},
()
=>
{
},
...
@@ -129,4 +156,10 @@ export class AssignmentComponent implements OnInit {
...
@@ -129,4 +156,10 @@ export class AssignmentComponent implements OnInit {
});
});
}
}
public
onDateChange
():
void
{
if
(
this
.
range
.
value
.
start
&&
this
.
range
.
value
.
end
)
this
.
_getAssignments
();
}
}
}
src/app/portal/assignment/manage/manage.component.ts
View file @
7b70909f
...
@@ -60,11 +60,10 @@ export class ManageComponent {
...
@@ -60,11 +60,10 @@ export class ManageComponent {
public
sectionDropDownData
:
Dropdown
[]
=
[];
public
sectionDropDownData
:
Dropdown
[]
=
[];
public
assignmentForm
=
new
FormGroup
({
public
assignmentForm
=
new
FormGroup
({
// class: new FormControl("", [Validators.required]),
section
:
new
FormControl
(
""
,
[
Validators
.
required
]),
section
:
new
FormControl
(
""
,
[
Validators
.
required
]),
subject
:
new
FormControl
(
""
,
[
Validators
.
required
]),
subject
:
new
FormControl
(
""
,
[
Validators
.
required
]),
lastDate
:
new
FormControl
(
""
,
[
Validators
.
required
]),
lastDate
:
new
FormControl
(
""
,
[
Validators
.
required
]),
document
:
new
FormControl
(
""
),
document
:
new
FormControl
(
""
,
[
Validators
.
required
])
});
});
ngOnInit
():
void
{
ngOnInit
():
void
{
// this._getClasses();
// this._getClasses();
...
@@ -88,7 +87,8 @@ export class ManageComponent {
...
@@ -88,7 +87,8 @@ export class ManageComponent {
()
=>
{
},
()
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
(
response
:
RaintreeResponse
)
=>
{
this
.
assignmentForm
.
value
.
document
=
`
${
TransmissionMapperService
.
DEV_TRANSMISSION_URL
}
/webomagic/getFile?fid=
${
response
[
'
data
'
]}
`
this
.
assignmentForm
.
get
(
'
document
'
)?.
setValue
(
`
${
TransmissionMapperService
.
DEV_TRANSMISSION_URL
}
/webomagic/getFile?fid=
${
response
[
'
data
'
]}
`
)
this
.
_toaster
.
success
(
response
.
message
,
'
Ok
'
)
this
.
_toaster
.
success
(
response
.
message
,
'
Ok
'
)
},
},
(
error
)
=>
{
(
error
)
=>
{
...
@@ -269,9 +269,9 @@ export class ManageComponent {
...
@@ -269,9 +269,9 @@ export class ManageComponent {
hindi
:
`
${
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
)}
`
,
hindi
:
`
${
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
)}
`
,
},
},
session
:
{
session
:
{
en
:
'
86af4d6b5675a82df4581f00c67f0c7f
'
,
en
:
`
${
DataSourceService
.
SESSION_ID
}
`
,
beng
:
'
86af4d6b5675a82df4581f00c67f0c7f
'
,
beng
:
`
${
DataSourceService
.
SESSION_ID
}
`
,
hindi
:
'
86af4d6b5675a82df4581f00c67f0c7f
'
,
hindi
:
`
${
DataSourceService
.
SESSION_ID
}
`
,
},
},
school
:
{
school
:
{
en
:
`
${
localStorage
.
getItem
(
'
school_id
'
)}
`
,
en
:
`
${
localStorage
.
getItem
(
'
school_id
'
)}
`
,
...
...
src/app/portal/navigation/model/sidebar/menu.ts
View file @
7b70909f
...
@@ -53,7 +53,7 @@ export class Menu {
...
@@ -53,7 +53,7 @@ export class Menu {
id
:
4
,
id
:
4
,
title
:
'
Routine
'
,
title
:
'
Routine
'
,
icon
:
'
routine
'
,
icon
:
'
routine
'
,
route
:
RequestMapperService
.
ROUTINE_URL
,
route
:
RequestMapperService
.
ROUTINE_URL
+
'
/class
'
,
selected
:
false
,
selected
:
false
,
roles
:
[
roles
:
[
RoleMapperService
.
TEACHER_ROLE
,
RoleMapperService
.
STUDENT_ROLE
RoleMapperService
.
TEACHER_ROLE
,
RoleMapperService
.
STUDENT_ROLE
...
@@ -65,7 +65,8 @@ export class Menu {
...
@@ -65,7 +65,8 @@ export class Menu {
id
:
5
,
id
:
5
,
title
:
'
Exam
'
,
title
:
'
Exam
'
,
icon
:
'
book_3
'
,
icon
:
'
book_3
'
,
route
:
RequestMapperService
.
EXAM_URL
,
// route: RequestMapperService.EXAM_URL,
route
:
RequestMapperService
.
ROUTINE_URL
+
'
/exam
'
,
selected
:
false
,
selected
:
false
,
roles
:
[
roles
:
[
RoleMapperService
.
TEACHER_ROLE
,
RoleMapperService
.
STUDENT_ROLE
RoleMapperService
.
TEACHER_ROLE
,
RoleMapperService
.
STUDENT_ROLE
...
...
src/app/portal/portal-dashboard/portal-dashboard.component.ts
View file @
7b70909f
...
@@ -38,9 +38,10 @@ export class PortalDashboardComponent implements OnInit {
...
@@ -38,9 +38,10 @@ export class PortalDashboardComponent implements OnInit {
public
assignmentUrl
=
`/
${
RequestMapperService
.
PORTAL_URL
}
/
${
RequestMapperService
.
ASSIGNMENT_URL
}
`
;
public
assignmentUrl
=
`/
${
RequestMapperService
.
PORTAL_URL
}
/
${
RequestMapperService
.
ASSIGNMENT_URL
}
`
;
public
routineUrl
=
`/
${
RequestMapperService
.
PORTAL_URL
}
/
${
RequestMapperService
.
ROUTINE_URL
}
`
;
public
routineUrl
=
`/
${
RequestMapperService
.
PORTAL_URL
}
/
${
RequestMapperService
.
ROUTINE_URL
}
/class
`
;
public
examUrl
=
`/
${
RequestMapperService
.
PORTAL_URL
}
/
${
RequestMapperService
.
EXAM_URL
}
`
;
public
examUrl
=
`/
${
RequestMapperService
.
PORTAL_URL
}
/
${
RequestMapperService
.
ROUTINE_URL
}
/exam`
;
// public examUrl = `/${RequestMapperService.PORTAL_URL}/${RequestMapperService.EXAM_URL}/exam`;
public
selectedStudent
:
string
=
''
;
public
selectedStudent
:
string
=
''
;
...
...
src/app/portal/routine/interface/routine-table.ts
View file @
7b70909f
...
@@ -5,6 +5,6 @@ export interface RoutineTable {
...
@@ -5,6 +5,6 @@ export interface RoutineTable {
class_details
?:
string
;
class_details
?:
string
;
section_details
?:
string
;
section_details
?:
string
;
routine_type
:
string
;
routine_type
:
string
;
schedule
:
string
;
document
:
string
action
:
string
[]
action
:
string
[]
}
}
\ No newline at end of file
src/app/portal/routine/interface/routine.ts
View file @
7b70909f
...
@@ -12,7 +12,6 @@ export interface Routine {
...
@@ -12,7 +12,6 @@ export interface Routine {
id
:
string
;
id
:
string
;
class
:
LocalizedField
;
class
:
LocalizedField
;
section
:
LocalizedField
;
section
:
LocalizedField
;
schedule
:
LocalizedField
;
details
:
LocalizedField
;
details
:
LocalizedField
;
session
:
LocalizedField
;
session
:
LocalizedField
;
document
:
LocalizedField
;
document
:
LocalizedField
;
...
@@ -20,5 +19,7 @@ export interface Routine {
...
@@ -20,5 +19,7 @@ export interface Routine {
session_session_name
?:
LocalizedField
;
session_session_name
?:
LocalizedField
;
class_details
?:
LocalizedField
;
class_details
?:
LocalizedField
;
section_details
?:
LocalizedField
;
section_details
?:
LocalizedField
;
school
:
LocalizedField
;
school_school_Name
?:
LocalizedField
;
}
}
src/app/portal/routine/manage/manage.component.html
View file @
7b70909f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"container"
>
<div
class=
"container"
>
<form
class=
"routine_form"
[formGroup]=
"routineForm"
>
<form
class=
"routine_form"
[formGroup]=
"routineForm"
>
<div
class=
"mat_input_container"
>
<div
class=
"mat_input_container"
>
<div
class=
"class_dropdown mat_input"
>
<
!-- <
div class="class_dropdown mat_input">
<mat-form-field class="full_width">
<mat-form-field class="full_width">
<mat-label>Select Class</mat-label>
<mat-label>Select Class</mat-label>
<mat-select formControlName="class">
<mat-select formControlName="class">
...
@@ -14,12 +14,12 @@
...
@@ -14,12 +14,12 @@
</mat-form-field>
</mat-form-field>
</div>
</div>
-->
<div
class=
"section_dropdown mat_input"
>
<div
class=
"section_dropdown mat_input"
>
<mat-form-field
class=
"full_width"
>
<mat-form-field
class=
"full_width"
>
<mat-label>
Select Section
</mat-label>
<mat-label>
Select Section
</mat-label>
<mat-select
formControlName=
"section"
>
<mat-select
formControlName=
"section"
(selectionChange)=
"onSectionChange()"
>
@for (section of sectionDropDownData; track section) {
@for (section of sectionDropDownData; track section) {
<mat-option
[value]=
"section.value"
>
{{section.name}}
</mat-option>
<mat-option
[value]=
"section.value"
>
{{section.name}}
</mat-option>
}
}
...
@@ -31,11 +31,15 @@
...
@@ -31,11 +31,15 @@
<div
class=
"routine_type_dropdown mat_input"
>
<div
class=
"routine_type_dropdown mat_input"
>
<mat-form-field
class=
"full_width"
>
<mat-form-field
class=
"full_width"
>
<mat-label>
Select Type
</mat-label>
<mat-label>
Details
</mat-label>
<mat-select
formControlName=
"routineType"
>
<input
<mat-option
value=
"class_routine"
>
Class Routine
</mat-option>
type=
"text"
<mat-option
value=
"exam_routine"
>
Exam Routine
</mat-option>
matInput
</mat-select>
placeholder=
"Routine details"
#input
formControlName=
"details"
>
<mat-error>
This field is required
</mat-error>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</mat-form-field>
...
...
src/app/portal/routine/manage/manage.component.ts
View file @
7b70909f
import
{
CommonModule
}
from
"
@angular/common
"
;
import
{
CommonModule
}
from
"
@angular/common
"
;
import
{
Component
,
Inject
}
from
"
@angular/core
"
;
import
{
Component
,
inject
,
Inject
}
from
"
@angular/core
"
;
import
{
MAT_DIALOG_DATA
}
from
"
@angular/material/dialog
"
;
import
{
MAT_DIALOG_DATA
}
from
"
@angular/material/dialog
"
;
import
{
ClassTransmissionService
}
from
"
../../../raintree/transmission/class-transmission.service
"
;
import
{
ClassTransmissionService
}
from
"
../../../raintree/transmission/class-transmission.service
"
;
import
{
TransmissionMapperService
}
from
"
../../../mappers/transmission-mapper.service
"
;
import
{
TransmissionMapperService
}
from
"
../../../mappers/transmission-mapper.service
"
;
...
@@ -19,13 +19,11 @@ import { MatFormFieldModule } from "@angular/material/form-field";
...
@@ -19,13 +19,11 @@ import { MatFormFieldModule } from "@angular/material/form-field";
import
{
MatInputModule
}
from
"
@angular/material/input
"
;
import
{
MatInputModule
}
from
"
@angular/material/input
"
;
import
{
MatIconModule
}
from
"
@angular/material/icon
"
;
import
{
MatIconModule
}
from
"
@angular/material/icon
"
;
import
{
SquareButtonComponent
}
from
"
../../../component-library/square-button/square-button.component
"
;
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
{
StudentSection
}
from
"
../../data-source/interface/section
"
;
import
{
RoutineTransmissionService
}
from
"
../../../raintree/transmission/routine-transmission.service
"
;
import
{
RoutineTransmissionService
}
from
"
../../../raintree/transmission/routine-transmission.service
"
;
import
{
AuthService
}
from
"
../../../auth/service/auth.service
"
;
import
{
AuthService
}
from
"
../../../auth/service/auth.service
"
;
import
{
RaintreeResponse
}
from
"
../../../raintree/interface/raintree-response
"
;
import
{
RaintreeResponse
}
from
"
../../../raintree/interface/raintree-response
"
;
import
{
Routine
,
Routines
}
from
"
../interface/routine
"
;
import
{
Routines
}
from
"
../interface/routine
"
;
import
{
ForeignKeyMap
}
from
"
../../data-source/interface/foreignKeyMap
"
;
import
{
MatSelectModule
}
from
"
@angular/material/select
"
;
import
{
MatSelectModule
}
from
"
@angular/material/select
"
;
import
{
FileInputComponent
}
from
"
../../../component-library/file-input/file-input.component
"
;
import
{
FileInputComponent
}
from
"
../../../component-library/file-input/file-input.component
"
;
import
{
FileUploadTransmissionService
}
from
"
../../../raintree/transmission/file-upload-transmission.service
"
;
import
{
FileUploadTransmissionService
}
from
"
../../../raintree/transmission/file-upload-transmission.service
"
;
...
@@ -42,34 +40,38 @@ import { ToasterService } from "../../../component-library/toaster/toaster.servi
...
@@ -42,34 +40,38 @@ import { ToasterService } from "../../../component-library/toaster/toaster.servi
SquareButtonComponent
,
SquareButtonComponent
,
MatSelectModule
,
MatSelectModule
,
FileInputComponent
FileInputComponent
],
],
templateUrl
:
"
./manage.component.html
"
,
templateUrl
:
"
./manage.component.html
"
,
styleUrl
:
"
./manage.component.scss
"
,
styleUrl
:
"
./manage.component.scss
"
,
})
})
export
class
ManageComponent
{
export
class
ManageComponent
{
constructor
(
constructor
(
// @Inject(MAT_DIALOG_DATA) public data: any
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
string
,
private
_classTransmission
:
ClassTransmissionService
,
private
_classTransmission
:
ClassTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_urlConfig
:
UrlConfigService
,
private
_routineTransmission
:
RoutineTransmissionService
,
private
_routineTransmission
:
RoutineTransmissionService
,
private
_auth
:
AuthService
,
private
_auth
:
AuthService
,
private
_fileUpload
:
FileUploadTransmissionService
,
private
_fileUpload
:
FileUploadTransmissionService
,
private
_toaster
:
ToasterService
private
_toaster
:
ToasterService
)
{}
)
{
}
public
classDropDownData
:
Dropdown
[]
=
[];
public
classDropDownData
:
Dropdown
[]
=
[];
public
sectionDropDownData
:
Dropdown
[]
=
[];
public
sectionDropDownData
:
Dropdown
[]
=
[];
public
sectionData
:
StudentSection
[]
=
[];
public
routineForm
=
new
FormGroup
({
public
routineForm
=
new
FormGroup
({
class
:
new
FormControl
(
""
,
[
Validators
.
required
]
),
class
:
new
FormControl
(
""
),
section
:
new
FormControl
(
""
,
[
Validators
.
required
]),
section
:
new
FormControl
(
""
,
[
Validators
.
required
]),
routineType
:
new
FormControl
(
""
,
[
Validators
.
required
]),
details
:
new
FormControl
(
""
,
[
Validators
.
required
]),
schedule
:
new
FormControl
(
""
),
schedule
:
new
FormControl
(
""
,
[
Validators
.
required
]
),
});
});
public
routineType
:
string
=
''
;
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
_getClasses
();
//
this._getClasses();
this
.
_getSection
();
this
.
_getSection
();
// console.log(this.data);
}
}
public
onFilesChanged
(
files
:
File
[]):
void
{
public
onFilesChanged
(
files
:
File
[]):
void
{
...
@@ -88,8 +90,11 @@ export class ManageComponent {
...
@@ -88,8 +90,11 @@ export class ManageComponent {
()
=>
{
},
()
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
(
response
:
RaintreeResponse
)
=>
{
this
.
routineForm
.
value
.
schedule
=
`
${
TransmissionMapperService
.
DEV_TRANSMISSION_URL
}
/webomagic/getFile?fid=
${
response
[
'
data
'
]}
`
this
.
routineForm
.
get
(
'
schedule
'
)?.
setValue
(
this
.
_toaster
.
success
(
response
.
message
,
'
Ok
'
)
`
${
TransmissionMapperService
.
DEV_TRANSMISSION_URL
}
/webomagic/getFile?fid=
${
response
[
'
data
'
]}
`
);
this
.
_toaster
.
success
(
response
.
message
,
'
Ok
'
);
},
},
(
error
)
=>
{
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -100,9 +105,16 @@ export class ManageComponent {
...
@@ -100,9 +105,16 @@ export class ManageComponent {
}
}
public
onSectionChange
():
void
{
let
selectedSectionId
=
this
.
routineForm
.
value
.
section
let
selectedClass
=
this
.
sectionData
.
find
(
sectionInfo
=>
sectionInfo
.
id
===
selectedSectionId
);
this
.
routineForm
.
get
(
'
class
'
)?.
setValue
(
`
${
selectedClass
?.
class
.
en
}
`)
}
public submitRoutine(): void {
public submitRoutine(): void {
if
(
this
.
routineForm
.
invalid
)
return
;
if
(this.routineForm.invalid) return;
this._routineTransmission.submitRoutine(
this._routineTransmission.submitRoutine(
...
@@ -113,7 +125,7 @@ export class ManageComponent {
...
@@ -113,7 +125,7 @@ export class ManageComponent {
() => { },
() => { },
(response: RaintreeResponse) => {
(response: RaintreeResponse) => {
this
.
_toaster
.
success
(
"
Routine added successfully
"
,
'
Done
'
);
this._toaster.success("Routine added successfully",
'Done');
window.location.reload();
window.location.reload();
},
},
...
@@ -125,39 +137,41 @@ export class ManageComponent {
...
@@ -125,39 +137,41 @@ export class ManageComponent {
);
);
}
}
private
_getClasses
()
{
// private _getClasses() {
this
.
_classTransmission
.
getClasses
(
// this._classTransmission.getClasses(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
// TransmissionMapperService.GET_TRANSMISSION_URL +
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
// this._urlConfig.generateDatasourceConfigUrl({
aggregationOnUniqueFld
:
false
,
// aggregationOnUniqueFld: false,
datasourceId
:
DataSourceService
.
CLASS_DATA_SOURCE_ID
,
// datasourceId: DataSourceService.CLASS_DATA_SOURCE_ID,
dontIncludeForeignKey
:
false
,
// dontIncludeForeignKey: false,
expand
:
false
,
// expand: false,
isUniqueValueRequiredForFieldToDisplay
:
false
,
// isUniqueValueRequiredForFieldToDisplay: false,
language
:
"
en
"
,
// language: "en",
limit
:
100
,
// limit: 100,
orderBy
:
"
ASC
"
,
// orderBy: "ASC",
page
:
1
,
// page: 1,
roleBasedFiltering
:
true
,
// fieldName: "teacher",
}),
// operators: "eq",
()
=>
{},
// fieldValues: this._auth.localStorageGetItemByKey("user_id")
(
response
)
=>
{},
// }),
(
response
:
RaintreeResponse
)
=>
{
// () => { },
this
.
classDropDownData
=
response
[
'
data
'
][
"
themeDataSourceFields
"
].
map
(
// (response) => { },
(
sClass
:
StudentClass
)
=>
{
// (response: RaintreeResponse) => {
return
{
// this.classDropDownData = response['data']["themeDataSourceFields"].map(
[
"
name
"
]:
sClass
.
details
[
"
en
"
],
// (sClass: StudentClass) => {
[
"
value
"
]:
sClass
.
id
,
// return {
};
// ["name"]: sClass.details["en"],
}
// ["value"]: sClass.id,
);
// };
},
// }
(
error
)
=>
{
// );
console
.
log
(
error
);
// },
},
// (error) => {
()
=>
{}
// console.log(error);
);
// },
}
// () => { }
// );
// }
private _getSection() {
private _getSection() {
this._classTransmission.getSection(
this._classTransmission.getSection(
...
@@ -172,15 +186,18 @@ export class ManageComponent {
...
@@ -172,15 +186,18 @@ export class ManageComponent {
limit: 100,
limit: 100,
orderBy: "ASC",
orderBy: "ASC",
page: 1,
page: 1,
roleBasedFiltering
:
true
,
fieldName: "teacher",
operators: "eq",
fieldValues: this._auth.localStorageGetItemByKey("user_id")
}),
}),
()
=>
{},
() => {
},
(
response
)
=>
{},
(response) => {
},
(response: RaintreeResponse) => {
(response: RaintreeResponse) => {
this.sectionData = response['data']['themeDataSourceFields'];
this.sectionDropDownData = response['data']["themeDataSourceFields"].map(
this.sectionDropDownData = response['data']["themeDataSourceFields"].map(
(sSection: StudentSection) => {
(sSection: StudentSection) => {
return {
return {
[
"
name
"
]:
sSection
.
section
[
"
en
"
],
["name"]: sSection.
details['en'
],
["value"]: sSection.id,
["value"]: sSection.id,
};
};
}
}
...
@@ -189,11 +206,11 @@ export class ManageComponent {
...
@@ -189,11 +206,11 @@ export class ManageComponent {
(error) => {
(error) => {
console.log(error);
console.log(error);
},
},
()
=>
{}
() => {
}
);
);
}
}
private
_prepareRoutinePayload
():
Routines
{
private _prepareRoutinePayload(): Routines
{
return {
return {
themeDataSourceFields: [
themeDataSourceFields: [
...
@@ -209,30 +226,31 @@ export class ManageComponent {
...
@@ -209,30 +226,31 @@ export class ManageComponent {
beng: `
$
{
this
.
routineForm
.
value
.
section
}
`,
beng: `
$
{
this
.
routineForm
.
value
.
section
}
`,
hindi: `
$
{
this
.
routineForm
.
value
.
section
}
`,
hindi: `
$
{
this
.
routineForm
.
value
.
section
}
`,
},
},
schedule
:
{
en
:
`
${
this
.
routineForm
.
value
.
schedule
}
`
,
beng
:
`
${
this
.
routineForm
.
value
.
schedule
}
`
,
hindi
:
`
${
this
.
routineForm
.
value
.
schedule
}
`
,
},
details: {
details: {
en
:
""
,
en:
`
$
{
this
.
routineForm
.
value
.
details
}
`
,
beng
:
""
,
beng:
`
$
{
this
.
routineForm
.
value
.
details
}
`
,
hindi
:
""
,
hindi:
`
$
{
this
.
routineForm
.
value
.
details
}
`
,
},
},
session: {
session: {
en
:
`
${
this
.
routineForm
.
value
.
section
}
`
,
en: `
$
{
DataSourceService
.
SESSION_ID
}
`,
beng
:
`
${
this
.
routineForm
.
value
.
section
}
`
,
beng: `
$
{
DataSourceService
.
SESSION_ID
}
`,
hindi
:
`
${
this
.
routineForm
.
value
.
section
}
`
,
hindi: `
$
{
DataSourceService
.
SESSION_ID
}
`,
},
},
document: {
document: {
en
:
""
,
en:
`
$
{
this
.
routineForm
.
value
.
schedule
}
`
,
beng
:
""
,
beng:
`
$
{
this
.
routineForm
.
value
.
schedule
}
`
,
hindi
:
""
,
hindi:
`
$
{
this
.
routineForm
.
value
.
schedule
}
`
,
},
},
routine_type: {
routine_type: {
en
:
`
${
this
.
routineForm
.
value
.
routineType
}
`
,
en: `
$
{
this
.
data
===
'
class
'
?
'
class_routine
'
:
'
exam_routine
'
}
`,
beng
:
`
${
this
.
routineForm
.
value
.
routineType
}
`
,
beng: `
$
{
this
.
data
===
'
class
'
?
'
class_routine
'
:
'
exam_routine
'
}
`,
hindi
:
`
${
this
.
routineForm
.
value
.
routineType
}
`
,
hindi: `
$
{
this
.
data
===
'
class
'
?
'
class_routine
'
:
'
exam_routine
'
}
`,
},
school: {
en: `
$
{
localStorage
.
getItem
(
'
school_id
'
)}
`,
beng: `
$
{
localStorage
.
getItem
(
'
school_id
'
)}
`,
hindi: `
$
{
localStorage
.
getItem
(
'
school_id
'
)}
`,
},
},
},
},
],
],
...
@@ -255,35 +273,34 @@ export class ManageComponent {
...
@@ -255,35 +273,34 @@ export class ManageComponent {
beng: `
$
{
this
.
routineForm
.
value
.
section
}
`,
beng: `
$
{
this
.
routineForm
.
value
.
section
}
`,
hindi: `
$
{
this
.
routineForm
.
value
.
section
}
`,
hindi: `
$
{
this
.
routineForm
.
value
.
section
}
`,
},
},
schedule
:
{
en
:
`
${
this
.
routineForm
.
value
.
schedule
}
`
,
beng
:
`
${
this
.
routineForm
.
value
.
schedule
}
`
,
hindi
:
`
${
this
.
routineForm
.
value
.
schedule
}
`
,
},
details: {
details: {
en
:
""
,
en:
`
$
{
this
.
routineForm
.
value
.
details
}
`
,
beng
:
""
,
beng:
`
$
{
this
.
routineForm
.
value
.
details
}
`
,
hindi
:
""
,
hindi:
`
$
{
this
.
routineForm
.
value
.
details
}
`
,
},
},
session: {
session: {
en
:
""
,
en:
`
$
{
DataSourceService
.
SESSION_ID
}
`
,
beng
:
""
,
beng:
`
$
{
DataSourceService
.
SESSION_ID
}
`
,
hindi
:
""
,
hindi:
`
$
{
DataSourceService
.
SESSION_ID
}
`
,
},
},
document: {
document: {
en
:
""
,
en:
`
$
{
this
.
routineForm
.
value
.
schedule
}
`
,
beng
:
""
,
beng:
`
$
{
this
.
routineForm
.
value
.
schedule
}
`
,
hindi
:
""
,
hindi:
`
$
{
this
.
routineForm
.
value
.
schedule
}
`
,
},
},
routine_type: {
routine_type: {
en
:
`
${
this
.
routineForm
.
value
.
routineType
}
`
,
en: `
$
{
this
.
data
===
'
class
'
?
'
class_routine
'
:
'
exam_routine
'
}
`,
beng
:
`
${
this
.
routineForm
.
value
.
routineType
}
`
,
beng: `
$
{
this
.
data
===
'
class
'
?
'
class_routine
'
:
'
exam_routine
'
}
`,
hindi
:
`
${
this
.
routineForm
.
value
.
routineType
}
`
,
hindi: `
$
{
this
.
data
===
'
class
'
?
'
class_routine
'
:
'
exam_routine
'
}
`,
},
school: {
en: `
$
{
localStorage
.
getItem
(
'
school_id
'
)}
`,
beng: `
$
{
localStorage
.
getItem
(
'
school_id
'
)}
`,
hindi: `
$
{
localStorage
.
getItem
(
'
school_id
'
)}
`,
},
},
},
},
],
],
count
:
0
,
favourite
:
true
};
};
}
}
...
...
src/app/portal/routine/routine.routes.ts
View file @
7b70909f
...
@@ -6,7 +6,7 @@ import { Menu } from "../navigation/model/sidebar/menu";
...
@@ -6,7 +6,7 @@ import { Menu } from "../navigation/model/sidebar/menu";
export
const
ROUTINE_ROUTES
:
Routes
=
[
export
const
ROUTINE_ROUTES
:
Routes
=
[
{
{
path
:
RequestMapperService
.
ROUTINE_URL
,
path
:
`
${
RequestMapperService
.
ROUTINE_URL
}
/:type`
,
loadComponent
:
()
=>
loadComponent
:
()
=>
import
(
import
(
'
./routine/routine.component
'
'
./routine/routine.component
'
...
...
src/app/portal/routine/routine/routine.component.ts
View file @
7b70909f
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
,
inject
}
from
'
@angular/core
'
;
import
{
RoutineTransmissionService
}
from
'
../../../raintree/transmission/routine-transmission.service
'
;
import
{
RoutineTransmissionService
}
from
'
../../../raintree/transmission/routine-transmission.service
'
;
import
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
...
@@ -16,6 +16,7 @@ import { DeleteRecordTransmissionService } from '../../../raintree/transmission/
...
@@ -16,6 +16,7 @@ import { DeleteRecordTransmissionService } from '../../../raintree/transmission/
import
{
ToasterService
}
from
'
../../../component-library/toaster/toaster.service
'
;
import
{
ToasterService
}
from
'
../../../component-library/toaster/toaster.service
'
;
import
{
RoutineTable
}
from
'
../interface/routine-table
'
;
import
{
RoutineTable
}
from
'
../interface/routine-table
'
;
import
{
CustomTableColumn
}
from
'
../../../component-library/interface/custom-table-column
'
;
import
{
CustomTableColumn
}
from
'
../../../component-library/interface/custom-table-column
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
@
Component
({
@
Component
({
selector
:
'
app-routine
'
,
selector
:
'
app-routine
'
,
...
@@ -38,29 +39,53 @@ export class RoutineComponent {
...
@@ -38,29 +39,53 @@ export class RoutineComponent {
private
_matDialogConfig
:
MatDialogConfigService
,
private
_matDialogConfig
:
MatDialogConfigService
,
private
_deleteTransmission
:
DeleteRecordTransmissionService
,
private
_deleteTransmission
:
DeleteRecordTransmissionService
,
private
_toaster
:
ToasterService
,
private
_toaster
:
ToasterService
,
public
authService
:
AuthService
public
authService
:
AuthService
,
)
{
}
)
{
}
public
columns
:
CustomTableColumn
[]
=
[];
public
columns
:
CustomTableColumn
[]
=
[];
public
data
:
RoutineTable
[]
=
[];
public
data
:
RoutineTable
[]
=
[];
ngOnInit
():
void
{
public
routineType
:
string
=
''
;
public
route
=
inject
(
ActivatedRoute
);
public
ngOnInit
():
void
{
this
.
columns
=
this
.
_prepareRoutineTableData
.
prepareMatTableColumn
();
this
.
columns
=
this
.
_prepareRoutineTableData
.
prepareMatTableColumn
();
this
.
_getRoutines
();
this
.
routineType
=
this
.
route
.
snapshot
.
paramMap
.
get
(
'
type
'
)
as
string
;
this
.
_getRoutines
(
this
.
routineType
);
this
.
onRoutesChange
()
}
}
public
onRoutesChange
(){
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
const
newRoutineType
=
params
.
get
(
'
type
'
);
if
(
newRoutineType
!==
this
.
routineType
)
{
this
.
routineType
=
newRoutineType
as
string
;
this
.
_getRoutines
(
this
.
routineType
);
}
});
}
public
addRoutine
():
void
{
public
addRoutine
():
void
{
this
.
_dialog
.
open
(
ManageComponent
,
{
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
''
,
data
:
this
.
routineType
,
...
this
.
_matDialogConfig
.
matModalConfig
()
...
this
.
_matDialogConfig
.
matModalConfig
()
});
});
}
}
public
emitViewFromTable
(
emitData
:
RoutineTable
)
{
public
emitViewFromTable
(
emitData
:
RoutineTable
)
{
let
docLink
=
emitData
.
schedule
.
replace
(
'
BASE_URL
'
,
TransmissionMapperService
.
DEV_TRANSMISSION_URL
);
let
docLink
=
emitData
.
document
.
replace
(
'
BASE_URL
'
,
TransmissionMapperService
.
DEV_TRANSMISSION_URL
);
window
.
open
(
docLink
,
'
_blank
'
);
window
.
open
(
docLink
,
'
_blank
'
);
}
}
...
@@ -77,8 +102,8 @@ export class RoutineComponent {
...
@@ -77,8 +102,8 @@ export class RoutineComponent {
(
response
)
=>
{
},
(
response
)
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
(
response
:
RaintreeResponse
)
=>
{
this
.
_toaster
.
success
(
"
Routine is deleted successfully
"
,
'
o
k
'
);
this
.
_toaster
.
success
(
"
Routine is deleted successfully
"
,
'
O
k
'
);
this
.
_getRoutines
();
this
.
_getRoutines
(
this
.
routineType
);
},
},
(
error
)
=>
{
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -88,20 +113,21 @@ export class RoutineComponent {
...
@@ -88,20 +113,21 @@ export class RoutineComponent {
}
}
private
_getRoutines
(
routineType
:
string
):
void
{
private
_getRoutines
():
void
{
this
.
_routineTransmission
.
getRoutine
(
this
.
_routineTransmission
.
getRoutine
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
ROUTINE_DATA_SOURCE_ID
,
datasourceId
:
DataSourceService
.
ROUTINE_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
dontIncludeForeignKey
:
false
,
expand
:
fals
e
,
expand
:
tru
e
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
language
:
"
en
"
,
limit
:
10
,
limit
:
10
,
orderBy
:
"
ASC
"
,
orderBy
:
"
ASC
"
,
page
:
1
,
page
:
1
,
roleBasedFiltering
:
true
fieldName
:
`
${
this
.
_urlConfig
.
getFiledNameFilter
(
'
routine
'
)}
,routine_type`
,
operators
:
`
${
this
.
_urlConfig
.
getFieldOperatorFilter
(
'
routine
'
)}
,eq`
,
fieldValues
:
`
${
this
.
_urlConfig
.
getFieldValuesFilter
(
'
routine
'
)}
,
${
routineType
===
'
class
'
?
'
class_routine
'
:
'
exam_routine
'
}
`
,
}),
}),
()
=>
{
},
()
=>
{
},
(
response
)
=>
{
},
(
response
)
=>
{
},
...
...
src/app/portal/routine/service/prepare-routine-table-data.service.ts
View file @
7b70909f
...
@@ -20,8 +20,9 @@ export class PrepareRoutineTableDataService {
...
@@ -20,8 +20,9 @@ export class PrepareRoutineTableDataService {
session_session_name
:
routine
.
session_session_name
?.
en
,
session_session_name
:
routine
.
session_session_name
?.
en
,
class_details
:
routine
.
class_details
?.
en
,
class_details
:
routine
.
class_details
?.
en
,
section_details
:
routine
.
section_details
?.
en
,
section_details
:
routine
.
section_details
?.
en
,
document
:
routine
.
document
.
en
,
routine_type
:
routine
.
routine_type
.
en
,
routine_type
:
routine
.
routine_type
.
en
,
schedule
:
routine
.
schedule
.
en
,
details
:
routine
.
details
[
'
en
'
]
,
action
:
[
'
view
'
,
'
delete
'
]
action
:
[
'
view
'
,
'
delete
'
]
}
}
})
})
...
@@ -35,7 +36,7 @@ export class PrepareRoutineTableDataService {
...
@@ -35,7 +36,7 @@ export class PrepareRoutineTableDataService {
let
columnArray
=
[
let
columnArray
=
[
{
key
:
'
class_details
'
,
label
:
'
Class
'
},
{
key
:
'
class_details
'
,
label
:
'
Class
'
},
{
key
:
'
section_details
'
,
label
:
'
Section
'
},
{
key
:
'
section_details
'
,
label
:
'
Section
'
},
{
key
:
'
routine_type
'
,
label
:
'
Type
'
},
{
key
:
'
details
'
,
label
:
'
Details
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
];
...
...
src/app/portal/service/data-source.service.ts
View file @
7b70909f
...
@@ -33,4 +33,10 @@ export class DataSourceService {
...
@@ -33,4 +33,10 @@ export class DataSourceService {
public
static
readonly
SECTION_DATA_SOURCE_ID
:
number
=
3013
;
public
static
readonly
SECTION_DATA_SOURCE_ID
:
number
=
3013
;
public
static
readonly
CLASS_SECTION_SUBJECT_DATA_SOURCE_ID
:
number
=
3016
;
public
static
readonly
CLASS_SECTION_SUBJECT_DATA_SOURCE_ID
:
number
=
3016
;
public
static
readonly
SESSION_ID
:
string
=
'
86af4d6b5675a82df4581f00c67f0c7f
'
;
}
}
src/app/portal/service/url-config.service.ts
View file @
7b70909f
import
{
inject
,
Injectable
}
from
'
@angular/core
'
;
import
{
inject
,
Injectable
}
from
'
@angular/core
'
;
import
{
AuthService
}
from
'
../../auth/service/auth.service
'
;
import
{
AuthService
}
from
'
../../auth/service/auth.service
'
;
import
{
DataSourceService
}
from
'
./data-source.service
'
;
@
Injectable
({
@
Injectable
({
providedIn
:
'
root
'
providedIn
:
'
root
'
...
@@ -16,9 +17,9 @@ export class UrlConfigService {
...
@@ -16,9 +17,9 @@ export class UrlConfigService {
public
getFiledNameFilter
(
type
:
string
):
string
{
public
getFiledNameFilter
(
type
:
string
):
string
{
let
fieldName
=
''
;
let
fieldName
=
''
;
// let fieldValues = '';
// let fieldOperator = ''
switch
(
type
)
{
if
(
type
===
'
assignment
'
)
{
case
'
assignment
'
:
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
...
@@ -29,14 +30,30 @@ export class UrlConfigService {
...
@@ -29,14 +30,30 @@ export class UrlConfigService {
fieldName
=
"
school,section_class,section
"
;
fieldName
=
"
school,section_class,section
"
;
}
}
break
;
case
'
routine
'
:
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
fieldName
=
"
session,school,section_teacher
"
;
}
else
if
(
this
.
authService
.
getUserRole
()
===
'
Parent
'
)
{
fieldName
=
"
section,session,school
"
;
}
break
;
}
}
return
fieldName
;
return
fieldName
;
}
}
public
getFieldOperatorFilter
(
type
:
string
):
string
{
public
getFieldOperatorFilter
(
type
:
string
):
string
{
let
fieldOperator
=
''
let
fieldOperator
=
''
if
(
type
===
'
assignment
'
)
{
switch
(
type
)
{
case
'
assignment
'
:
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
...
@@ -47,6 +64,19 @@ export class UrlConfigService {
...
@@ -47,6 +64,19 @@ export class UrlConfigService {
fieldOperator
=
'
eq,eq,eq
'
;
fieldOperator
=
'
eq,eq,eq
'
;
}
}
break
;
case
'
routine
'
:
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
fieldOperator
=
"
eq,eq,eq
"
;
}
else
if
(
this
.
authService
.
getUserRole
()
===
'
Parent
'
)
{
fieldOperator
=
"
eq,eq,eq
"
;
}
break
;
}
}
return
fieldOperator
;
return
fieldOperator
;
...
@@ -56,7 +86,8 @@ export class UrlConfigService {
...
@@ -56,7 +86,8 @@ export class UrlConfigService {
let
fieldValues
=
''
;
let
fieldValues
=
''
;
if
(
type
===
'
assignment
'
)
{
switch
(
type
)
{
case
'
assignment
'
:
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
...
@@ -64,10 +95,22 @@ export class UrlConfigService {
...
@@ -64,10 +95,22 @@ export class UrlConfigService {
}
else
if
(
this
.
authService
.
getUserRole
()
===
'
Parent
'
)
{
}
else
if
(
this
.
authService
.
getUserRole
()
===
'
Parent
'
)
{
fieldValues
=
`
${
localStorage
.
getItem
(
'
student_school_id
'
)}
,
${
localStorage
.
getItem
(
'
student_class_id
'
)}
,
${
localStorage
.
getItem
(
'
student_section_id
'
)}
`
;
fieldValues
=
`
${
localStorage
.
getItem
(
'
student_school_id
'
)}
,
${
localStorage
.
getItem
(
'
student_class_id
'
)}
,
${
localStorage
.
getItem
(
'
student_section_id
'
)}
`
;
}
}
break
;
case
'
routine
'
:
if
(
this
.
authService
.
getUserRole
()
===
'
Teacher
'
)
{
fieldValues
=
`
${
DataSourceService
.
SESSION_ID
}
,
${
localStorage
.
getItem
(
'
school_id
'
)}
,
${
this
.
authService
.
localStorageGetItemByKey
(
'
user_id
'
)}
`
;
}
else
if
(
this
.
authService
.
getUserRole
()
===
'
Parent
'
)
{
fieldValues
=
`
${
localStorage
.
getItem
(
'
student_section_id
'
)}
,
${
DataSourceService
.
SESSION_ID
}
,
${
localStorage
.
getItem
(
'
student_school_id
'
)}
`
;
}
break
;
}
}
return
fieldValues
;
return
fieldValues
;
...
...
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