Skip to content

Commit

Permalink
fix(client): implement review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-cavazzi committed Nov 3, 2022
1 parent 0f112cd commit 484f2c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 99 deletions.
6 changes: 4 additions & 2 deletions client/src/utils/components/ExternalLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,13 @@ function ExternalDocsLink(props) {
*/
function IconLink(props) {
const [uniqueId, ] = useState(`icon-link-${_.uniqueId()}`);
const classes = `${props.className} icon-link`;
let iconClass = "icon-link ";
if (props.className)
iconClass += props.className;

return <span>
<Link to={props.to} id={uniqueId} >
<FontAwesomeIcon className={classes} icon={props.icon} />
<FontAwesomeIcon className={iconClass} icon={props.icon} />
</Link>
<ThrottledTooltip target={uniqueId} tooltip={props.tooltip} />
</span>;
Expand Down
4 changes: 2 additions & 2 deletions client/src/utils/components/entities/Duration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ function EntityDuration({
if (duration == null)
return null;
const elemId = `duration-${workflowId}`;

const durationDesc = "Estimated runtime";
return (
<>
<p id={elemId}>
<span className="text-rk-text small">Runs in</span> {Time.getDuration(duration)}
</p>
<UncontrolledTooltip key={`duration-elem-${elemId}`} placement="top" target={elemId}>
<span>Esitmated runtime</span>
<span>{durationDesc}</span>
</UncontrolledTooltip>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion client/src/utils/components/entityHeader/EntityHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function EntityHeader({
<div className="card-bg-title card-bg-title--large" data-cy={`${itemType}-title`}>{title}</div>
<div className="d-flex justify-content-between align-items-center m-3">
<EntityLabel type={itemType} workflowType={null} />
{ visibility ? (<VisibilityIcon visibility={visibility} className="" />) : null }
{ visibility ? (<VisibilityIcon visibility={visibility} />) : null }
</div>
</div>
<div className="card-body">
Expand Down
94 changes: 0 additions & 94 deletions client/src/workflows/Workflows.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,98 +219,4 @@ class WorkflowsCoordinator {
}


/**
* Temporary function to simulate a response
* @param workflowId - real id to keep the simulated response data coherent (also for the cache comparison)
* @returns fake response
*/
// ! TODO: move this to a cypress test
async function tmpReturnResponse(workflowId: string) { // eslint-disable-line
await new Promise(r => setTimeout(r, 500));
return {
"error": null,
"result": {
"id": workflowId,
"name": "echo-A-09883",
"description": "Echo a file",
"creators": [
{
"name": "John Doe",
"email": "jd@example.com",
"affiliation": "SDSC"
}
],
"type": "Plan",
"created": "2022-09-26T13:45:35.171Z",
"last_executed": "2022-09-26T13:45:35.171Z",
"keywords": [
"bio",
"image-processing"
],
"number_of_executions": 5,
"touches_existing_files": true,
"command": "python",
"full_command": "python myscript.py -i input.txt > output.txt", // eslint-disable-line
"inputs": [
{
"id": "/plans/ecf03c735e9f4554adf14fce6271bd93/inputs/1",
"plan_id": "/plans/ecf03c735e9f4554adf14fce6271bd93",
"type": "Input",
"name": "input-1",
"description": "string",
"default_value": "string",
"prefix": "-p",
"position": 0,
"mapped_to": "stdin", // eslint-disable-line
"encoding_format": [
"inode/directory"
],
"exists": true
}
],
"outputs": [
{
"id": "/plans/ecf03c735e9f4554adf14fce6271bd93/outputs/2",
"plan_id": "/plans/ecf03c735e9f4554adf14fce6271bd93",
"type": "Output",
"name": "output-2",
"description": "string",
"default_value": "string",
"prefix": "--o=",
"position": 0,
"mapped_to": "stdout",
"encoding_format": [
"inode/directory"
],
"create_folder": true,
"exists": true,
"last_touched_by_this_plan": true
}
],
"parameters": [
{
"id": "/plans/ecf03c735e9f4554adf14fce6271bd93/parameters/1",
"plan_id": "/plans/ecf03c735e9f4554adf14fce6271bd93",
"type": "Parameter",
"name": "string",
"description": "string",
"default_value": "string",
"prefix": "-p",
"position": 0
}
],
"success_codes": [
0
],
"annotations": [
{
"id": "/annotations/abcf03c735e9f4554adf14fce6271bd93",
"source": "renku",
"body": {}
}
]
}
};
}

export { WorkflowsCoordinator };

0 comments on commit 484f2c5

Please sign in to comment.