Skip to content

Hpe private section #2532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/community/EzmeralSoftwareForum.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linkname: Go to the HPE Ezmeral Forum
description: Want to stay updated on how to deploy in any cloud, on any hardware
and is 100% open source Kubernetes? Join the discussion.
active: true
priority: 7
priority: 8
image: /img/community/EzmeralForum192_192.png
---
...
9 changes: 9 additions & 0 deletions content/community/HPEInnovationCentral.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: HPE Innovation Central
link: https://hpe.sharepoint.com/teams/InnovationCentral/SitePages/index.aspx
linkname: Start Innovating
description: Being innovative is part of our DNA and heritage. Everyone at HPE has the opportunity to be an innovator - all ideas are welcome!
active: true
priority: 1
image: /img/community/HPE-Innovation.jpg
---
2 changes: 1 addition & 1 deletion content/community/OSScontribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ link: /OSScontribute
linkname: Start contributing
description: I'd like to start contributing to open source software.
active: true
priority: 5
priority: 6
image: /img/github-mark.png
---
.
2 changes: 1 addition & 1 deletion content/community/Slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
link: /slack-signup
linkname: Join us on Slack
description: Have questions or just want to chat with other devs who work at HPE?
priority: 1
priority: 2
image: '/img/community/slack.svg'
active: true
---
Expand Down
2 changes: 1 addition & 1 deletion content/community/Twitter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ link: https://twitter.com/HPE_Developer
linkname: Follow us on Twitter
description: Interested in what’s currently happening in the HPE Developer Community?
active: true
priority: 2
priority: 3
image: /img/logo-black.png
---
Text
2 changes: 1 addition & 1 deletion content/community/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linkname: Get Started
description: Give back to the community by sharing your knowledge. Write an
article or tutorial and contribute to the HPE Developer blog.
active: true
priority: 4
priority: 5
image: /img/community/contribute.svg
---
.
2 changes: 1 addition & 1 deletion content/community/newsletter.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linkname: Read our Newsletters
description: Subscribe to our HPE Developer Newsletter to stay up-to-date on the
newest HPE Developer Community activities, posts, and tutorials.
active: true
priority: 3
priority: 4
image: /img/community/newsletter.svg
---
...
2 changes: 1 addition & 1 deletion content/community/openSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Open collaboration is in HPE’s DNA. We believe open source
technologies and communities can help deliver innovative solutions securely
and at scale.
active: true
priority: 6
priority: 7
image: /img/community/opensource.svg
---
...
53 changes: 51 additions & 2 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
import { Menu, Search, FormDown } from 'grommet-icons';
import styled from 'styled-components';
import { AppContext } from '../../providers/AppProvider';
import { ButtonLink } from '..';
import { ButtonLink,ExternalButtonLink } from '..';
import { UserMenu } from './UserMenu';

import { validateHpeEmail } from '../../pages/community';

const TextAlignLeft = styled(Box)`
& > a {
Expand Down Expand Up @@ -294,6 +294,55 @@ function Header() {
/>,
);
}

if (validateHpeEmail(userDetail?.email))
{
navLinks.push(
<DropButton
label='HPE Only'
align="start"
dropAlign={{ top: 'bottom', left: 'left' }}
icon={<FormDown />}
reverse
dropContent={
<TextAlignLeft>
<ExternalButtonLink
key="hpeonly1"
label="HPE Innovation Central"
to="https://hpe.sharepoint.com/teams/InnovationCentral/SitePages/index.aspx"
state={{ state: { isPlatformHeaderClicked: true } }}
alignSelf="start"
fill="horizontal"
/>
<ExternalButtonLink
key="hpeonly2"
label="Technical Career Path"
to="https://hpe.sharepoint.com/sites/F5/CTO/Office/tcp/Pages/index.aspx"
state={{ state: { isPlatformHeaderClicked: true } }}
alignSelf="start"
fill="horizontal"
/>
<ExternalButtonLink
key="hpeonly3"
label="HPE GreenLake Developer Standards"
to=" https://developer.greenlake.hpe.com/docs/greenlake/standards/"
state={{ state: { isPlatformHeaderClicked: true } }}
alignSelf="start"
fill="horizontal"
/>
<ExternalButtonLink
key="hpeonly4"
label="Application integration with HPE GreenLake platform"
to="https://developer.greenlake.hpe.com/docs/greenlake/guides/internal/platform/app_onboarding/onboarding/"
state={{ state: { isPlatformHeaderClicked: true } }}
alignSelf="start"
fill="horizontal"
/>
</TextAlignLeft>
}
/>,
);
}
if (size === 'small') {
navLinks.push(
<ButtonLink
Expand Down
32 changes: 29 additions & 3 deletions src/pages/community/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useContext, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { graphql } from 'gatsby';
import { Heading, Paragraph } from 'grommet';
Expand All @@ -12,6 +12,7 @@ import {
ResponsiveGrid,
} from '../../components';
import { useSiteMetadata } from '../../hooks/use-site-metadata';
import { AppContext } from '../../providers/AppProvider';

Heading.propTypes = {
children: PropTypes.node.isRequired,
Expand All @@ -30,10 +31,29 @@ const rows = {
large: ['auto'],
xlarge: ['auto'],
};

export const validateHpeEmail = (user) => {
const hpeEmailPattern = /@hpe\.com$/;
console.log('validateEmail : ',user);
if (hpeEmailPattern.test(user))
{
console.log('Email is from HPE user');
return true;
}
console.log('Email is from outsider');
return false;
};

function Community({ data }) {
const communities = data.allMarkdownRemark.edges;
const siteMetadata = useSiteMetadata();
const siteTitle = siteMetadata.title;
const { user }= useContext(AppContext);
const [email,setEmail]=useState(user?.email || ';');
useEffect(()=>{
setEmail(user?.email);
},[user]);
console.log('Community : ',email);
return (
<Layout title={siteTitle}>
<SEO title="Community" />
Expand All @@ -49,9 +69,15 @@ function Community({ data }) {
</PageDescription>
<SectionHeader>
<ResponsiveGrid rows={rows} columns={columns}>
{communities.map((community) => (
{ validateHpeEmail(email)
? communities.map((community) => (
<CommunityCard key={community.node.id} node={community.node} />
))}
))
: communities.filter((community)=>
community.node.frontmatter.title!=='HPE Innovation Central')
.map((community)=>
<CommunityCard key={community.node.id} node={community.node}/>)
}
</ResponsiveGrid>
</SectionHeader>
</Layout>
Expand Down
Binary file added static/img/community/HPE-Innovation.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.