Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jan Smejkal
Pa165 Secret Archive
Commits
3fbd78ef
Commit
3fbd78ef
authored
May 25, 2022
by
Juraj Fiala
Browse files
feat: Use list for missions
parent
fdbae058
Changes
2
Show whitespace changes
Inline
Side-by-side
frontend/src/app/mission/mission-list.component.html
View file @
3fbd78ef
<div
*ngIf=
"state === requestState.ERROR"
>
<div
*ngIf=
"state === requestState.ERROR"
>
Error occured: {{ errorMessage }}
Error occured: {{ errorMessage }}
</div>
</div>
<div
*ngIf=
"state === requestState.SUCCESS"
>
<div
*ngIf=
"state === requestState.SUCCESS"
class=
"main-container"
>
<
table
mat-table
[dataSource]=
"missions"
class=
"w-full"
>
<
mat-action-list
>
<
ng-container
matColumnDef=
"name
"
>
<
mat-list-item
*ngFor=
"let mission of missions"
[routerLink]=
"['/auth/mission/', mission.id]
"
>
<
th
mat
-header-cell
*matHeaderCellDef
>
Name
</th
>
<
p
mat
Line
class=
"!text-xs !tracking-widest uppercase"
>
{{mission.country.name}}
</p
>
<
td
mat
-cell
*matCellDef=
"let mission"
>
<
p
mat
Line
>
{{mission.name}}
</p
>
{{ mission.name }}
<mat-divider></mat-divider>
</td
>
</mat-list-item
>
</
ng-container
>
</
mat-action-list
>
<tr
mat-header-row
*matHeaderRowDef=
"displayedColumns"
></tr>
<button
mat-fab
color=
"accent"
class=
"!fixed right-8 bottom-20"
aria-label=
"Example icon button with a delete icon"
>
<tr
<mat-icon>
add
</mat-icon>
mat-row
</button>
class=
"hover:bg-gray-200"
routerLink=
"../mission/{{ row.id }}"
*matRowDef=
"let row; columns: displayedColumns"
></tr>
</table>
</div>
</div>
frontend/src/app/mission/mission-list.component.ts
View file @
3fbd78ef
...
@@ -6,11 +6,6 @@ import { environment } from '../../environments/environment';
...
@@ -6,11 +6,6 @@ import { environment } from '../../environments/environment';
import
{
RequestState
}
from
'
../request-state.enum
'
;
import
{
RequestState
}
from
'
../request-state.enum
'
;
import
{
Mission
}
from
'
./mission.interface
'
;
import
{
Mission
}
from
'
./mission.interface
'
;
interface
MissionTableItem
{
id
:
string
;
name
:
string
;
}
@
Component
({
@
Component
({
selector
:
'
mission-list
'
,
selector
:
'
mission-list
'
,
templateUrl
:
'
mission-list.component.html
'
,
templateUrl
:
'
mission-list.component.html
'
,
...
@@ -19,7 +14,7 @@ export class MissionListComponent implements OnInit {
...
@@ -19,7 +14,7 @@ export class MissionListComponent implements OnInit {
requestState
=
RequestState
;
requestState
=
RequestState
;
state
:
RequestState
=
this
.
requestState
.
PENDING
;
state
:
RequestState
=
this
.
requestState
.
PENDING
;
errorMessage
=
''
;
errorMessage
=
''
;
missions
:
Mission
TableItem
[]
=
[];
missions
:
Mission
[]
=
[];
displayedColumns
:
string
[]
=
[
'
name
'
];
displayedColumns
:
string
[]
=
[
'
name
'
];
constructor
(
private
httpClient
:
HttpClient
,
private
router
:
Router
)
{}
constructor
(
private
httpClient
:
HttpClient
,
private
router
:
Router
)
{}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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