diff --git a/ui/src/containers/App/__snapshots__/App.test.tsx.snap b/ui/src/containers/App/__snapshots__/App.test.tsx.snap
index 2366916a79..ee244dae41 100644
--- a/ui/src/containers/App/__snapshots__/App.test.tsx.snap
+++ b/ui/src/containers/App/__snapshots__/App.test.tsx.snap
@@ -27,43 +27,103 @@ exports[`App should render the component correctly and match the snapshot 1`] =
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Contribute
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
@@ -73,6 +133,16 @@ exports[`App should render the component correctly and match the snapshot 1`] =
+
+
+
+
+
+
+
+
+
+
@@ -117,7 +187,7 @@ exports[`App should render the component correctly and match the snapshot 1`] =
-
+
@@ -158,7 +228,7 @@ exports[`App should render the component correctly and match the snapshot 1`] =
-
+
@@ -197,7 +267,7 @@ exports[`App should render the component correctly and match the snapshot 1`] =
-
+
@@ -236,7 +306,7 @@ exports[`App should render the component correctly and match the snapshot 1`] =
-
+
@@ -283,7 +353,7 @@ exports[`App should render the component correctly and match the snapshot 1`] =
-
+
diff --git a/ui/src/containers/Header/Header.css b/ui/src/containers/Header/Header.css
index f093d9ef9f..12278f886f 100644
--- a/ui/src/containers/Header/Header.css
+++ b/ui/src/containers/Header/Header.css
@@ -1,10 +1,49 @@
.hub-header-login {
color: white;
font-size: 1em;
+ margin-left: -0.3em;
+ vertical-align: 0em !important;
}
.header-search-hint svg {
vertical-align: 0em !important;
+ cursor: pointer;
+}
+
+.header-add-resource {
+ margin-top: -0.5em;
+}
+
+.header-add-resource svg {
margin-left: 0.2em;
cursor: pointer;
}
+
+.hub-header-contribute {
+ cursor: pointer;
+ font-size: 1em;
+ text-decoration: none;
+}
+
+.hub-header-login-margin {
+ margin-right: -1em;
+ margin-top: -0.6em;
+}
+
+.hub-header-contribute-margin {
+ margin-top: -0.6em;
+}
+
+.header-search-margin {
+ margin-top: 0.5em;
+}
+
+.header-dropdown > .pf-c-dropdown__toggle-icon {
+ margin-left: -0.1em;
+}
+
+.hub-header-contribute {
+ color: white;
+ font-size: 1em;
+ margin-left: 0.5em;
+}
diff --git a/ui/src/containers/Header/Header.test.tsx b/ui/src/containers/Header/Header.test.tsx
index fcce36813b..8ba51894ff 100644
--- a/ui/src/containers/Header/Header.test.tsx
+++ b/ui/src/containers/Header/Header.test.tsx
@@ -43,10 +43,10 @@ describe('Header', () => {
);
- expect(component.find('span').text()).toBe('Login');
+ expect(component.find('span').slice(3).text()).toBe('Login');
});
- it('should find Icon in header and it`s id', () => {
+ it('should find Icons in header and their id', () => {
const component = mount(
@@ -55,8 +55,10 @@ describe('Header', () => {
);
- expect(component.find(Icon).length).toBe(1);
- expect(component.find(Icon).props().id).toBe(Icons.Help);
+ const icons = component.find(Icon);
+ expect(icons.length).toBe(1);
+
+ expect(icons.slice(0).props().id).toBe(Icons.Help);
});
it('should render user profile', (done) => {
diff --git a/ui/src/containers/Header/__snapshots__/Header.test.tsx.snap b/ui/src/containers/Header/__snapshots__/Header.test.tsx.snap
index 186a6600cb..9b4633e2e7 100644
--- a/ui/src/containers/Header/__snapshots__/Header.test.tsx.snap
+++ b/ui/src/containers/Header/__snapshots__/Header.test.tsx.snap
@@ -19,43 +19,103 @@ exports[`Header should render the header component and find Search component 1`]
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Contribute
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
@@ -65,6 +125,16 @@ exports[`Header should render the header component and find Search component 1`]
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/containers/Header/index.tsx b/ui/src/containers/Header/index.tsx
index 20980de65a..3cd73db3d8 100644
--- a/ui/src/containers/Header/index.tsx
+++ b/ui/src/containers/Header/index.tsx
@@ -14,7 +14,11 @@ import {
ModalVariant,
TextContent,
TextList,
- TextListItem
+ TextListItem,
+ DropdownItem,
+ DropdownSeparator,
+ Dropdown,
+ DropdownToggle
} from '@patternfly/react-core';
import logo from '../../assets/logo/logo.png';
import { IconSize } from '@patternfly/react-icons';
@@ -30,26 +34,73 @@ const Header: React.FC = observer(() => {
const { user } = useMst();
const history = useHistory();
const [isModalOpen, setIsModalOpen] = React.useState(false);
+ const [isResInstModallOpen, setResInstModalOpen] = React.useState(false);
+ const [isCatInstModallOpen, setCatInstModalOpen] = React.useState(false);
+ const [isOpen, setIsOpen] = React.useState(false);
+
+ const dropdownItems = [
+ setResInstModalOpen(true)}>
+ Add a resource
+ ,
+ ,
+ setCatInstModalOpen(true)}>
+ Add a catalog
+ ,
+ ,
+
+ Submit a patch
+
+ ];
const headerTools = (
-
-
+
+
+
+
+
+ setIsModalOpen(true)} className="header-search-hint">
+
+
+
+
+
+
+
+
+ setIsOpen(!isOpen)}
+ isPlain
+ toggle={
+ setIsOpen(!isOpen)} className="header-dropdown">
+ Contribute
+
+ }
+ isOpen={isOpen}
+ dropdownItems={dropdownItems}
+ />
+
+
+
- setIsModalOpen(true)} className="header-search-hint">
-
+
+
+
+ {user.isAuthenticated &&
+ user.refreshTokenInfo.expiresAt * 1000 > global.Date.now() ? (
+
+ ) : (
+
+
+ Login
+
+
+ )}
+
+
- {user.isAuthenticated && user.refreshTokenInfo.expiresAt * 1000 > global.Date.now() ? (
-
- ) : (
-
-
- Login
-
-
- )}
);
@@ -82,6 +133,94 @@ const Header: React.FC = observer(() => {
+
+ setResInstModalOpen(false)}
+ width={'50%'}
+ >
+
+
+
+ Add a new Resource through{' '}
+
+ Tekton Catalog{' '}
+
+ and needs to follow these steps
+
+
+
+
+ Create a pull request to
+
+ Tekton Catalog{' '}
+
+ with the new resource which must be following the guidelines mentioned{' '}
+
+ here
+
+
+
+
+
+
+
+ setCatInstModalOpen(false)}
+ width={'50%'}
+ >
+
+
+
+ {' '}
+ Add your own catalog to the list of catalogs available on Hub
+
+
+
+
+ This{' '}
+
+ docs
+ {' '}
+ defines the requirement and steps to add your catalog to Hub
+
+
+
+
+ Note:
+
+
+ If you are adding your own catalog in hub then you need to contact hub owner to
+ refresh the config of deployed Hub
+
+
+ Newly added resource would be available on the Hub within 30 minutes once the PR
+ gets merged.
+
+
+
+
+
+
);
});
diff --git a/ui/src/containers/UserProfile/UserProfile.css b/ui/src/containers/UserProfile/UserProfile.css
index 1d911172af..981f6c27d3 100644
--- a/ui/src/containers/UserProfile/UserProfile.css
+++ b/ui/src/containers/UserProfile/UserProfile.css
@@ -5,6 +5,7 @@
.hub-userProfile {
margin-right: -1em;
+ margin-top: 0.6em;
outline: none;
}