Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PB138 - Film Database Group Project
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tomáš Havlíček
PB138 - Film Database Group Project
Commits
ca9f0f4f
There was an error fetching the commit references. Please try again later.
Commit
ca9f0f4f
authored
2 years ago
by
Tomáš Havlíček
Browse files
Options
Downloads
Patches
Plain Diff
feat: updated director browse page
parent
4091789a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/components/BrowseDirectors.tsx
+93
-2
93 additions, 2 deletions
frontend/src/components/BrowseDirectors.tsx
frontend/src/components/SearchPage.tsx
+2
-1
2 additions, 1 deletion
frontend/src/components/SearchPage.tsx
with
95 additions
and
3 deletions
frontend/src/components/BrowseDirectors.tsx
+
93
−
2
View file @
ca9f0f4f
import
{
Space
,
Card
,
Table
}
from
"
antd
"
;
import
React
from
"
react
"
import
React
from
"
react
"
import
{
Link
}
from
"
react-router-dom
"
;
import
{
DirectorIO
}
from
"
./Preview
"
const
exampleDirectors
:
DirectorIO
[]
=
[{
id
:
"
123
"
,
name
:
"
Karel
"
,
surname
:
"
Macka
"
,
birthdate
:
"
20.2.1987
"
,
},
{
id
:
"
456
"
,
name
:
"
Jan
"
,
surname
:
"
Vomacka
"
,
birthdate
:
"
20.12.1990
"
,
},
{
id
:
"
890
"
,
name
:
"
Karel
"
,
surname
:
"
Vomacka
"
,
birthdate
:
"
1.2.1987
"
,
},
{
id
:
"
666
"
,
name
:
"
Pan
"
,
surname
:
"
Natas
"
,
birthdate
:
"
20.2.1687
"
,
},
]
export
const
BrowseDirectors
=
()
=>
{
export
const
BrowseDirectors
=
()
=>
{
const
columns
=
[
{
title
:
"
Name
"
,
dataIndex
:
"
name
"
,
sorter
:
(
a
:
DirectorIO
,
b
:
DirectorIO
)
=>
{
//surname has higher priority
if
(
a
.
surname
<
b
.
surname
){
return
-
1
;}
if
(
a
.
surname
>
b
.
surname
){
return
1
;}
if
(
a
.
name
<
b
.
name
){
return
-
1
;}
if
(
a
.
name
>
b
.
name
){
return
1
;}
return
0
;
},
render
:
(
text
:
string
,
record
:
DirectorIO
)
=>
(
<
Link
to
=
{
`/director/
${
record
.
id
}
`
}
>
<
a
>
{
record
.
name
}
{
record
.
surname
}
</
a
>
</
Link
>
),
},
{
title
:
"
Birthdate
"
,
className
:
"
birthdate
"
,
dataIndex
:
"
birthdate
"
,
sorter
:
(
a
:
DirectorIO
,
b
:
DirectorIO
)
=>
{
const
first
=
a
.
birthdate
.
split
(
'
.
'
).
reverse
();
const
second
=
b
.
birthdate
.
split
(
'
.
'
).
reverse
();
if
(
first
[
0
]
>
second
[
0
]){
return
1
;}
if
(
first
[
0
]
<
second
[
0
]){
return
-
1
;}
if
(
first
[
1
]
>
second
[
1
]){
return
1
;}
if
(
first
[
1
]
<
second
[
1
]){
return
-
1
;}
if
(
first
[
2
]
>
second
[
2
]){
return
1
;}
if
(
first
[
2
]
<
second
[
2
]){
return
-
1
;}
return
0
;},
}
];
return
(
return
(
<
div
>
This will be Director Browse page.
</
div
>
<
div
className
=
"browse-container"
>
)
<
Space
direction
=
"vertical"
size
=
"middle"
style
=
{
{
padding
:
"
4%
"
}
}
>
<
Table
columns
=
{
columns
}
dataSource
=
{
exampleDirectors
}
>
</
Table
>
</
Space
>
</
div
>
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/src/components/SearchPage.tsx
+
2
−
1
View file @
ca9f0f4f
...
@@ -81,6 +81,7 @@ export const SearchPage = () => {
...
@@ -81,6 +81,7 @@ export const SearchPage = () => {
},
},
},
},
{
{
title
:
"
Release Date
"
,
title
:
"
Release Date
"
,
dataIndex
:
"
published
"
,
dataIndex
:
"
published
"
,
sorter
:
(
a
:
MovieIO
,
b
:
MovieIO
)
=>
{
sorter
:
(
a
:
MovieIO
,
b
:
MovieIO
)
=>
{
...
@@ -148,7 +149,7 @@ export const SearchPage = () => {
...
@@ -148,7 +149,7 @@ export const SearchPage = () => {
onRow
=
{
(
record
,
rowIndex
)
=>
{
onRow
=
{
(
record
,
rowIndex
)
=>
{
return
{
return
{
onClick
:
(
event
)
=>
{
onClick
:
(
event
)
=>
{
console
.
log
(
record
.
id
);
console
.
log
(
record
.
id
);
//remove later
},
},
};
//here change to view movie
};
//here change to view movie
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment