Skip to content

Commit

Permalink
Adds few UI modification
Browse files Browse the repository at this point in the history
This patch adds:
- Adds Tooltip to resource catalog and kind icon on resource card
- Adds Tooltip to average rating on resource details page
- Reduce space between rating and rating icon on resource details page
- Replace CRA icon(browser icon) with Tekton logo
- Moves alert a little bit down
- Modifies resource description page width

Signed-off-by: Shiv Verma <[email protected]>
  • Loading branch information
pratap0007 committed Dec 23, 2020
1 parent 77cb573 commit 0c833fe
Show file tree
Hide file tree
Showing 16 changed files with 403 additions and 264 deletions.
Binary file removed ui/public/favicon.ico
Binary file not shown.
7 changes: 3 additions & 4 deletions ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/tekton.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<meta name="description" content="All Things Tekton" />

<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
Binary file removed ui/public/logo192.png
Binary file not shown.
Binary file removed ui/public/logo512.png
Binary file not shown.
17 changes: 0 additions & 17 deletions ui/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
Expand Down
Binary file added ui/public/tekton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 70 additions & 42 deletions ui/src/components/Cards/__snapshots__/Cards.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ exports[`Cards should render the resources on cards 1`] = `
<Link to={{...}} className=\\"hub-card-link\\">
<Card className=\\"hub-resource-card\\">
<CardHeader>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
<Tooltip content={{...}}>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
</Tooltip>
<Tooltip content={{...}}>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
</Tooltip>
<CardActions>
<span className=\\"hub-rating-icon\\">
<Icon id=\\"star\\" size=\\"sm\\" label=\\"4\\" />
Expand Down Expand Up @@ -52,12 +56,16 @@ exports[`Cards should render the resources on cards 1`] = `
<Link to={{...}} className=\\"hub-card-link\\">
<Card className=\\"hub-resource-card\\">
<CardHeader>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
<Tooltip content={{...}}>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
</Tooltip>
<Tooltip content={{...}}>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
</Tooltip>
<CardActions>
<span className=\\"hub-rating-icon\\">
<Icon id=\\"star\\" size=\\"sm\\" label=\\"5\\" />
Expand Down Expand Up @@ -97,12 +105,16 @@ exports[`Cards should render the resources on cards 1`] = `
<Link to={{...}} className=\\"hub-card-link\\">
<Card className=\\"hub-resource-card\\">
<CardHeader>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
<Tooltip content={{...}}>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
</Tooltip>
<Tooltip content={{...}}>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
</Tooltip>
<CardActions>
<span className=\\"hub-rating-icon\\">
<Icon id=\\"star\\" size=\\"sm\\" label=\\"5\\" />
Expand Down Expand Up @@ -142,12 +154,16 @@ exports[`Cards should render the resources on cards 1`] = `
<Link to={{...}} className=\\"hub-card-link\\">
<Card className=\\"hub-resource-card\\">
<CardHeader>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
<Tooltip content={{...}}>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
</Tooltip>
<Tooltip content={{...}}>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
</Tooltip>
<CardActions>
<span className=\\"hub-rating-icon\\">
<Icon id=\\"star\\" size=\\"sm\\" label=\\"5\\" />
Expand Down Expand Up @@ -190,12 +206,16 @@ exports[`Cards should render the resources on cards 1`] = `
<Link to={{...}} className=\\"hub-card-link\\">
<Card className=\\"hub-resource-card\\">
<CardHeader>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
<Tooltip content={{...}}>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
</Tooltip>
<Tooltip content={{...}}>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
</Tooltip>
<CardActions>
<span className=\\"hub-rating-icon\\">
<Icon id=\\"star\\" size=\\"sm\\" label=\\"5\\" />
Expand Down Expand Up @@ -236,12 +256,16 @@ exports[`Cards should render the resources on cards 1`] = `
<Link to={{...}} className=\\"hub-card-link\\">
<Card className=\\"hub-resource-card\\">
<CardHeader>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
<Tooltip content={{...}}>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"build\\" size=\\"sm\\" label=\\"Task\\" />
</span>
</Tooltip>
<Tooltip content={{...}}>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"user\\" size=\\"sm\\" label=\\"tekton\\" />
</span>
</Tooltip>
<CardActions>
<span className=\\"hub-rating-icon\\">
<Icon id=\\"star\\" size=\\"sm\\" label=\\"4.5\\" />
Expand Down Expand Up @@ -281,12 +305,16 @@ exports[`Cards should render the resources on cards 1`] = `
<Link to={{...}} className=\\"hub-card-link\\">
<Card className=\\"hub-resource-card\\">
<CardHeader>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"domain\\" size=\\"sm\\" label=\\"Pipeline\\" />
</span>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"cat\\" size=\\"sm\\" label=\\"tekton-hub\\" />
</span>
<Tooltip content={{...}}>
<span className=\\"hub-kind-icon\\">
<Icon id=\\"domain\\" size=\\"sm\\" label=\\"Pipeline\\" />
</span>
</Tooltip>
<Tooltip content={{...}}>
<span className=\\"hub-catalog-icon\\">
<Icon id=\\"cat\\" size=\\"sm\\" label=\\"tekton-hub\\" />
</span>
</Tooltip>
<CardActions>
<span className=\\"hub-rating-icon\\">
<Icon id=\\"star\\" size=\\"sm\\" label=\\"4.5\\" />
Expand Down
30 changes: 17 additions & 13 deletions ui/src/components/Cards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ import {
TextContent,
Badge,
CardFooter,
GalleryItem
GalleryItem,
Tooltip
} from '@patternfly/react-core';
import { Link } from 'react-router-dom';
import { IconSize } from '@patternfly/react-icons';
import { IResource } from '../../store/resource';
import { ITag } from '../../store/category';
import Icon from '../Icon';
import { Icons } from '../../common/icons';
import { titleCase } from '../../common/titlecase';
import './Cards.css';

interface Props {
Expand All @@ -35,18 +37,20 @@ const Cards: React.FC<Props> = (resources) => {
>
<Card className="hub-resource-card">
<CardHeader>
<span className="hub-kind-icon">
<Icon id={resource.kind.icon} size={IconSize.sm} label={resource.kind.name} />
</span>

<span className="hub-catalog-icon">
<Icon
id={resource.catalog.icon}
size={IconSize.sm}
label={resource.catalog.name}
/>
</span>

<Tooltip content={<b> {resource.kind.name}</b>}>
<span className="hub-kind-icon">
<Icon id={resource.kind.icon} size={IconSize.sm} label={resource.kind.name} />
</span>
</Tooltip>
<Tooltip content={<b>{titleCase(resource.catalog.name)} </b>}>
<span className="hub-catalog-icon">
<Icon
id={resource.catalog.icon}
size={IconSize.sm}
label={resource.catalog.name}
/>
</span>
</Tooltip>
<CardActions>
<span className="hub-rating-icon">
<Icon id={Icons.Star} size={IconSize.sm} label={String(resource.rating)} />
Expand Down
1 change: 0 additions & 1 deletion ui/src/components/Description/Description.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.hub-description {
max-width: 90em;
margin: auto;
margin-top: 2em;
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/Description/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Description: React.FC<Props> = (props) => {
) : (
<React.Fragment>
<Grid className="hub-description">
<GridItem span={12}>
<GridItem offset={1} span={10}>
<Card>
<CardHeader className="hub-description-header">
<Grid className="hub-tabs">
Expand Down
4 changes: 4 additions & 0 deletions ui/src/containers/App/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
position: fixed;
width: 100%;
}

.pf-c-alert {
margin-top: 3em;
}
13 changes: 12 additions & 1 deletion ui/src/containers/BasicDetails/BasicDetails.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,20 @@

.hub-details-average-rating {
position: relative;
left: 3em;
}

.hub-details-average-rating svg {
color: #484848;
}

.hub-details-rating__margin {
margin-top: 1em;
}

.hub-details-rating-tooptip {
margin-left: -1em;
}

.hub-details-rating-value {
margin-left: -0.3em;
}
Loading

0 comments on commit 0c833fe

Please sign in to comment.