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
b97b9938
Commit
b97b9938
authored
Mar 28, 2025
by
achinta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: routine add
parent
b18b2f83
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
474 additions
and
13 deletions
+474
-13
src/app/auth/service/auth.service.ts
src/app/auth/service/auth.service.ts
+8
-1
src/app/mappers/role-mapper.service.ts
src/app/mappers/role-mapper.service.ts
+1
-1
src/app/mappers/transmission-mapper.service.ts
src/app/mappers/transmission-mapper.service.ts
+3
-0
src/app/portal/interface/class.ts
src/app/portal/interface/class.ts
+17
-0
src/app/portal/interface/section.ts
src/app/portal/interface/section.ts
+20
-0
src/app/portal/routine/manage/manage.component.html
src/app/portal/routine/manage/manage.component.html
+57
-1
src/app/portal/routine/manage/manage.component.ts
src/app/portal/routine/manage/manage.component.ts
+229
-1
src/app/portal/routine/routine/routine.component.ts
src/app/portal/routine/routine/routine.component.ts
+6
-3
src/app/portal/routine/service/prepare-routine-table-data.service.ts
...tal/routine/service/prepare-routine-table-data.service.ts
+2
-1
src/app/portal/service/data-source.service.ts
src/app/portal/service/data-source.service.ts
+2
-0
src/app/raintree/interface/class-respons.ts
src/app/raintree/interface/class-respons.ts
+8
-0
src/app/raintree/interface/section-respons.ts
src/app/raintree/interface/section-respons.ts
+8
-0
src/app/raintree/transmission/class-transmission.service.spec.ts
.../raintree/transmission/class-transmission.service.spec.ts
+16
-0
src/app/raintree/transmission/class-transmission.service.ts
src/app/raintree/transmission/class-transmission.service.ts
+47
-0
src/app/raintree/transmission/jwt.service.ts
src/app/raintree/transmission/jwt.service.ts
+2
-2
src/app/raintree/transmission/routine-transmission.service.ts
...app/raintree/transmission/routine-transmission.service.ts
+22
-0
src/app/raintree/transmission/section-transmission.service.spec.ts
...aintree/transmission/section-transmission.service.spec.ts
+16
-0
src/app/raintree/transmission/section-transmission.service.ts
...app/raintree/transmission/section-transmission.service.ts
+9
-0
src/app/raintree/transmission/transmission.service.ts
src/app/raintree/transmission/transmission.service.ts
+1
-3
No files found.
src/app/auth/service/auth.service.ts
View file @
b97b9938
...
@@ -27,7 +27,14 @@ export class AuthService {
...
@@ -27,7 +27,14 @@ export class AuthService {
if
(
this
.
isBrowser
)
{
if
(
this
.
isBrowser
)
{
localStorage
.
setItem
(
'
isLoggedIn
'
,
'
true
'
);
localStorage
.
setItem
(
'
isLoggedIn
'
,
'
true
'
);
localStorage
.
setItem
(
'
role
'
,
userProfileData
.
role_name
);
// TODO: This is for temporary
if
(
userProfileData
.
role_name
===
'
Teacher
'
)
{
localStorage
.
setItem
(
'
role
'
,
'
EDITOR
'
);
}
else
{
localStorage
.
setItem
(
'
role
'
,
userProfileData
.
role_name
);
}
this
.
_router
.
navigate
([
RequestMapperService
.
PORTAL_URL
]);
this
.
_router
.
navigate
([
RequestMapperService
.
PORTAL_URL
]);
}
}
...
...
src/app/mappers/role-mapper.service.ts
View file @
b97b9938
...
@@ -9,7 +9,7 @@ export class RoleMapperService {
...
@@ -9,7 +9,7 @@ export class RoleMapperService {
// NOTE:: this will be same value which is come from backend role
// NOTE:: this will be same value which is come from backend role
public
static
readonly
TEACHER_ROLE
:
string
=
'
Teacher
'
;
public
static
readonly
TEACHER_ROLE
:
string
=
'
EDITOR
'
;
public
static
readonly
STUDENT_ROLE
:
string
=
'
Student
'
;
public
static
readonly
STUDENT_ROLE
:
string
=
'
Student
'
;
public
static
get
getAllRole
():
string
[]
{
public
static
get
getAllRole
():
string
[]
{
...
...
src/app/mappers/transmission-mapper.service.ts
View file @
b97b9938
...
@@ -19,6 +19,9 @@ export class TransmissionMapperService {
...
@@ -19,6 +19,9 @@ export class TransmissionMapperService {
public
static
readonly
GET_TRANSMISSION_URL
:
string
=
public
static
readonly
GET_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/getWebDataSourceByWebsiteDataSourceForFilter?
'
;
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/getWebDataSourceByWebsiteDataSourceForFilter?
'
;
public
static
readonly
SAVE_TRANSMISSION_URL
:
string
=
TransmissionMapperService
.
DEV_TRANSMISSION_URL
+
'
/webomagic/saveWebDataSourceFieldsBasedOnDataSourceType?
'
;
// aggregationOnUniqueFld=false&datasourceId=3188&dontIncludeForeignKey=false&expand=false&isUniqueValueRequiredForFieldToDisplay=false&language=en&limit=10&orderBy=ASC&page=1&user_id=206&roleBasedFiltering=true
// 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 =
...
...
src/app/portal/interface/class.ts
0 → 100644
View file @
b97b9938
import
{
Data
}
from
"
../data-source/interface/data
"
;
import
{
LocalizedField
}
from
"
../data-source/interface/localizedField
"
;
// ThemeDataSourceField Interface
export
interface
Classes
extends
Data
{
themeDataSourceFields
:
StudentClass
[];
}
// ThemeDataSourceField Interface
export
interface
StudentClass
{
id
:
string
;
className
:
LocalizedField
;
details
:
LocalizedField
;
school
:
LocalizedField
;
}
src/app/portal/interface/section.ts
0 → 100644
View file @
b97b9938
import
{
Data
}
from
"
../data-source/interface/data
"
;
import
{
LocalizedField
}
from
"
../data-source/interface/localizedField
"
;
// ThemeDataSourceField Interface
export
interface
Sections
extends
Data
{
themeDataSourceFields
:
StudentSection
[];
}
// ThemeDataSourceField Interface
export
interface
StudentSection
{
id
:
string
;
class
:
LocalizedField
;
section
:
LocalizedField
;
class_teacher
:
LocalizedField
;
details
:
LocalizedField
;
class_details
:
LocalizedField
;
class_teacher_name
:
LocalizedField
;
}
src/app/portal/routine/manage/manage.component.html
View file @
b97b9938
<pre>
{{data | json}}
</pre>
<!-- <h1> Hi Manage </h1> -->
<form
class=
"login_form"
[formGroup]=
"routineForm"
>
<div
class=
"mat_input_container"
>
<div
class=
"class_dropdown"
>
<app-drop-down
[dropDownData] =
"classDropDownData"
(emitDropDownData)=
"classOnChange($event)"
/>
</div>
<div
class=
"section_dropdown"
>
<app-drop-down
[dropDownData] =
"sectionDropDownData"
(emitDropDownData)=
"sectionOnChange($event)"
/>
</div>
<div
class=
"details_field"
>
<mat-form-field
class=
"full_width"
>
<span
class=
"material-symbols-outlined"
matPrefix
>
person
</span>
<input
matInput
placeholder=
"{{ 'Enter details' }}"
#input
formControlName=
"details"
/>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<mat-form-field
style=
"width: 100%;"
>
<mat-label>
Schedule
</mat-label>
<button
mat-icon-button
matPrefix
(click)=
"f_input.click()"
>
<mat-icon>
attach_file
</mat-icon>
</button>
<input
type=
"text"
readonly
matInput
/>
<input
type=
"file"
multiple
hidden
#f_input
/>
<mat-error>
This field is required
</mat-error>
</mat-form-field>
</div>
<div
class=
"add_btn"
>
<app-square-button
[buttonIcon]=
"''"
[buttonText]=
"'submit'"
(emitSquareButtonClick)=
"submitRoutine()"
/>
</div>
</form>
\ No newline at end of file
src/app/portal/routine/manage/manage.component.ts
View file @
b97b9938
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
Component
,
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
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
DataSourceService
}
from
'
../../service/data-source.service
'
;
import
{
classResponse
}
from
'
../../../raintree/interface/class-respons
'
;
import
{
UrlConfigService
}
from
'
../../service/url-config.service
'
;
import
{
DropDownComponent
}
from
"
../../../component-library/dropdown/drop-down/drop-down.component
"
;
import
{
Dropdown
}
from
'
../../../component-library/dropdown/interface/dropdown
'
;
import
{
StudentClass
}
from
'
../../interface/class
'
;
import
{
FormControl
,
FormControlName
,
FormGroup
,
ReactiveFormsModule
,
Validators
}
from
'
@angular/forms
'
;
import
{
MatFormFieldModule
}
from
'
@angular/material/form-field
'
;
import
{
MatInputModule
}
from
'
@angular/material/input
'
;
import
{
MatIconModule
}
from
"
@angular/material/icon
"
;
import
{
SquareButtonComponent
}
from
'
../../../component-library/square-button/square-button.component
'
;
import
{
SectionResponse
}
from
'
../../../raintree/interface/section-respons
'
;
import
{
StudentSection
}
from
'
../../interface/section
'
;
import
{
RoutineTransmissionService
}
from
'
../../../raintree/transmission/routine-transmission.service
'
;
import
{
AuthService
}
from
'
../../../auth/service/auth.service
'
;
import
{
RaintreeResponse
}
from
'
../../../raintree/interface/raintree-response
'
;
@
Component
({
@
Component
({
selector
:
'
app-manage
'
,
selector
:
'
app-manage
'
,
imports
:
[
imports
:
[
CommonModule
CommonModule
,
DropDownComponent
,
ReactiveFormsModule
,
MatFormFieldModule
,
MatInputModule
,
MatIconModule
,
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
_classTransmission
:
ClassTransmissionService
,
private
_urlConfig
:
UrlConfigService
,
private
_routineTransmission
:
RoutineTransmissionService
,
private
_auth
:
AuthService
)
{
}
)
{
}
public
classDropDownData
:
Dropdown
[]
=
[]
public
sectionDropDownData
:
Dropdown
[]
=
[]
public
routineForm
=
new
FormGroup
({
details
:
new
FormControl
(
''
,
[
Validators
.
required
])
})
ngOnInit
():
void
{
this
.
_getClasses
();
this
.
_getSection
();
}
public
classOnChange
(
value
:
string
)
{
console
.
log
(
value
);
}
public
sectionOnChange
(
value
:
string
)
{
console
.
log
(
value
);
}
public
submitRoutine
():
void
{
alert
(
"
Submit Clicked!!
"
)
// this._routineTransmission.submitRoutine(
// TransmissionMapperService.SAVE_TRANSMISSION_URL + `websiteId=${this._auth.localStorageGetItemByKey('project_id')}`,
// this.routineFormPayload,
// () => { },
// () => { },
// (response: RaintreeResponse) => {
// console.log(response);
// },
// (error) => {
// console.log(error);
// },
// () => { }
// );
}
private
_getClasses
()
{
this
.
_classTransmission
.
getClasses
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
CLASS_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
100
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
classResponse
)
=>
{
this
.
classDropDownData
=
response
.
data
[
'
themeDataSourceFields
'
].
map
((
sClass
:
StudentClass
)
=>
{
return
{
[
'
name
'
]:
sClass
.
details
[
'
en
'
],
[
'
value
'
]:
sClass
.
id
}
})
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
private
_getSection
(){
this
.
_classTransmission
.
getSection
(
TransmissionMapperService
.
GET_TRANSMISSION_URL
+
this
.
_urlConfig
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
datasourceId
:
DataSourceService
.
SECTION_DATA_SOURCE_ID
,
dontIncludeForeignKey
:
false
,
expand
:
false
,
isUniqueValueRequiredForFieldToDisplay
:
false
,
language
:
"
en
"
,
limit
:
100
,
orderBy
:
"
ASC
"
,
page
:
1
,
roleBasedFiltering
:
true
}),
()
=>
{
},
(
response
)
=>
{
},
(
response
:
SectionResponse
)
=>
{
this
.
sectionDropDownData
=
response
.
data
[
'
themeDataSourceFields
'
].
map
((
sSection
:
StudentSection
)
=>
{
return
{
[
'
name
'
]:
sSection
.
section
[
'
en
'
],
[
'
value
'
]:
sSection
.
id
}
})
},
(
error
)
=>
{
console
.
log
(
error
);
},
()
=>
{
}
)
}
private
routineFormPayload
=
{
"
themeDataSourceFields
"
:
[
{
"
id
"
:
""
,
"
class
"
:
{
"
en
"
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
"
beng
"
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
"
hindi
"
:
"
48f353051f9d724f619491d4f0d0a8ec
"
},
"
section
"
:
{
"
en
"
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
"
beng
"
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
"
hindi
"
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
},
"
schedule
"
:
{
"
en
"
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
"
beng
"
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
"
hindi
"
:
"
BASE_URL/webomagic/getFile?fid=2910
"
},
"
details
"
:
{
"
en
"
:
"
test 1 c
"
,
"
beng
"
:
"
test 1 c
"
,
"
hindi
"
:
"
test 1 c
"
},
"
session
"
:
{
"
en
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
beng
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
hindi
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
},
"
document
"
:
{
"
en
"
:
""
,
"
beng
"
:
""
,
"
hindi
"
:
""
},
"
routine_type
"
:
{
"
en
"
:
"
class_routine
"
,
"
beng
"
:
"
class_routine
"
,
"
hindi
"
:
"
class_routine
"
}
}
],
"
dataSourceName
"
:
"
Routine
"
,
"
id
"
:
"
3021
"
,
"
type
"
:
"
1327
"
,
"
themeId
"
:
"
278
"
,
"
slideLst
"
:
null
,
"
heading
"
:
"
undefined
"
,
"
dataSourceTypeFieldsList
"
:
[
{
"
id
"
:
""
,
"
class
"
:
{
"
en
"
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
"
beng
"
:
"
48f353051f9d724f619491d4f0d0a8ec
"
,
"
hindi
"
:
"
48f353051f9d724f619491d4f0d0a8ec
"
},
"
section
"
:
{
"
en
"
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
"
beng
"
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
,
"
hindi
"
:
"
5d53b27058d1f6067a4b4bd1350a24d4
"
},
"
schedule
"
:
{
"
en
"
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
"
beng
"
:
"
BASE_URL/webomagic/getFile?fid=2910
"
,
"
hindi
"
:
"
BASE_URL/webomagic/getFile?fid=2910
"
},
"
details
"
:
{
"
en
"
:
"
test 1 c
"
,
"
beng
"
:
"
test 1 c
"
,
"
hindi
"
:
"
test 1 c
"
},
"
session
"
:
{
"
en
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
beng
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
hindi
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
},
"
document
"
:
{
"
en
"
:
""
,
"
beng
"
:
""
,
"
hindi
"
:
""
},
"
routine_type
"
:
{
"
en
"
:
"
class_routine
"
,
"
beng
"
:
"
class_routine
"
,
"
hindi
"
:
"
class_routine
"
}
}
]
}
}
}
src/app/portal/routine/routine/routine.component.ts
View file @
b97b9938
...
@@ -50,9 +50,12 @@ export class RoutineComponent {
...
@@ -50,9 +50,12 @@ export class RoutineComponent {
});
});
}
}
public
emitViewFromTable
(
clickedData
:
string
)
{
public
emitViewFromTable
(
emitData
:
any
)
{
alert
(
"
Have to view the doc in another page
"
);
// alert("Have to view the doc in another page");
// console.log();
let
docLink
=
emitData
.
schedule
.
replace
(
'
BASE_URL
'
,
TransmissionMapperService
.
DEV_TRANSMISSION_URL
);
window
.
open
(
docLink
,
'
_blank
'
);
}
}
public
emitEditFromTable
(
emitData
:
string
):
void
{
public
emitEditFromTable
(
emitData
:
string
):
void
{
...
...
src/app/portal/routine/service/prepare-routine-table-data.service.ts
View file @
b97b9938
...
@@ -17,7 +17,8 @@ export class PrepareRoutineTableDataService {
...
@@ -17,7 +17,8 @@ export class PrepareRoutineTableDataService {
[
'
id
'
]:
routine
.
id
,
[
'
id
'
]:
routine
.
id
,
[
'
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
'
],
[
'
schedule
'
]:
routine
.
schedule
[
'
en
'
],
[
'
action
'
]:
[
'
view
'
,
'
edit
'
]
[
'
action
'
]:
[
'
view
'
,
'
edit
'
]
}
}
})
})
...
...
src/app/portal/service/data-source.service.ts
View file @
b97b9938
...
@@ -9,5 +9,7 @@ export class DataSourceService {
...
@@ -9,5 +9,7 @@ export class DataSourceService {
public
static
readonly
ASSIGNMENT_DATA_SOURCE_ID
:
number
=
3188
;
public
static
readonly
ASSIGNMENT_DATA_SOURCE_ID
:
number
=
3188
;
public
static
readonly
ROUTINE_DATA_SOURCE_ID
:
number
=
3021
;
public
static
readonly
ROUTINE_DATA_SOURCE_ID
:
number
=
3021
;
public
static
readonly
CLASS_DATA_SOURCE_ID
:
number
=
3008
;
public
static
readonly
SECTION_DATA_SOURCE_ID
:
number
=
3013
;
}
}
src/app/raintree/interface/class-respons.ts
0 → 100644
View file @
b97b9938
import
{
Classes
}
from
"
../../portal/interface/class
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
classResponse
extends
RaintreeResponse
{
data
:
Classes
;
}
\ No newline at end of file
src/app/raintree/interface/section-respons.ts
0 → 100644
View file @
b97b9938
import
{
Sections
}
from
"
../../portal/interface/section
"
;
import
{
RaintreeResponse
}
from
"
./raintree-response
"
;
export
interface
SectionResponse
extends
RaintreeResponse
{
data
:
Sections
;
}
\ No newline at end of file
src/app/raintree/transmission/class-transmission.service.spec.ts
0 → 100644
View file @
b97b9938
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
ClassTransmissionService
}
from
'
./class-transmission.service
'
;
describe
(
'
ClassTransmissionService
'
,
()
=>
{
let
service
:
ClassTransmissionService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
ClassTransmissionService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/class-transmission.service.ts
0 → 100644
View file @
b97b9938
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
ClassTransmissionService
extends
TransmissionService
{
public
getClasses
(
url
:
string
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
):
void
{
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
public
getSection
(
url
:
string
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
){
this
.
executePostPayload
(
url
,
{},
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
}
src/app/raintree/transmission/jwt.service.ts
View file @
b97b9938
...
@@ -16,11 +16,11 @@ export class JWTService {
...
@@ -16,11 +16,11 @@ export class JWTService {
public
injectToken
(
token
:
string
):
HttpHeaders
{
public
injectToken
(
token
:
string
):
HttpHeaders
{
let
authorizationToken
:
string
=
localStorage
.
getItem
(
'
Bearer
'
)
||
''
;
let
authorizationToken
:
string
=
localStorage
.
getItem
(
'
Bearer
'
)
||
''
;
let
userId
=
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
);
// TODO: check if token exist in Local storage and handle accordingly
// TODO: check if token exist in Local storage and handle accordingly
return
new
HttpHeaders
({
return
new
HttpHeaders
({
"
user-id
"
:
this
.
_auth
.
localStorageGetItemByKey
(
'
user_id
'
)
,
"
user-id
"
:
userId
,
"
apikey
"
:
authorizationToken
,
"
apikey
"
:
authorizationToken
,
'
Content-Type
'
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
});
});
...
...
src/app/raintree/transmission/routine-transmission.service.ts
View file @
b97b9938
...
@@ -8,6 +8,7 @@ export class RoutineTransmissionService extends TransmissionService{
...
@@ -8,6 +8,7 @@ export class RoutineTransmissionService extends TransmissionService{
public
getRoutine
(
public
getRoutine
(
url
:
string
,
url
:
string
,
payload
:
string
,
onPreExecute
:
()
=>
void
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
...
@@ -25,4 +26,25 @@ export class RoutineTransmissionService extends TransmissionService{
...
@@ -25,4 +26,25 @@ export class RoutineTransmissionService extends TransmissionService{
true
true
);
);
}
}
public
submitRoutine
(
url
:
string
,
payload
:
any
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
any
)
=>
void
,
onSuccess
:
(
response
:
any
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
){
this
.
executePostPayload
(
url
,
payload
,
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
}
}
src/app/raintree/transmission/section-transmission.service.spec.ts
0 → 100644
View file @
b97b9938
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
SectionTransmissionService
}
from
'
./section-transmission.service
'
;
describe
(
'
SectionTransmissionService
'
,
()
=>
{
let
service
:
SectionTransmissionService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
SectionTransmissionService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/section-transmission.service.ts
0 → 100644
View file @
b97b9938
import
{
Injectable
}
from
'
@angular/core
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
SectionTransmissionService
{
constructor
()
{
}
}
src/app/raintree/transmission/transmission.service.ts
View file @
b97b9938
...
@@ -103,9 +103,7 @@ export class TransmissionService {
...
@@ -103,9 +103,7 @@ export class TransmissionService {
if
(
response
.
status_code
)
onSuccess
(
response
);
if
(
response
.
status_code
)
onSuccess
(
response
);
// else
// else
// onFailure(
// onFailure(
// isEmptyString(response.message)
// ? MessageService.RESOURCE_VALIDATION_FAILED
// : response.message
// );
// );
},
},
(
error
)
=>
{
(
error
)
=>
{
...
...
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