Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 24700d0

Browse files
committed
Added Last changes
1 parent b3de8fa commit 24700d0

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

webapp_frontend/src/background/api/filesystem.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const exampleValue = (path: string): BackendFolderContentsData => {
4848
{
4949
"createdByUserId": 1,
5050
"id": 0,
51-
"lastUpdated": 1607177368 ,
51+
"lastUpdated": 1597177368 ,
5252
"name": "text.txt",
5353
"permissionSet": {
5454
"editableForGroups": [
@@ -82,7 +82,7 @@ const exampleValue = (path: string): BackendFolderContentsData => {
8282
{
8383
"createdByUserId": 2,
8484
"id": 0,
85-
"lastUpdated": 1607147368 ,
85+
"lastUpdated": 1599147368 ,
8686
"name": "sound.mp3",
8787
"permissionSet": {
8888
"editableForGroups": [
@@ -116,7 +116,7 @@ const exampleValue = (path: string): BackendFolderContentsData => {
116116
{
117117
"createdByUserId": 1,
118118
"id": 0,
119-
"lastUpdated": 1607047368 ,
119+
"lastUpdated": 1602047368 ,
120120
"name": "movie.mp4",
121121
"permissionSet": {
122122
"editableForGroups": [
@@ -150,7 +150,7 @@ const exampleValue = (path: string): BackendFolderContentsData => {
150150
{
151151
"createdByUserId": 2,
152152
"id": 0,
153-
"lastUpdated": 1607149968 ,
153+
"lastUpdated": 1599949968 ,
154154
"name": "image.jpg",
155155
"permissionSet": {
156156
"editableForGroups": [
@@ -184,7 +184,7 @@ const exampleValue = (path: string): BackendFolderContentsData => {
184184
{
185185
"createdByUserId": 1313,
186186
"id": 0,
187-
"lastUpdated": 1607132468 ,
187+
"lastUpdated": 1599992468 ,
188188
"name": "importantFile.md",
189189
"permissionSet": {
190190
"editableForGroups": [
@@ -218,7 +218,7 @@ const exampleValue = (path: string): BackendFolderContentsData => {
218218
{
219219
"createdByUserId": 2,
220220
"id": 0,
221-
"lastUpdated": 1607149968 ,
221+
"lastUpdated": 1601584968 ,
222222
"name": "likeMe.html",
223223
"permissionSet": {
224224
"editableForGroups": [
@@ -253,7 +253,7 @@ const exampleValue = (path: string): BackendFolderContentsData => {
253253
"folders": [{
254254
"createdByUserId": 0,
255255
"id": 0,
256-
"lastUpdated": 0,
256+
"lastUpdated": 1601148846,
257257
"name": "unterBla",
258258
"path": "/bla/unterBla",
259259
"permissionSet": {

webapp_frontend/src/components/pages/filesytem/FileListItem.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
FolderIcon
1010
} from "../../../elements/svg/SymbolFile";
1111
import {reverseString} from "../../../background/methods/strings";
12+
import {getDateAsStringFromTimestamp} from "../../../background/methods/time";
1213

1314
type Props = {
1415
fileListItem: FileListEntity;
@@ -34,8 +35,8 @@ export default function FileListItem(props: Props): ReactElement {
3435

3536
const ICON_HEIGHT = "40px";
3637

37-
const rightFileIcon = (type: string, name: string): ReactElement => {
38-
if (type.toLowerCase() === "folder") return <FolderIcon height={ICON_HEIGHT} width={"auto"}
38+
const FileIcon = (isFolder: boolean, name: string): ReactElement => {
39+
if (isFolder) return <FolderIcon height={ICON_HEIGHT} width={"auto"}
3940
color={"secondary"}/>
4041
let positionOfPoint = reverseString(name).indexOf(".");
4142
if (positionOfPoint < 0) return <FileEarmarkIcon height={ICON_HEIGHT} width={"auto"} color={"secondary"}/>
@@ -71,12 +72,12 @@ export default function FileListItem(props: Props): ReactElement {
7172
<Form.Check type="checkbox" onChange={() => console.log(`[files] selected ${props.fileListItem.id}`)}/>
7273
</Form.Group></Col>
7374
<Col xs={1}>{props.fileListItem.type}</Col>
74-
<Col xs={1}>{rightFileIcon(props.fileListItem.type, props.fileListItem.name)}</Col>
75+
<Col xs={1}>{FileIcon(props.fileListItem.isFolder, props.fileListItem.name)}</Col>
7576
<Col xs={1}>...</Col>
7677
<Col xs={3}><Link to={`/file${props.fileListItem.path ?? ""}`}
7778
onClick={() => onClick()}>{props.fileListItem.name}</Link></Col>
7879
<Col xs={3}>{props.fileListItem.createdByUserId}</Col>
79-
<Col xs={1}>{props.fileListItem.lastUpdated}</Col>
80+
<Col xs={1}>{getDateAsStringFromTimestamp(props.fileListItem.lastUpdated)}</Col>
8081
<Col xs={1}>{props.fileListItem.size}</Col>
8182
</>
8283
)

0 commit comments

Comments
 (0)