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
885437c6
Commit
885437c6
authored
Mar 26, 2025
by
Arko Dey Bhowmick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: render assignment table with molded api response
parent
0752e01a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
171 additions
and
6 deletions
+171
-6
src/app/component-library/custom-table/custom-table.component.ts
.../component-library/custom-table/custom-table.component.ts
+5
-1
src/app/portal/assignment/assignment/assignment.component.ts
src/app/portal/assignment/assignment/assignment.component.ts
+105
-3
src/app/portal/assignment/manage/manage.component.html
src/app/portal/assignment/manage/manage.component.html
+1
-1
src/app/portal/assignment/manage/manage.component.ts
src/app/portal/assignment/manage/manage.component.ts
+2
-1
src/app/portal/assignment/service/prepare-assignment-table-data.service.spec.ts
...ent/service/prepare-assignment-table-data.service.spec.ts
+16
-0
src/app/portal/assignment/service/prepare-assignment-table-data.service.ts
...signment/service/prepare-assignment-table-data.service.ts
+42
-0
No files found.
src/app/component-library/custom-table/custom-table.component.ts
View file @
885437c6
...
...
@@ -67,7 +67,11 @@ export class CustomTableComponent {
// ];
// data = [
// { id: 1, name: 'John Doe', age: 30 },
// {
// id: 1,
// name: 'John Doe',
// age: 30
// },
// { id: 2, name: 'Jane Doe', age: 28 },
// { id: 3, name: 'Alice', age: 25 }
// ];
...
...
src/app/portal/assignment/assignment/assignment.component.ts
View file @
885437c6
...
...
@@ -8,6 +8,7 @@ import { AssignmentsResponse } from '../../../raintree/interface/assignment-resp
import
{
TransmissionMapperService
}
from
'
../../../mappers/transmission-mapper.service
'
;
import
{
UrlConfigService
}
from
'
../../service/url-config.service
'
;
import
{
Assignment
}
from
'
../interface/assignment
'
;
import
{
PrepareAssignmentTableDataService
}
from
'
../service/prepare-assignment-table-data.service
'
;
@
Component
({
selector
:
'
app-assignment
'
,
...
...
@@ -23,7 +24,8 @@ export class AssignmentComponent {
constructor
(
private
_dialog
:
MatDialog
,
private
_assignmentTransmissionService
:
AssignmentTransmissionService
,
private
_urlConfigService
:
UrlConfigService
private
_urlConfigService
:
UrlConfigService
,
private
_prepareAssignmentTableData
:
PrepareAssignmentTableDataService
){}
public
columns
=
[
...
...
@@ -33,7 +35,79 @@ export class AssignmentComponent {
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
public
data
:
Assignment
[]
=
[];
public
data
:
any
[]
=
[];
private
_temp
:
Assignment
[]
=
[
{
"
session
"
:
{
"
default
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
beng
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
hindi
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
,
"
en
"
:
"
86af4d6b5675a82df4581f00c67f0c7f
"
},
"
subject
"
:
{
"
default
"
:
""
,
"
beng
"
:
""
,
"
hindi
"
:
""
,
"
en
"
:
"
46486ae5e9470245652c77dbe9329136
"
},
"
assigned_on
"
:
{
"
default
"
:
"
2025-03-21
"
,
"
beng
"
:
"
2025-03-21
"
,
"
hindi
"
:
"
2025-03-21
"
,
"
en
"
:
"
2025-03-21
"
},
"
last_submission_date
"
:
{
"
default
"
:
"
2025-03-21
"
,
"
beng
"
:
"
2025-03-21
"
,
"
hindi
"
:
"
2025-03-21
"
,
"
en
"
:
"
2025-03-21
"
},
"
section
"
:
{
"
default
"
:
"
1628f1d3368d31b75447ca348c1add5e
"
,
"
beng
"
:
"
1628f1d3368d31b75447ca348c1add5e
"
,
"
hindi
"
:
"
1628f1d3368d31b75447ca348c1add5e
"
,
"
en
"
:
"
1628f1d3368d31b75447ca348c1add5e
"
},
"
docs
"
:
{
"
default
"
:
""
,
"
beng
"
:
""
,
"
hindi
"
:
""
,
"
en
"
:
""
},
"
class_subject
"
:
{
"
default
"
:
"
7f8aa0e3b9fb526fbc77cb4e190b0965
"
,
"
beng
"
:
"
7f8aa0e3b9fb526fbc77cb4e190b0965
"
,
"
hindi
"
:
"
7f8aa0e3b9fb526fbc77cb4e190b0965
"
,
"
en
"
:
"
7f8aa0e3b9fb526fbc77cb4e190b0965
"
},
"
session_session_name
"
:
{
"
default
"
:
"
2024-2025
"
,
"
beng
"
:
"
2024-2025
"
,
"
hindi
"
:
"
2024-2025
"
,
"
en
"
:
"
2024-2025 session
"
},
"
section_details
"
:
{
"
default
"
:
"
test 12 b
"
,
"
beng
"
:
"
test 12 b
"
,
"
hindi
"
:
"
test 12 b
"
,
"
en
"
:
"
test 12 b
"
},
"
id
"
:
"
893121387a9b65a4474402f09046c724
"
,
"
subject_subject_name
"
:
{
"
default
"
:
"
Physics
"
,
"
beng
"
:
"
Physics
"
,
"
hindi
"
:
"
Physics
"
,
"
en
"
:
"
Physics
"
},
"
class_subject_subject_txt
"
:
{
"
default
"
:
"
Math
"
,
"
beng
"
:
"
Math
"
,
"
hindi
"
:
"
Math
"
,
"
en
"
:
"
Math
"
}
}
]
ngOnInit
():
void
{
...
...
@@ -41,6 +115,15 @@ export class AssignmentComponent {
}
private
_getAssignment
()
:
void
{
this
.
data
=
this
.
_prepareAssignmentTableData
.
prepareMatTableData
(
this
.
_temp
);
this
.
columns
=
this
.
_prepareAssignmentTableData
.
prepareMatTableColumn
(
this
.
_temp
);
this
.
_assignmentTransmissionService
.
getAssignment
(
TransmissionMapperService
.
ASSIGNMENT_TRANSMISSION_URL
+
this
.
_urlConfigService
.
generateDatasourceConfigUrl
({
aggregationOnUniqueFld
:
false
,
...
...
@@ -57,12 +140,31 @@ export class AssignmentComponent {
()
=>
{
},
(
response
)
=>
{
},
(
response
:
AssignmentsResponse
)
=>
{
this
.
data
=
response
.
data
.
themeDataSourceFields
//
this.data = response.data.themeDataSourceFields
// response['data']['themeDataSourceFields'].map((assignment:Assignment) => {
// return{
// assignment.
// }
// })
// this.data = this._prepareAssignmentTableData.prepareMatTableData(
// response.data.themeDataSourceFields
// );
// this.columns = this._prepareAssignmentTableData.prepareMatTableData(
// response.data.themeDataSourceFields
// );
// this.data = [
// { id: 1, name: 'John Doe', age: 30 },
// { id: 2, name: 'Jane Doe', age: 28 },
// { id: 3, name: 'Alice', age: 25 }
// ];
// this.columns = [
// { key: 'id', label: 'ID' },
// { key: 'name', label: 'Name' },
// { key: 'age', label: 'Age' }
// ];
console
.
log
(
this
.
data
);
},
(
error
)
=>
{
...
...
src/app/portal/assignment/manage/manage.component.html
View file @
885437c6
<p
>
{{ data }}
</p
>
<p
re>
{{ data | json }}
</pre
>
src/app/portal/assignment/manage/manage.component.ts
View file @
885437c6
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
,
Inject
}
from
'
@angular/core
'
;
import
{
MAT_DIALOG_DATA
}
from
'
@angular/material/dialog
'
;
@
Component
({
selector
:
'
app-manage
'
,
imports
:
[],
imports
:
[
CommonModule
],
templateUrl
:
'
./manage.component.html
'
,
styleUrl
:
'
./manage.component.scss
'
})
...
...
src/app/portal/assignment/service/prepare-assignment-table-data.service.spec.ts
0 → 100644
View file @
885437c6
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
PrepareAssignmentTableDataService
}
from
'
./prepare-assignment-table-data.service
'
;
describe
(
'
PrepareAssignmentTableDataService
'
,
()
=>
{
let
service
:
PrepareAssignmentTableDataService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
PrepareAssignmentTableDataService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/portal/assignment/service/prepare-assignment-table-data.service.ts
0 → 100644
View file @
885437c6
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Assignment
}
from
'
../interface/assignment
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
PrepareAssignmentTableDataService
{
constructor
()
{
}
public
prepareMatTableData
(
data
:
Assignment
[]):
any
{
debugger
let
dataArray
=
data
.
map
((
assignment
:
Assignment
)
=>
{
return
{
[
'
subject
'
]:
assignment
.
class_subject_subject_txt
[
'
en
'
],
[
'
section_details
'
]:
assignment
.
section_details
[
'
en
'
],
[
'
session_name
'
]:
assignment
.
session_session_name
[
'
en
'
],
[
'
id
'
]:
assignment
.
id
,
[
'
action
'
]:
[
'
view
'
,
'
edit
'
]
}
})
return
dataArray
;
// return [];
}
public
prepareMatTableColumn
(
data
:
Assignment
[]):
any
[]
{
let
columnArray
=
[
{
key
:
'
subject
'
,
label
:
'
Subject
'
},
{
key
:
'
section_details
'
,
label
:
'
Subject Details
'
},
{
key
:
'
session_name
'
,
label
:
'
Session Name
'
},
{
key
:
'
action
'
,
label
:
'
Action
'
},
];
return
columnArray
;
}
}
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