-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added more information related to collects of public work * Possibility to download all collects of a public work as JSON file * Showing work status on public work view
- Loading branch information
1 parent
f27b37e
commit d039a69
Showing
27 changed files
with
154 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from "react"; | ||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; | ||
import {faDownload} from "@fortawesome/free-solid-svg-icons"; | ||
|
||
interface PublicWorkMenuProps { | ||
collectCount: number | ||
workState: string | ||
onDownloadClicked?: () => void | ||
} | ||
|
||
export const PublicWorkMenu: React.FC<PublicWorkMenuProps> = (props) => { | ||
|
||
const {collectCount, workState, onDownloadClicked} = props | ||
|
||
return ( | ||
<nav className="level"> | ||
<div className="level-item has-text-centered"> | ||
<div> | ||
<p className="heading">Coletas</p> | ||
<p className="title">{collectCount}</p> | ||
</div> | ||
</div> | ||
<div className="level-item"> | ||
<button className="button is-medium" onClick={onDownloadClicked}> | ||
<span className="icon"> | ||
<FontAwesomeIcon icon={faDownload}/> | ||
</span> | ||
<span>Baixar dados de coletas</span> | ||
</button> | ||
</div> | ||
<div className="level-item has-text-centered"> | ||
<div> | ||
<p className="heading">Estado da Obra</p> | ||
<span className="tag is-info">{workState}</span> | ||
</div> | ||
</div> | ||
</nav> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...a_dashboard/src/core/stores/UseStores.tsx → ...dashboard/src/core/contexts/UseStores.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import React from "react"; | ||
|
||
import {rootContext} from "../contexts/RootContext"; | ||
import {rootContext} from "./RootContext"; | ||
|
||
export const useStores =() => React.useContext(rootContext) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface WorkStatus { | ||
flag: number, | ||
name: string, | ||
description: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
trena_dashboard/src/core/network/services/WorkStatusService.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Config from "../../../config/Config"; | ||
import {network} from "../NetworkInterceptor"; | ||
import {WorkStatus} from "../../models/WorkStatus"; | ||
|
||
export class WorkStatusService { | ||
static async loadWorkStatus(): Promise<WorkStatus[]> { | ||
const call = Config.BASE_URL + "/workstatus/" | ||
return network.get(call) | ||
.then(res => { | ||
let listOfWorkStatus: WorkStatus[] = res.body | ||
|
||
return listOfWorkStatus | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {BaseStore} from "./BaseStore"; | ||
import {action, observable, runInAction} from "mobx"; | ||
import {WorkStatus} from "../models/WorkStatus"; | ||
import {WorkStatusService} from "../network/services/WorkStatusService"; | ||
|
||
export class WorkStatusStore extends BaseStore { | ||
|
||
@observable workStatusList: WorkStatus[] = []; | ||
|
||
@action | ||
async loadWorkStatus() { | ||
this.baseCall(async () => { | ||
const workStatus = await WorkStatusService.loadWorkStatus() | ||
runInAction(() => { | ||
this.workStatusList = workStatus; | ||
} | ||
) | ||
}) | ||
} | ||
|
||
getWorkStatusByFlag = (flag: number): WorkStatus | undefined => { | ||
return this.workStatusList.find(x => x.flag === flag) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters