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
7518dedf
Commit
7518dedf
authored
Apr 05, 2025
by
achinta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: assignment add and delete
parent
df9761a5
Changes
28
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
963 additions
and
96 deletions
+963
-96
src/app/auth/service/auth.service.ts
src/app/auth/service/auth.service.ts
+5
-2
src/app/component-library/file-input/file-input.component.html
...pp/component-library/file-input/file-input.component.html
+0
-2
src/app/component-library/file-input/file-input.component.ts
src/app/component-library/file-input/file-input.component.ts
+5
-2
src/app/mappers/transmission-mapper.service.ts
src/app/mappers/transmission-mapper.service.ts
+3
-0
src/app/portal/assignment/assignment/assignment.component.ts
src/app/portal/assignment/assignment/assignment.component.ts
+37
-22
src/app/portal/assignment/interface/assignment.ts
src/app/portal/assignment/interface/assignment.ts
+7
-6
src/app/portal/assignment/manage/manage.component.html
src/app/portal/assignment/manage/manage.component.html
+69
-1
src/app/portal/assignment/manage/manage.component.scss
src/app/portal/assignment/manage/manage.component.scss
+10
-0
src/app/portal/assignment/manage/manage.component.ts
src/app/portal/assignment/manage/manage.component.ts
+304
-4
src/app/portal/assignment/service/prepare-assignment-table-data.service.ts
...signment/service/prepare-assignment-table-data.service.ts
+8
-6
src/app/portal/data-source/interface/data.ts
src/app/portal/data-source/interface/data.ts
+2
-2
src/app/portal/data-source/interface/subject.ts
src/app/portal/data-source/interface/subject.ts
+15
-0
src/app/portal/exam/exam/exam.component.ts
src/app/portal/exam/exam/exam.component.ts
+28
-4
src/app/portal/exam/interface/exam-schedule.ts
src/app/portal/exam/interface/exam-schedule.ts
+4
-2
src/app/portal/exam/interface/exam-table.ts
src/app/portal/exam/interface/exam-table.ts
+9
-0
src/app/portal/exam/manage/manage.component.html
src/app/portal/exam/manage/manage.component.html
+60
-1
src/app/portal/exam/manage/manage.component.scss
src/app/portal/exam/manage/manage.component.scss
+10
-0
src/app/portal/exam/manage/manage.component.ts
src/app/portal/exam/manage/manage.component.ts
+207
-7
src/app/portal/exam/service/prepare-exam-table-data.service.ts
...pp/portal/exam/service/prepare-exam-table-data.service.ts
+8
-7
src/app/portal/routine/manage/manage.component.ts
src/app/portal/routine/manage/manage.component.ts
+7
-8
src/app/portal/routine/routine/routine.component.ts
src/app/portal/routine/routine/routine.component.ts
+29
-4
src/app/portal/service/data-source.service.ts
src/app/portal/service/data-source.service.ts
+9
-3
src/app/raintree/transmission/assignment-transmission.service.ts
.../raintree/transmission/assignment-transmission.service.ts
+24
-2
src/app/raintree/transmission/class-transmission.service.ts
src/app/raintree/transmission/class-transmission.service.ts
+25
-4
src/app/raintree/transmission/delete-record-transmission.service.spec.ts
...e/transmission/delete-record-transmission.service.spec.ts
+16
-0
src/app/raintree/transmission/delete-record-transmission.service.ts
...intree/transmission/delete-record-transmission.service.ts
+30
-0
src/app/raintree/transmission/exam-schedule.service.ts
src/app/raintree/transmission/exam-schedule.service.ts
+21
-0
src/app/raintree/transmission/jwt.service.ts
src/app/raintree/transmission/jwt.service.ts
+11
-7
No files found.
src/app/auth/service/auth.service.ts
View file @
7518dedf
...
@@ -3,6 +3,7 @@ import { UserProfile } from '../interface/user-profile';
...
@@ -3,6 +3,7 @@ import { UserProfile } from '../interface/user-profile';
import
{
isPlatformBrowser
}
from
'
@angular/common
'
;
import
{
isPlatformBrowser
}
from
'
@angular/common
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
RequestMapperService
}
from
'
../../mappers/request-mapper.service
'
;
import
{
RequestMapperService
}
from
'
../../mappers/request-mapper.service
'
;
import
{
LogoutService
}
from
'
../../portal/navigation/service/logout.service
'
;
@
Injectable
({
@
Injectable
({
providedIn
:
'
root
'
providedIn
:
'
root
'
...
@@ -12,8 +13,10 @@ export class AuthService {
...
@@ -12,8 +13,10 @@ export class AuthService {
public
isBrowser
:
boolean
=
false
;
public
isBrowser
:
boolean
=
false
;
constructor
(
constructor
(
@
Inject
(
PLATFORM_ID
)
private
_platformId
:
Object
,
private
_router
:
Router
,
private
_router
:
Router
,
@
Inject
(
PLATFORM_ID
)
private
_platformId
:
Object
)
{
private
_logout
:
LogoutService
,
)
{
this
.
isBrowser
=
isPlatformBrowser
(
this
.
_platformId
);
this
.
isBrowser
=
isPlatformBrowser
(
this
.
_platformId
);
}
}
...
...
src/app/component-library/file-input/file-input.component.html
View file @
7518dedf
...
@@ -8,6 +8,4 @@
...
@@ -8,6 +8,4 @@
<input
type=
"text"
readonly
matInput
[value]=
"fileName"
/>
<input
type=
"text"
readonly
matInput
[value]=
"fileName"
/>
<input
type=
"file"
multiple
#f_input
(change)=
"onFileSelected($event)"
hidden
/>
<input
type=
"file"
multiple
#f_input
(change)=
"onFileSelected($event)"
hidden
/>
<mat-error
*ngIf=
"!selectedFiles().length"
>
This field is required
</mat-error>
</mat-form-field>
</mat-form-field>
\ No newline at end of file
src/app/component-library/file-input/file-input.component.ts
View file @
7518dedf
...
@@ -23,12 +23,15 @@ export class FileInputComponent {
...
@@ -23,12 +23,15 @@ export class FileInputComponent {
// Triggered when files are selected
// Triggered when files are selected
onFileSelected
(
event
:
Event
):
void
{
onFileSelected
(
event
:
Event
):
void
{
const
input
=
event
.
target
as
HTMLInputElement
;
const
input
=
event
.
target
as
HTMLInputElement
;
if
(
input
.
files
)
{
if
(
input
.
files
)
{
this
.
selectedFiles
.
set
(
Array
.
from
(
input
.
files
));
// Update the signal
this
.
selectedFiles
.
set
(
Array
.
from
(
input
.
files
));
// Update the signal
this
.
filesChange
.
emit
(
this
.
selectedFiles
());
// Emit the event
this
.
filesChange
.
emit
(
this
.
selectedFiles
());
// Emit the event
console
.
log
(
input
.
files
[
0
].
name
);
this
.
fileName
=
input
.
files
[
0
].
name
this
.
fileName
=
input
.
files
[
0
].
name
}
}
}
}
...
...
src/app/mappers/transmission-mapper.service.ts
View file @
7518dedf
...
@@ -26,6 +26,9 @@ export class TransmissionMapperService {
...
@@ -26,6 +26,9 @@ export class TransmissionMapperService {
public
static
readonly
FILE_UPLOAD_TRANSMISSION_URL
:
string
=
public
static
readonly
FILE_UPLOAD_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/uploadFile?
'
;
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/uploadFile?
'
;
public
static
readonly
DELETE_RECORD_TRANSMISSION_URL
:
string
=
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
// 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 =
// public static readonly SCHEDULE_OF_RATES_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// TransmissionMapperService.DEV_TRANSMISSION_URL +
...
...
src/app/portal/assignment/assignment/assignment.component.ts
View file @
7518dedf
...
@@ -12,6 +12,10 @@ import { PrepareAssignmentTableDataService } from '../service/prepare-assignment
...
@@ -12,6 +12,10 @@ import { PrepareAssignmentTableDataService } from '../service/prepare-assignment
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
}
from
'
@angular/common
'
;
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
import
{
MatDialogConfigService
}
from
'
../../service/mat-dialog-config.service
'
;
import
{
DeleteRecordTransmissionService
}
from
'
../../../raintree/transmission/delete-record-transmission.service
'
;
import
{
ToasterService
}
from
'
../../../component-library/toaster/toaster.service
'
;
@
Component
({
@
Component
({
selector
:
'
app-assignment
'
,
selector
:
'
app-assignment
'
,
...
@@ -30,10 +34,13 @@ export class AssignmentComponent implements OnInit {
...
@@ -30,10 +34,13 @@ export class AssignmentComponent implements OnInit {
private
_assignmentTransmission
:
AssignmentTransmissionService
,
private
_assignmentTransmission
:
AssignmentTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_urlConfig
:
UrlConfigService
,
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
,
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
,
public
authService
:
AuthService
public
matConfig
:
MatDialogConfigService
,
public
authService
:
AuthService
,
private
_deleteTransmission
:
DeleteRecordTransmissionService
,
private
_toaster
:
ToasterService
)
{
}
)
{
}
public
columns
:
any
[]
=
[];
public
columns
:
any
[]
=
[];
public
data
:
any
[]
=
[];
public
data
:
any
[]
=
[];
...
@@ -60,10 +67,10 @@ export class AssignmentComponent implements OnInit {
...
@@ -60,10 +67,10 @@ export class AssignmentComponent implements OnInit {
}),
}),
()
=>
{
},
()
=>
{
},
(
response
)
=>
{
},
(
response
)
=>
{
},
(
response
:
Assignments
Response
)
=>
{
(
response
:
Raintree
Response
)
=>
{
this
.
data
=
this
.
_prepareAssignmentTableData
.
prepareMatTableData
(
this
.
data
=
this
.
_prepareAssignmentTableData
.
prepareMatTableData
(
response
.
data
.
themeDataSourceFields
response
[
'
data
'
]
.
themeDataSourceFields
);
);
},
},
(
error
)
=>
{
(
error
)
=>
{
...
@@ -73,33 +80,41 @@ export class AssignmentComponent implements OnInit {
...
@@ -73,33 +80,41 @@ export class AssignmentComponent implements OnInit {
)
)
}
}
public
emitViewFromTable
(
clickedData
:
string
):
void
{
public
emitViewFromTable
(
emitData
:
any
):
void
{
alert
(
"
Have to view the doc in another page
"
);
let
docLink
=
emitData
.
document
.
replace
(
'
BASE_URL
'
,
TransmissionMapperService
.
DEV_TRANSMISSION_URL
);
window
.
open
(
docLink
,
'
_blank
'
);
}
}
public
emitDeleteFromTable
(
emitData
:
string
):
void
{
public
emitDeleteFromTable
(
emitData
:
any
):
void
{
if
(
!
confirm
(
"
Are you sure to delete ?
"
))
return
;
// this._dialog.open(ManageComponent, {
this
.
_deleteTransmission
.
deleteRecord
(
// data: emitData,
TransmissionMapperService
.
DELETE_RECORD_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
// width: '98vw',
dataSourceFieldId
:
`
${
emitData
.
id
}
`
,
// height: 'auto',
themeDataSourceId
:
DataSourceService
.
ASSIGNMENT_DATA_SOURCE_ID
,
// maxWidth: '70vw',
}),
// maxHeight: '70vh',
// });
alert
(
"
Have to Delete
"
);
()
=>
{
},
(
response
)
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
_toaster
.
success
(
"
Exam schedule is deleted successfully
"
,
'
ok
'
);
this
.
_getAssignments
();
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
}
public
addAssignment
():
void
{
public
addAssignment
():
void
{
// alert("hi")
this
.
_dialog
.
open
(
ManageComponent
,
{
this
.
_dialog
.
open
(
ManageComponent
,
{
data
:
''
,
data
:
''
,
width
:
'
98vw
'
,
...
this
.
matConfig
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
maxHeight
:
'
70vh
'
,
});
});
}
}
...
...
src/app/portal/assignment/interface/assignment.ts
View file @
7518dedf
...
@@ -4,21 +4,22 @@ import { LocalizedField } from "../../data-source/interface/localizedField";
...
@@ -4,21 +4,22 @@ import { LocalizedField } from "../../data-source/interface/localizedField";
// ThemeDataSourceField Interface
// ThemeDataSourceField Interface
export
interface
Assignments
extends
Data
{
export
interface
Assignments
extends
Data
{
themeDataSourceFields
:
Assignment
[];
themeDataSourceFields
:
Assignment
[];
dataSourceTypeFieldsList
?:
Assignment
[]
}
}
// ThemeDataSourceField Interface
// ThemeDataSourceField Interface
export
interface
Assignment
{
export
interface
Assignment
{
session
:
LocalizedField
;
id
:
string
;
session
?:
LocalizedField
;
subject
:
LocalizedField
;
subject
:
LocalizedField
;
assigned_on
:
LocalizedField
;
assigned_on
:
LocalizedField
;
last_submission_date
:
LocalizedField
;
last_submission_date
:
LocalizedField
;
section
:
LocalizedField
;
section
:
LocalizedField
;
docs
:
LocalizedField
;
docs
:
LocalizedField
;
class_subject
:
LocalizedField
;
class_subject
:
LocalizedField
;
session_session_name
:
LocalizedField
;
session_session_name
?:
LocalizedField
;
section_details
:
LocalizedField
;
section_details
?:
LocalizedField
;
id
:
string
;
subject_subject_name
?:
LocalizedField
;
subject_subject_name
:
LocalizedField
;
class_subject_subject_txt
?:
LocalizedField
;
class_subject_subject_txt
:
LocalizedField
;
}
}
src/app/portal/assignment/manage/manage.component.html
View file @
7518dedf
<pre>
{{ data | json }}
</pre>
<!-- <h1> Hi Manage </h1> -->
<div
class=
"container"
>
<form
class=
"routine_form"
[formGroup]=
"assignmentForm"
>
<div
class=
"mat_input_container"
>
<!-- <div class="class_dropdown mat_input">
<mat-form-field class="full_width">
<mat-label>Select Class</mat-label>
<mat-select formControlName="class">
@for (class of classDropDownData; track class) {
<mat-option [value]="class.value">{{class.name}}</mat-option>
}
</mat-select>
<mat-error>This field is required</mat-error>
</mat-form-field>
</div> -->
<div
class=
"section_dropdown mat_input"
>
<mat-form-field
class=
"full_width"
>
<mat-label>
Select Section
</mat-label>
<mat-select
formControlName=
"section"
>
@for (section of sectionDropDownData; track section) {
<mat-option
[value]=
"section.value"
>
{{section.name}}
</mat-option>
}
</mat-select>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<div
class=
"subject_dropdown mat_input"
>
<mat-form-field
class=
"full_width"
>
<mat-label>
Select Subject
</mat-label>
<mat-select
formControlName=
"subject"
>
@for (subject of subjectDropDownData; track subject) {
<mat-option
[value]=
"subject.value"
>
{{subject.name}}
</mat-option>
}
</mat-select>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<div
class=
"date_picker mat_input"
>
<mat-form-field
class=
"full_width"
>
<mat-label>
Choose a date
</mat-label>
<input
matInput
[matDatepicker]=
"picker"
formControlName=
"lastDate"
/>
<mat-hint>
MM/DD/YYYY
</mat-hint>
<mat-datepicker-toggle
matIconSuffix
[for]=
"picker"
></mat-datepicker-toggle>
<mat-datepicker
#picker
></mat-datepicker>
</mat-form-field>
</div>
<div
class=
"file_upload mat_input"
>
<app-file-input
[label]=
"'Upload Document'"
(filesChange)=
"onFilesChanged($event)"
/>
<mat-error
*ngIf=
"!assignmentForm.value.document"
>
This field is required
</mat-error>
</div>
</div>
<div
class=
"add_btn"
>
<app-square-button
[buttonIcon]=
"''"
[buttonText]=
"'submit'"
(emitSquareButtonClick)=
"submitAssignment()"
/>
</div>
</form>
</div>
\ No newline at end of file
src/app/portal/assignment/manage/manage.component.scss
View file @
7518dedf
.container
{
padding
:
10px
;
}
.add_btn
{
float
:
right
;
}
.mat_input
{
margin-bottom
:
5px
;
}
src/app/portal/assignment/manage/manage.component.ts
View file @
7518dedf
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
CommonModule
,
DatePipe
}
from
'
@angular/common
'
;
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
FormControl
,
FormGroup
,
ReactiveFormsModule
,
Validators
}
from
'
@angular/forms
'
;
import
{
MAT_DIALOG_DATA
}
from
'
@angular/material/dialog
'
;
import
{
MAT_DIALOG_DATA
}
from
'
@angular/material/dialog
'
;
import
{
MatFormFieldModule
}
from
'
@angular/material/form-field
'
;
import
{
MatIconModule
}
from
'
@angular/material/icon
'
;
import
{
MatSelectModule
}
from
'
@angular/material/select
'
;
import
{
FileInputComponent
}
from
'
../../../component-library/file-input/file-input.component
'
;
import
{
SquareButtonComponent
}
from
'
../../../component-library/square-button/square-button.component
'
;
import
{
Dropdown
}
from
'
../../../component-library/dropdown/interface/dropdown
'
;
import
{
FileUploadTransmissionService
}
from
'
../../../raintree/transmission/file-upload-transmission.service
'
;
import
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
import
{
ToasterService
}
from
'
../../../component-library/toaster/toaster.service
'
;
import
{
AssignmentTransmissionService
}
from
'
../../../raintree/transmission/assignment-transmission.service
'
;
import
{
ClassTransmissionService
}
from
'
../../../raintree/transmission/class-transmission.service
'
;
import
{
UrlConfigService
}
from
'
../../service/url-config.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
StudentSection
}
from
'
../../data-source/interface/section
'
;
import
{
Assignments
}
from
'
../interface/assignment
'
;
import
{
subject
}
from
'
../../data-source/interface/subject
'
;
import
{
MatDatepickerModule
}
from
'
@angular/material/datepicker
'
;
import
{
MatNativeDateModule
,
provideNativeDateAdapter
}
from
'
@angular/material/core
'
;
import
{
MatInputModule
}
from
'
@angular/material/input
'
;
@
Component
({
@
Component
({
selector
:
'
app-manage
'
,
selector
:
'
app-manage
'
,
imports
:
[
CommonModule
],
imports
:
[
CommonModule
,
MatIconModule
,
MatFormFieldModule
,
MatSelectModule
,
ReactiveFormsModule
,
FileInputComponent
,
MatDatepickerModule
,
MatInputModule
,
SquareButtonComponent
,
MatNativeDateModule
,
],
standalone
:
true
,
providers
:
[
provideNativeDateAdapter
(),
DatePipe
],
templateUrl
:
'
./manage.component.html
'
,
templateUrl
:
'
./manage.component.html
'
,
styleUrl
:
'
./manage.component.scss
'
styleUrl
s
:
[
'
./manage.component.scss
'
],
})
})
export
class
ManageComponent
{
export
class
ManageComponent
{
constructor
(
constructor
(
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
,
){}
private
_fileUpload
:
FileUploadTransmissionService
,
private
_auth
:
AuthService
,
private
_assignmentTransmission
:
AssignmentTransmissionService
,
private
_classTransmission
:
ClassTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_toaster
:
ToasterService
,
private
_datePipe
:
DatePipe
)
{
}
// public classDropDownData: Dropdown[] = [];
public
subjectDropDownData
:
Dropdown
[]
=
[];
public
sectionDropDownData
:
Dropdown
[]
=
[];
public
assignmentForm
=
new
FormGroup
({
// class: new FormControl("", [Validators.required]),
section
:
new
FormControl
(
""
,
[
Validators
.
required
]),
subject
:
new
FormControl
(
""
,
[
Validators
.
required
]),
lastDate
:
new
FormControl
(
""
,
[
Validators
.
required
]),
document
:
new
FormControl
(
""
),
});
ngOnInit
():
void
{
// this._getClasses();
this
.
_getSection
();
this
.
_getSubject
();
}
public
onFilesChanged
(
files
:
File
[]):
void
{
const
formData
=
new
FormData
();
files
.
forEach
(
file
=>
formData
.
append
(
'
file
'
,
file
,
file
.
name
));
this
.
_fileUpload
.
uploadFile
(
TransmissionMapperService
.
FILE_UPLOAD_TRANSMISSION_URL
+
`websiteId=
${
this
.
_auth
.
localStorageGetItemByKey
(
'
project_id
'
)}
`
,
formData
,
()
=>
{
},
()
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
assignmentForm
.
value
.
document
=
`
${
TransmissionMapperService
.
DEV_TRANSMISSION_URL
}
/webomagic/getFile?fid=
${
response
[
'
data
'
]}
`
this
.
_toaster
.
success
(
response
.
message
,
'
Ok
'
)
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
public
submitAssignment
():
void
{
// console.log(this._prepareAddAssignmentPayload());
// return
if
(
this
.
assignmentForm
.
invalid
)
return
;
this
.
_assignmentTransmission
.
addAssignment
(
TransmissionMapperService
.
SAVE_TRANSMISSION_URL
+
`websiteId=
${
this
.
_auth
.
localStorageGetItemByKey
(
'
project_id
'
)}
`
,
this
.
_prepareAddAssignmentPayload
(),
()
=>
{
},
()
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
_toaster
.
success
(
"
Assignment added successfully
"
,
'
Done
'
);
window
.
location
.
reload
();
},
(
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
_getSubject
()
{
this
.
_classTransmission
.
getSubject
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
SUBJECT_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
100
,
orderBy
:
"
ASC
"
,
page
:
1
,
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
subjectDropDownData
=
response
[
'
data
'
][
"
themeDataSourceFields
"
].
map
(
(
sSubject
:
subject
)
=>
{
return
{
[
"
name
"
]:
sSubject
.
subject_name
[
"
en
"
],
[
"
value
"
]:
sSubject
.
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
:
RaintreeResponse
)
=>
{
this
.
sectionDropDownData
=
response
[
'
data
'
][
"
themeDataSourceFields
"
].
map
(
(
sSection
:
StudentSection
)
=>
{
return
{
[
"
name
"
]:
sSection
.
section
[
"
en
"
],
[
"
value
"
]:
sSection
.
id
,
};
}
);
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
);
}
private
_prepareAddAssignmentPayload
():
Assignments
{
return
{
themeDataSourceFields
:
[
{
id
:
""
,
section
:
{
en
:
`
${
this
.
assignmentForm
.
value
.
section
}
`
,
beng
:
`
${
this
.
assignmentForm
.
value
.
section
}
`
,
hindi
:
`
${
this
.
assignmentForm
.
value
.
section
}
`
,
},
class_subject
:
{
en
:
``
,
beng
:
``
,
hindi
:
``
,
},
assigned_on
:
{
en
:
""
,
beng
:
""
,
hindi
:
""
,
},
last_submission_date
:
{
en
:
`
${
this
.
_datePipe
.
transform
(
this
.
assignmentForm
.
value
.
lastDate
,
'
yyyy-MM-dd
'
)}
`
,
beng
:
`
${
this
.
_datePipe
.
transform
(
this
.
assignmentForm
.
value
.
lastDate
,
'
yyyy-MM-dd
'
)}
`
,
hindi
:
`
${
this
.
_datePipe
.
transform
(
this
.
assignmentForm
.
value
.
lastDate
,
'
yyyy-MM-dd
'
)}
`
,
},
docs
:
{
en
:
`
${
this
.
assignmentForm
.
value
.
document
}
`
,
beng
:
`
${
this
.
assignmentForm
.
value
.
document
}
`
,
hindi
:
`
${
this
.
assignmentForm
.
value
.
document
}
`
,
},
subject
:
{
en
:
`
${
this
.
assignmentForm
.
value
.
subject
}
`
,
beng
:
`
${
this
.
assignmentForm
.
value
.
subject
}
`
,
hindi
:
`
${
this
.
assignmentForm
.
value
.
subject
}
`
,
},
},
],
dataSourceName
:
DataSourceService
.
ASSIGNMENT_DATA_SOURCE_NAME
,
id
:
`
${
DataSourceService
.
ASSIGNMENT_DATA_SOURCE_ID
}
`
,
type
:
`
${
DataSourceService
.
ASSIGNMENT_DATA_SOURCE_TYPE
}
`
,
themeId
:
`
${
this
.
_auth
.
localStorageGetItemByKey
(
'
project_id
'
)}
`
,
slideLst
:
null
,
heading
:
"
undefined
"
,
dataSourceTypeFieldsList
:
[
{
id
:
""
,
section
:
{
en
:
`
${
this
.
assignmentForm
.
value
.
section
}
`
,
beng
:
`
${
this
.
assignmentForm
.
value
.
section
}
`
,
hindi
:
`
${
this
.
assignmentForm
.
value
.
section
}
`
,
},
class_subject
:
{
en
:
``
,
beng
:
``
,
hindi
:
``
,
},
assigned_on
:
{
en
:
""
,
beng
:
""
,
hindi
:
""
,
},
last_submission_date
:
{
en
:
`
${
this
.
_datePipe
.
transform
(
this
.
assignmentForm
.
value
.
lastDate
,
'
yyyy-MM-dd
'
)}
`
,
beng
:
`
${
this
.
_datePipe
.
transform
(
this
.
assignmentForm
.
value
.
lastDate
,
'
yyyy-MM-dd
'
)}
`
,
hindi
:
`
${
this
.
_datePipe
.
transform
(
this
.
assignmentForm
.
value
.
lastDate
,
'
yyyy-MM-dd
'
)}
`
,
},
docs
:
{
en
:
`
${
this
.
assignmentForm
.
value
.
document
}
`
,
beng
:
`
${
this
.
assignmentForm
.
value
.
document
}
`
,
hindi
:
`
${
this
.
assignmentForm
.
value
.
document
}
`
,
},
subject
:
{
en
:
`
${
this
.
assignmentForm
.
value
.
subject
}
`
,
beng
:
`
${
this
.
assignmentForm
.
value
.
subject
}
`
,
hindi
:
`
${
this
.
assignmentForm
.
value
.
subject
}
`
,
},
},
],
count
:
0
,
favourite
:
true
};
}
}
}
src/app/portal/assignment/service/prepare-assignment-table-data.service.ts
View file @
7518dedf
...
@@ -14,10 +14,12 @@ export class PrepareAssignmentTableDataService {
...
@@ -14,10 +14,12 @@ export class PrepareAssignmentTableDataService {
return
{
return
{
[
'
id
'
]:
assignment
.
id
,
[
'
id
'
]:
assignment
.
id
,
[
'
subject
'
]:
assignment
.
class_subject_subject_txt
[
'
en
'
],
[
'
subject
'
]:
assignment
.
subject_subject_name
?.
en
,
[
'
section_details
'
]:
assignment
.
section_details
[
'
en
'
],
[
'
section_details
'
]:
assignment
.
section_details
?.
en
,
[
'
session_name
'
]:
assignment
.
session_session_name
[
'
en
'
],
[
'
session_name
'
]:
assignment
.
session_session_name
?.
en
,
[
'
assigned_on
'
]:
assignment
.
assigned_on
[
'
en
'
],
[
'
assigned_on
'
]:
assignment
.
assigned_on
?.
en
,
[
'
last_date
'
]:
assignment
.
last_submission_date
[
'
en
'
],
[
'
document
'
]:
assignment
.
docs
[
'
en
'
],
[
'
action
'
]:
[
'
view
'
,
'
delete
'
]
[
'
action
'
]:
[
'
view
'
,
'
delete
'
]
}
}
})
})
...
@@ -29,9 +31,9 @@ export class PrepareAssignmentTableDataService {
...
@@ -29,9 +31,9 @@ export class PrepareAssignmentTableDataService {
public
prepareMatTableColumn
():
any
[]
{
public
prepareMatTableColumn
():
any
[]
{
let
columnArray
=
[
let
columnArray
=
[
{
key
:
'
section_details
'
,
label
:
'
Class
'
},
{
key
:
'
section_details
'
,
label
:
'
Section
'
},
{
key
:
'
subject
'
,
label
:
'
Subject
'
},
{
key
:
'
subject
'
,
label
:
'
Subject
'
},
{
key
:
'
assigned_on
'
,
label
:
'
Date
'
},
{
key
:
'
last_date
'
,
label
:
'
Last
Date
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
];
...
...
src/app/portal/data-source/interface/data.ts
View file @
7518dedf
...
@@ -2,7 +2,7 @@ import { ForeignKeyMap } from "./foreignKeyMap";
...
@@ -2,7 +2,7 @@ import { ForeignKeyMap } from "./foreignKeyMap";
// Data Interface
// Data Interface
export
interface
Data
{
export
interface
Data
{
count
:
number
;
count
?
:
number
;
id
:
number
|
string
;
id
:
number
|
string
;
dataSourceName
:
string
;
dataSourceName
:
string
;
websiteId
?:
number
;
websiteId
?:
number
;
...
@@ -10,7 +10,7 @@ export interface Data {
...
@@ -10,7 +10,7 @@ export interface Data {
foreignKeyMapping
?:
any
;
foreignKeyMapping
?:
any
;
foreignKeyMap
?:
ForeignKeyMap
;
foreignKeyMap
?:
ForeignKeyMap
;
requiredPresentationField
?:
string
;
requiredPresentationField
?:
string
;
favourite
:
boolean
;
favourite
?
:
boolean
;
icon
?:
string
;
icon
?:
string
;
dependentFields
?:
any
;
dependentFields
?:
any
;
dsType
?:
any
;
dsType
?:
any
;
...
...
src/app/portal/data-source/interface/subject.ts
0 → 100644
View file @
7518dedf
import
{
Data
}
from
"
./data
"
;
import
{
LocalizedField
}
from
"
./localizedField
"
;
// ThemeDataSourceField Interface
export
interface
Subjects
extends
Data
{
themeDataSourceFields
:
subject
[];
}
// ThemeDataSourceField Interface
export
interface
subject
{
id
:
string
;
subject_name
:
LocalizedField
;
}
src/app/portal/exam/exam/exam.component.ts
View file @
7518dedf
...
@@ -12,6 +12,9 @@ import { PrepareExamTableDataService } from '../service/prepare-exam-table-data.
...
@@ -12,6 +12,9 @@ import { PrepareExamTableDataService } from '../service/prepare-exam-table-data.
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
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
{
ExamTable
}
from
'
../interface/exam-table
'
;
import
{
ToasterService
}
from
'
../../../component-library/toaster/toaster.service
'
;
@
Component
({
@
Component
({
selector
:
'
app-exam
'
,
selector
:
'
app-exam
'
,
...
@@ -27,11 +30,13 @@ export class ExamComponent {
...
@@ -27,11 +30,13 @@ export class ExamComponent {
constructor
(
constructor
(
private
_dialog
:
MatDialog
,
private
_dialog
:
MatDialog
,
private
_examSchedule
:
ExamScheduleService
,
private
_examSchedule
:
ExamScheduleService
,
private
_urlConfig
:
UrlConfigService
,
private
_urlConfig
:
UrlConfigService
,
private
_prepareExamTableData
:
PrepareExamTableDataService
,
private
_prepareExamTableData
:
PrepareExamTableDataService
,
private
_matDialogConfig
:
MatDialogConfigService
,
private
_matDialogConfig
:
MatDialogConfigService
,
public
authService
:
AuthService
private
_deleteTransmission
:
DeleteRecordTransmissionService
,
public
_toaster
:
ToasterService
,
public
authService
:
AuthService
)
{
}
)
{
}
public
columns
:
any
=
[];
public
columns
:
any
=
[];
...
@@ -50,9 +55,28 @@ export class ExamComponent {
...
@@ -50,9 +55,28 @@ export class ExamComponent {
window
.
open
(
docLink
,
'
_blank
'
);
window
.
open
(
docLink
,
'
_blank
'
);
}
}
public
emitDeleteFromTable
(
emitData
:
string
):
void
{
public
emitDeleteFromTable
(
emitData
:
any
):
void
{
alert
(
"
Should delete !!
"
)
if
(
!
confirm
(
"
Are you sure to delete ?
"
))
return
;
this
.
_deleteTransmission
.
deleteRecord
(
TransmissionMapperService
.
DELETE_RECORD_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
dataSourceFieldId
:
`
${
emitData
.
id
}
`
,
themeDataSourceId
:
DataSourceService
.
EXAM_SCHEDULE_DATA_SOURCE_ID
,
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
_toaster
.
success
(
"
Exam schedule is deleted successfully
"
,
'
ok
'
);
this
.
_getExamSchedule
();
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
}
...
...
src/app/portal/exam/interface/exam-schedule.ts
View file @
7518dedf
...
@@ -6,6 +6,8 @@ import { LocalizedField } from "../../data-source/interface/localizedField";
...
@@ -6,6 +6,8 @@ import { LocalizedField } from "../../data-source/interface/localizedField";
export
interface
ExamSchedules
extends
Data
{
export
interface
ExamSchedules
extends
Data
{
themeDataSourceFields
:
ExamSchedule
[];
themeDataSourceFields
:
ExamSchedule
[];
dataSourceTypeFieldsList
?:
ExamSchedule
[]
}
}
// ThemeDataSourceField Interface
// ThemeDataSourceField Interface
...
@@ -16,7 +18,7 @@ export interface ExamSchedule {
...
@@ -16,7 +18,7 @@ export interface ExamSchedule {
image
:
LocalizedField
;
image
:
LocalizedField
;
details
:
LocalizedField
;
details
:
LocalizedField
;
class
:
LocalizedField
;
class
:
LocalizedField
;
session_session_name
:
LocalizedField
;
session_session_name
?
:
LocalizedField
;
class_details
:
LocalizedField
;
class_details
?
:
LocalizedField
;
}
}
src/app/portal/exam/interface/exam-table.ts
0 → 100644
View file @
7518dedf
export
interface
ExamTable
{
id
:
string
;
class_details
?:
string
,
details
:
string
;
term
:
string
;
image
:
string
;
action
:
string
[]
}
\ No newline at end of file
src/app/portal/exam/manage/manage.component.html
View file @
7518dedf
<pre>
{{data|json}}
</pre>
<!-- <h1> Hi Manage </h1> -->
\ No newline at end of file
<div
class=
"container"
>
<form
class=
"routine_form"
[formGroup]=
"examScheduleForm"
>
<div
class=
"mat_input_container"
>
<div
class=
"class_dropdown mat_input"
>
<mat-form-field
class=
"full_width"
>
<mat-label>
Select Class
</mat-label>
<mat-select
formControlName=
"class"
>
@for (class of classDropDownData; track class) {
<mat-option
[value]=
"class.value"
>
{{class.name}}
</mat-option>
}
</mat-select>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<div
class=
"section_dropdown mat_input"
>
<mat-form-field
class=
"full_width"
>
<mat-label>
Select Term
</mat-label>
<mat-select
formControlName=
"term"
>
<mat-option
value=
"First term"
>
First term
</mat-option>
<mat-option
value=
"Last term"
>
Last term
</mat-option>
</mat-select>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<div
class=
"details_input mat_input"
>
<mat-form-field
class=
"full_width"
>
<mat-label>
Details
</mat-label>
<input
matInput
placeholder=
"Details"
#input
formControlName=
"details"
/>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<div
class=
"file_upload mat_input"
>
<app-file-input
[label]=
"'Upload Document'"
(filesChange)=
"onFilesChanged($event)"
/>
<mat-error
*ngIf=
"!examScheduleForm.value.document"
>
This field is required
</mat-error>
</div>
</div>
<div
class=
"add_btn"
>
<app-square-button
[buttonIcon]=
"''"
[buttonText]=
"'submit'"
(emitSquareButtonClick)=
"submitExamSchedule()"
/>
</div>
</form>
</div>
\ No newline at end of file
src/app/portal/exam/manage/manage.component.scss
View file @
7518dedf
.container
{
padding
:
10px
;
}
.add_btn
{
float
:
right
;
}
.mat_input
{
margin-bottom
:
5px
;
}
src/app/portal/exam/manage/manage.component.ts
View file @
7518dedf
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
CommonModule
}
from
"
@angular/common
"
;
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
Component
,
Inject
,
OnInit
}
from
"
@angular/core
"
;
import
{
MAT_DIALOG_DATA
}
from
'
@angular/material/dialog
'
;
import
{
FormControl
,
FormGroup
,
ReactiveFormsModule
,
Validators
}
from
"
@angular/forms
"
;
import
{
MAT_DIALOG_DATA
}
from
"
@angular/material/dialog
"
;
import
{
MatInputModule
}
from
"
@angular/material/input
"
;
import
{
MatSelectModule
}
from
"
@angular/material/select
"
;
import
{
FileInputComponent
}
from
"
../../../component-library/file-input/file-input.component
"
;
import
{
SquareButtonComponent
}
from
"
../../../component-library/square-button/square-button.component
"
;
import
{
FileUploadTransmissionService
}
from
"
../../../raintree/transmission/file-upload-transmission.service
"
;
import
{
TransmissionMapperService
}
from
"
../../../mappers/transmission-mapper.service
"
;
import
{
AuthService
}
from
"
../../../auth/service/auth.service
"
;
import
{
RaintreeResponse
}
from
"
../../../raintree/interface/raintree-response
"
;
import
{
ClassTransmissionService
}
from
"
../../../raintree/transmission/class-transmission.service
"
;
import
{
UrlConfigService
}
from
"
../../service/url-config.service
"
;
import
{
DataSourceService
}
from
"
../../service/data-source.service
"
;
import
{
classResponse
}
from
"
../../../raintree/interface/class-respons
"
;
import
{
Dropdown
}
from
"
../../../component-library/dropdown/interface/dropdown
"
;
import
{
StudentClass
}
from
"
../../data-source/interface/class
"
;
import
{
ExamScheduleService
}
from
"
../../../raintree/transmission/exam-schedule.service
"
;
import
{
ToasterService
}
from
"
../../../component-library/toaster/toaster.service
"
;
import
{
ExamSchedules
}
from
"
../interface/exam-schedule
"
;
@
Component
({
@
Component
({
selector
:
'
app-manage
'
,
selector
:
"
app-manage
"
,
imports
:
[
imports
:
[
CommonModule
CommonModule
,
MatInputModule
,
MatSelectModule
,
ReactiveFormsModule
,
FileInputComponent
,
SquareButtonComponent
,
],
],
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
:
any
,
private
_fileUpload
:
FileUploadTransmissionService
,
private
_auth
:
AuthService
,
private
_classTransmission
:
ClassTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_examScheduleTransmission
:
ExamScheduleService
,
public
toaster
:
ToasterService
)
{
}
)
{
}
public
classDropDownData
:
Dropdown
[]
=
[];
public
examScheduleForm
=
new
FormGroup
({
class
:
new
FormControl
(
""
,
[
Validators
.
required
]),
term
:
new
FormControl
(
""
,
[
Validators
.
required
]),
details
:
new
FormControl
(
""
,
[
Validators
.
required
]),
document
:
new
FormControl
(
""
,
[
Validators
.
required
]),
});
public
ngOnInit
():
void
{
this
.
_getClasses
();
}
public
onFilesChanged
(
files
:
File
[]):
void
{
const
formData
=
new
FormData
();
files
.
forEach
(
file
=>
formData
.
append
(
'
file
'
,
file
,
file
.
name
));
this
.
_fileUpload
.
uploadFile
(
TransmissionMapperService
.
FILE_UPLOAD_TRANSMISSION_URL
+
`websiteId=
${
this
.
_auth
.
localStorageGetItemByKey
(
'
project_id
'
)}
`
,
formData
,
()
=>
{
},
()
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
examScheduleForm
.
value
.
document
=
`
${
TransmissionMapperService
.
DEV_TRANSMISSION_URL
}
/webomagic/getFile?fid=
${
response
[
'
data
'
]}
`
this
.
toaster
.
success
(
response
.
message
,
'
Ok
'
)
},
(
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
:
RaintreeResponse
)
=>
{
this
.
classDropDownData
=
response
[
'
data
'
][
"
themeDataSourceFields
"
].
map
(
(
sClass
:
StudentClass
)
=>
{
return
{
[
"
name
"
]:
sClass
.
details
[
"
en
"
],
[
"
value
"
]:
sClass
.
id
,
};
}
);
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
);
}
public
submitExamSchedule
():
void
{
if
(
this
.
examScheduleForm
.
invalid
)
return
;
this
.
_examScheduleTransmission
.
addExamSchedule
(
TransmissionMapperService
.
SAVE_TRANSMISSION_URL
+
`websiteId=
${
this
.
_auth
.
localStorageGetItemByKey
(
'
project_id
'
)}
`
,
this
.
_prepareExamSchedulePayload
(),
()
=>
{
},
()
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
toaster
.
success
(
"
Exam schedule added successfully
"
,
'
Done
'
);
window
.
location
.
reload
();
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
);
}
private
_prepareExamSchedulePayload
():
ExamSchedules
{
return
{
"
themeDataSourceFields
"
:
[
{
"
id
"
:
""
,
"
session
"
:
{
"
en
"
:
""
,
"
beng
"
:
""
,
"
hindi
"
:
""
},
"
Term
"
:
{
"
en
"
:
`
${
this
.
examScheduleForm
.
value
.
term
}
`
,
"
beng
"
:
`
${
this
.
examScheduleForm
.
value
.
term
}
`
,
"
hindi
"
:
`
${
this
.
examScheduleForm
.
value
.
term
}
`
},
"
image
"
:
{
"
en
"
:
`
${
this
.
examScheduleForm
.
value
.
document
}
`
,
"
beng
"
:
`
${
this
.
examScheduleForm
.
value
.
document
}
`
,
"
hindi
"
:
`
${
this
.
examScheduleForm
.
value
.
document
}
`
},
"
details
"
:
{
"
en
"
:
`
${
this
.
examScheduleForm
.
value
.
details
}
`
,
"
beng
"
:
`
${
this
.
examScheduleForm
.
value
.
details
}
`
,
"
hindi
"
:
`
${
this
.
examScheduleForm
.
value
.
details
}
`
},
"
class
"
:
{
"
en
"
:
`
${
this
.
examScheduleForm
.
value
.
class
}
`
,
"
beng
"
:
`
${
this
.
examScheduleForm
.
value
.
class
}
`
,
"
hindi
"
:
`
${
this
.
examScheduleForm
.
value
.
class
}
`
}
}
],
"
dataSourceName
"
:
DataSourceService
.
EXAM_SCHEDULE_DATA_SOURCE_NAME
,
"
id
"
:
DataSourceService
.
EXAM_SCHEDULE_DATA_SOURCE_ID
,
"
type
"
:
`
${
DataSourceService
.
EXAM_SCHEDULE_DATA_SOURCE_TYPE
}
`
,
"
themeId
"
:
`
${
this
.
_auth
.
localStorageGetItemByKey
(
'
project_id
'
)}
`
,
"
slideLst
"
:
null
,
"
heading
"
:
"
undefined
"
,
"
dataSourceTypeFieldsList
"
:
[
{
"
id
"
:
""
,
"
session
"
:
{
"
en
"
:
""
,
"
beng
"
:
""
,
"
hindi
"
:
""
},
"
Term
"
:
{
"
en
"
:
`
${
this
.
examScheduleForm
.
value
.
term
}
`
,
"
beng
"
:
`
${
this
.
examScheduleForm
.
value
.
term
}
`
,
"
hindi
"
:
`
${
this
.
examScheduleForm
.
value
.
term
}
`
},
"
image
"
:
{
"
en
"
:
`
${
this
.
examScheduleForm
.
value
.
document
}
`
,
"
beng
"
:
`
${
this
.
examScheduleForm
.
value
.
document
}
`
,
"
hindi
"
:
`
${
this
.
examScheduleForm
.
value
.
document
}
`
},
"
details
"
:
{
"
en
"
:
`
${
this
.
examScheduleForm
.
value
.
details
}
`
,
"
beng
"
:
`
${
this
.
examScheduleForm
.
value
.
details
}
`
,
"
hindi
"
:
`
${
this
.
examScheduleForm
.
value
.
details
}
`
},
"
class
"
:
{
"
en
"
:
`
${
this
.
examScheduleForm
.
value
.
class
}
`
,
"
beng
"
:
`
${
this
.
examScheduleForm
.
value
.
class
}
`
,
"
hindi
"
:
`
${
this
.
examScheduleForm
.
value
.
class
}
`
}
}
]
};
}
}
}
src/app/portal/exam/service/prepare-exam-table-data.service.ts
View file @
7518dedf
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
ExamSchedule
}
from
'
../interface/exam-schedule
'
;
import
{
ExamSchedule
}
from
'
../interface/exam-schedule
'
;
import
{
ExamTable
}
from
'
../interface/exam-table
'
;
@
Injectable
({
@
Injectable
({
providedIn
:
'
root
'
providedIn
:
'
root
'
...
@@ -8,17 +9,17 @@ export class PrepareExamTableDataService {
...
@@ -8,17 +9,17 @@ export class PrepareExamTableDataService {
constructor
()
{
}
constructor
()
{
}
public
prepareMatTableData
(
data
:
ExamSchedule
[]):
any
{
public
prepareMatTableData
(
data
:
ExamSchedule
[]):
ExamTable
[]
{
let
dataArray
=
data
.
map
((
schedule
:
ExamSchedule
)
=>
{
let
dataArray
=
data
.
map
((
schedule
:
ExamSchedule
)
=>
{
return
{
return
{
[
'
id
'
]
:
schedule
.
id
,
id
:
schedule
.
id
,
[
'
class_details
'
]:
schedule
.
class_details
[
'
en
'
]
,
class_details
:
schedule
.
class_details
?.
en
,
[
'
details
'
]
:
schedule
.
details
[
'
en
'
],
details
:
schedule
.
details
[
'
en
'
],
[
'
term
'
]
:
schedule
.
Term
[
'
en
'
],
term
:
schedule
.
Term
[
'
en
'
],
[
'
image
'
]
:
schedule
.
image
[
'
en
'
],
image
:
schedule
.
image
[
'
en
'
],
[
'
action
'
]
:
[
'
view
'
,
'
delete
'
]
action
:
[
'
view
'
,
'
delete
'
]
}
}
})
})
...
...
src/app/portal/routine/manage/manage.component.ts
View file @
7518dedf
...
@@ -64,7 +64,7 @@ export class ManageComponent {
...
@@ -64,7 +64,7 @@ export class ManageComponent {
class
:
new
FormControl
(
""
,
[
Validators
.
required
]),
class
:
new
FormControl
(
""
,
[
Validators
.
required
]),
section
:
new
FormControl
(
""
,
[
Validators
.
required
]),
section
:
new
FormControl
(
""
,
[
Validators
.
required
]),
routineType
:
new
FormControl
(
""
,
[
Validators
.
required
]),
routineType
:
new
FormControl
(
""
,
[
Validators
.
required
]),
schedule
:
new
FormControl
(
""
,
[
Validators
.
required
]
),
schedule
:
new
FormControl
(
""
),
});
});
ngOnInit
():
void
{
ngOnInit
():
void
{
...
@@ -73,7 +73,6 @@ export class ManageComponent {
...
@@ -73,7 +73,6 @@ export class ManageComponent {
}
}
public
onFilesChanged
(
files
:
File
[]):
void
{
public
onFilesChanged
(
files
:
File
[]):
void
{
console
.
log
(
'
Selected Files:
'
,
files
);
const
formData
=
new
FormData
();
const
formData
=
new
FormData
();
...
@@ -90,7 +89,7 @@ export class ManageComponent {
...
@@ -90,7 +89,7 @@ export class ManageComponent {
(
response
:
RaintreeResponse
)
=>
{
(
response
:
RaintreeResponse
)
=>
{
this
.
routineForm
.
value
.
schedule
=
`
${
TransmissionMapperService
.
DEV_TRANSMISSION_URL
}
/webomagic/getFile?fid=
${
response
[
'
data
'
]}
`
this
.
routineForm
.
value
.
schedule
=
`
${
TransmissionMapperService
.
DEV_TRANSMISSION_URL
}
/webomagic/getFile?fid=
${
response
[
'
data
'
]}
`
this
.
_toaster
.
success
(
response
.
message
,
'
Ok
'
)
},
},
(
error
)
=>
{
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -143,8 +142,8 @@ export class ManageComponent {
...
@@ -143,8 +142,8 @@ export class ManageComponent {
}),
}),
()
=>
{},
()
=>
{},
(
response
)
=>
{},
(
response
)
=>
{},
(
response
:
class
Response
)
=>
{
(
response
:
Raintree
Response
)
=>
{
this
.
classDropDownData
=
response
.
data
[
"
themeDataSourceFields
"
].
map
(
this
.
classDropDownData
=
response
[
'
data
'
]
[
"
themeDataSourceFields
"
].
map
(
(
sClass
:
StudentClass
)
=>
{
(
sClass
:
StudentClass
)
=>
{
return
{
return
{
[
"
name
"
]:
sClass
.
details
[
"
en
"
],
[
"
name
"
]:
sClass
.
details
[
"
en
"
],
...
@@ -177,8 +176,8 @@ export class ManageComponent {
...
@@ -177,8 +176,8 @@ export class ManageComponent {
}),
}),
()
=>
{},
()
=>
{},
(
response
)
=>
{},
(
response
)
=>
{},
(
response
:
Section
Response
)
=>
{
(
response
:
Raintree
Response
)
=>
{
this
.
sectionDropDownData
=
response
.
data
[
"
themeDataSourceFields
"
].
map
(
this
.
sectionDropDownData
=
response
[
'
data
'
]
[
"
themeDataSourceFields
"
].
map
(
(
sSection
:
StudentSection
)
=>
{
(
sSection
:
StudentSection
)
=>
{
return
{
return
{
[
"
name
"
]:
sSection
.
section
[
"
en
"
],
[
"
name
"
]:
sSection
.
section
[
"
en
"
],
...
...
src/app/portal/routine/routine/routine.component.ts
View file @
7518dedf
...
@@ -12,6 +12,9 @@ import { PrepareRoutineTableDataService } from '../service/prepare-routine-table
...
@@ -12,6 +12,9 @@ import { PrepareRoutineTableDataService } from '../service/prepare-routine-table
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
MatDialogConfigService
}
from
'
../../service/mat-dialog-config.service
'
;
import
{
MatDialogConfigService
}
from
'
../../service/mat-dialog-config.service
'
;
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
import
{
DeleteRecordTransmissionService
}
from
'
../../../raintree/transmission/delete-record-transmission.service
'
;
import
{
ToasterService
}
from
'
../../../component-library/toaster/toaster.service
'
;
@
Component
({
@
Component
({
selector
:
'
app-routine
'
,
selector
:
'
app-routine
'
,
...
@@ -32,6 +35,8 @@ export class RoutineComponent {
...
@@ -32,6 +35,8 @@ export class RoutineComponent {
private
_dialog
:
MatDialog
,
private
_dialog
:
MatDialog
,
private
_prepareRoutineTableData
:
PrepareRoutineTableDataService
,
private
_prepareRoutineTableData
:
PrepareRoutineTableDataService
,
private
_matDialogConfig
:
MatDialogConfigService
,
private
_matDialogConfig
:
MatDialogConfigService
,
private
_deleteTransmission
:
DeleteRecordTransmissionService
,
private
_toaster
:
ToasterService
,
public
authService
:
AuthService
public
authService
:
AuthService
)
{
}
)
{
}
...
@@ -58,8 +63,28 @@ export class RoutineComponent {
...
@@ -58,8 +63,28 @@ export class RoutineComponent {
window
.
open
(
docLink
,
'
_blank
'
);
window
.
open
(
docLink
,
'
_blank
'
);
}
}
public
emitDeleteFromTable
(
emitData
:
string
):
void
{
public
emitDeleteFromTable
(
emitData
:
any
):
void
{
alert
(
"
Should delete the data
"
);
if
(
!
confirm
(
"
Are you sure to delete ?
"
))
return
;
this
.
_deleteTransmission
.
deleteRecord
(
TransmissionMapperService
.
DELETE_RECORD_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
dataSourceFieldId
:
`
${
emitData
.
id
}
`
,
themeDataSourceId
:
DataSourceService
.
ROUTINE_DATA_SOURCE_ID
,
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
RaintreeResponse
)
=>
{
this
.
_toaster
.
success
(
"
Routine is deleted successfully
"
,
'
ok
'
);
this
.
_getRoutines
();
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
}
...
@@ -79,9 +104,9 @@ export class RoutineComponent {
...
@@ -79,9 +104,9 @@ export class RoutineComponent {
}),
}),
()
=>
{
},
()
=>
{
},
(
response
)
=>
{
},
(
response
)
=>
{
},
(
response
:
R
outin
eResponse
)
=>
{
(
response
:
R
aintre
eResponse
)
=>
{
this
.
data
=
this
.
_prepareRoutineTableData
.
prepareMatTableData
(
response
.
data
.
themeDataSourceFields
);
this
.
data
=
this
.
_prepareRoutineTableData
.
prepareMatTableData
(
response
[
'
data
'
]
.
themeDataSourceFields
);
},
},
(
error
)
=>
{
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
...
...
src/app/portal/service/data-source.service.ts
View file @
7518dedf
...
@@ -6,18 +6,24 @@ import { Injectable } from '@angular/core';
...
@@ -6,18 +6,24 @@ import { Injectable } from '@angular/core';
export
class
DataSourceService
{
export
class
DataSourceService
{
constructor
()
{
}
constructor
()
{
}
// FOR ASSIGNMENT:
public
static
readonly
ASSIGNMENT_DATA_SOURCE_ID
:
number
=
3188
;
public
static
readonly
ASSIGNMENT_DATA_SOURCE_ID
:
number
=
3188
;
public
static
readonly
ASSIGNMENT_DATA_SOURCE_NAME
:
string
=
'
Assignment
'
;
public
static
readonly
ASSIGNMENT_DATA_SOURCE_TYPE
:
number
=
1330
;
// FOR ROUTINE:
// FOR ROUTINE:
public
static
readonly
ROUTINE_DATA_SOURCE_ID
:
number
=
3021
;
public
static
readonly
ROUTINE_DATA_SOURCE_ID
:
number
=
3021
;
public
static
readonly
ROUTINE_DATA_SOURCE_NAME
:
string
=
'
Routine
'
;
public
static
readonly
ROUTINE_DATA_SOURCE_NAME
:
string
=
'
Routine
'
;
public
static
readonly
ROUTINE_DATA_SOURCE_TYPE
:
number
=
1327
;
public
static
readonly
ROUTINE_DATA_SOURCE_TYPE
:
number
=
1327
;
// FOR EXAM SCHEDULE:
public
static
readonly
EXAM_SCHEDULE_DATA_SOURCE_ID
:
number
=
3018
;
public
static
readonly
EXAM_SCHEDULE_DATA_SOURCE_NAME
:
string
=
"
Exam Schedule
"
;
public
static
readonly
EXAM_SCHEDULE_DATA_SOURCE_TYPE
:
number
=
1329
;
public
static
readonly
CLASS_DATA_SOURCE_ID
:
number
=
3008
;
public
static
readonly
CLASS_DATA_SOURCE_ID
:
number
=
3008
;
public
static
readonly
SECTION_DATA_SOURCE_ID
:
number
=
3013
;
public
static
readonly
SECTION_DATA_SOURCE_ID
:
number
=
3013
;
public
static
readonly
EXAM_SCHEDULE_DATA_SOURCE_ID
:
number
=
3018
;
public
static
readonly
SUBJECT_DATA_SOURCE_ID
:
number
=
3014
;
}
}
src/app/raintree/transmission/assignment-transmission.service.ts
View file @
7518dedf
...
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
...
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
import
{
AssignmentsResponse
}
from
'
../interface/assignment-respons
'
;
import
{
AssignmentsResponse
}
from
'
../interface/assignment-respons
'
;
import
{
Assignments
}
from
'
../../portal/assignment/interface/assignment
'
;
@
Injectable
({
@
Injectable
({
providedIn
:
'
root
'
providedIn
:
'
root
'
...
@@ -11,8 +12,8 @@ export class AssignmentTransmissionService extends TransmissionService {
...
@@ -11,8 +12,8 @@ export class AssignmentTransmissionService extends TransmissionService {
public
getAssignment
(
public
getAssignment
(
url
:
string
,
url
:
string
,
onPreExecute
:
()
=>
void
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onPostExecute
:
(
response
:
RaintreeResponse
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
RaintreeResponse
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
onComplete
:
()
=>
void
):
void
{
):
void
{
...
@@ -27,4 +28,25 @@ export class AssignmentTransmissionService extends TransmissionService {
...
@@ -27,4 +28,25 @@ export class AssignmentTransmissionService extends TransmissionService {
true
true
);
);
}
}
public
addAssignment
(
url
:
string
,
payload
:
Assignments
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
RaintreeResponse
)
=>
void
,
onSuccess
:
(
response
:
RaintreeResponse
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
){
this
.
executePostPayload
(
url
,
payload
,
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
}
}
src/app/raintree/transmission/class-transmission.service.ts
View file @
7518dedf
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
@
Injectable
({
@
Injectable
({
providedIn
:
'
root
'
providedIn
:
'
root
'
...
@@ -8,8 +9,8 @@ export class ClassTransmissionService extends TransmissionService{
...
@@ -8,8 +9,8 @@ export class ClassTransmissionService extends TransmissionService{
public
getClasses
(
public
getClasses
(
url
:
string
,
url
:
string
,
onPreExecute
:
()
=>
void
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onPostExecute
:
(
response
:
RaintreeResponse
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
RaintreeResponse
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
onComplete
:
()
=>
void
):
void
{
):
void
{
...
@@ -28,8 +29,28 @@ export class ClassTransmissionService extends TransmissionService{
...
@@ -28,8 +29,28 @@ export class ClassTransmissionService extends TransmissionService{
public
getSection
(
public
getSection
(
url
:
string
,
url
:
string
,
onPreExecute
:
()
=>
void
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onPostExecute
:
(
response
:
RaintreeResponse
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
RaintreeResponse
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
){
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
public
getSubject
(
url
:
string
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
RaintreeResponse
)
=>
void
,
onSuccess
:
(
response
:
RaintreeResponse
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
onComplete
:
()
=>
void
){
){
...
...
src/app/raintree/transmission/delete-record-transmission.service.spec.ts
0 → 100644
View file @
7518dedf
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
DeleteRecordTransmissionService
}
from
'
./delete-record-transmission.service
'
;
describe
(
'
DeleteRecordTransmissionService
'
,
()
=>
{
let
service
:
DeleteRecordTransmissionService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
DeleteRecordTransmissionService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/delete-record-transmission.service.ts
0 → 100644
View file @
7518dedf
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
DeleteRecordTransmissionService
extends
TransmissionService
{
public
deleteRecord
(
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/exam-schedule.service.ts
View file @
7518dedf
...
@@ -26,4 +26,25 @@ export class ExamScheduleService extends TransmissionService {
...
@@ -26,4 +26,25 @@ export class ExamScheduleService extends TransmissionService {
true
true
);
);
}
}
public
addExamSchedule
(
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/jwt.service.ts
View file @
7518dedf
...
@@ -10,23 +10,27 @@ export class JWTService {
...
@@ -10,23 +10,27 @@ export class JWTService {
private
_auth
:
AuthService
private
_auth
:
AuthService
)
{}
)
{}
private
_userId
:
string
=
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
)
;
// private _userId:string = this._auth.localStorageGetItemByKey('user_id')
;
private
_authorizationToken
:
string
=
localStorage
.
getItem
(
'
Bearer
'
)
||
''
;
//
private _authorizationToken: string = localStorage.getItem('Bearer') || '';
public
injectToken
(
url
:
string
):
HttpHeaders
{
public
injectToken
(
url
:
string
):
HttpHeaders
{
// debugger;
let
userId
=
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
)
;
let
authorizationToken
=
localStorage
.
getItem
(
'
Bearer
'
)
||
''
;
return
new
HttpHeaders
({
return
new
HttpHeaders
({
"
user-id
"
:
this
.
_
userId
,
"
user-id
"
:
userId
,
"
apikey
"
:
this
.
_
authorizationToken
,
"
apikey
"
:
authorizationToken
,
'
Content-Type
'
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
});
});
}
}
public
injectTokenForFormGroupPost
(
url
:
string
):
HttpHeaders
{
public
injectTokenForFormGroupPost
(
url
:
string
):
HttpHeaders
{
let
userId
=
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
)
;
let
authorizationToken
=
localStorage
.
getItem
(
'
Bearer
'
)
||
''
;
return
new
HttpHeaders
({
return
new
HttpHeaders
({
"
user-id
"
:
this
.
_
userId
,
"
user-id
"
:
userId
,
"
apikey
"
:
this
.
_
authorizationToken
,
"
apikey
"
:
authorizationToken
,
});
});
}
}
}
}
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