Skip to content
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

update empty state secondary masthead flows #1836

Merged
merged 2 commits into from Jul 10, 2019

Conversation

karthikjeeyar
Copy link
Contributor

@karthikjeeyar karthikjeeyar commented Jun 26, 2019

This PR contains the following changes

  • Added the project list as the landing page in Add, Topology, Build and Pipeline pages
  • Added the create project link in Add page
  • on clicking a project in the list will change the context on the project selector

screencast-localhost-9000-2019 06 27-04-03-19

cc: @christianvogt @serenamarie125

Story: https://jira.coreos.com/browse/ODC-1023

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 26, 2019
@spadgett spadgett added this to the v4.2 milestone Jun 27, 2019
@karthikjeeyar karthikjeeyar force-pushed the landing-page branch 2 times, most recently from a1f00d5 to 4f4bb72 Compare June 27, 2019 09:28
Copy link
Contributor

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthikjeeyar getting this warning whenever projects list page is refreshed

Warning: Failed prop type: The prop `aria-label` is marked as required in `VirtualGrid`, but its value is `null`.
    in VirtualGrid (created by VirtualTableBody)
    in VirtualTableBody (created by VirtualBody)
    in VirtualBody (created by AutoSizer)
    in div (created by AutoSizer)

frontend/public/components/namespace.jsx Outdated Show resolved Hide resolved
@sahil143
Copy link
Contributor

@karthikjeeyar while clicking on a project from the add page takes me to add page of that project
Screenshot from 2019-06-27 16-34-02
but creating a new project from the add page redirects to the overview of the newly created Project instead of empty state of add page. Is this the correct flow?
Screenshot from 2019-06-27 16-35-51

@karthikjeeyar
Copy link
Contributor Author

@karthikjeeyar while clicking on a project from the add page takes me to add page of that project
Screenshot from 2019-06-27 16-34-02
but creating a new project from the add page redirects to the overview of the newly created Project instead of empty state of add page. Is this the correct flow?
Screenshot from 2019-06-27 16-35-51

@sahil143 Added the support for redirection in the previous PR #1811
once this PR goes in then we will be redirected as intended

@karthikjeeyar
Copy link
Contributor Author

@karthikjeeyar getting this warning whenever projects list page is refreshed

Warning: Failed prop type: The prop `aria-label` is marked as required in `VirtualGrid`, but its value is `null`.
    in VirtualGrid (created by VirtualTableBody)
    in VirtualTableBody (created by VirtualBody)
    in VirtualBody (created by AutoSizer)
    in div (created by AutoSizer)

@sahil143 I have noticed this warning without my changes as well, It is an already existing warning message. we need to fix it in a separate PR
CC: @christianvogt

@karthikjeeyar
Copy link
Contributor Author

@sahil143 added the requested changes.

@serenamarie125
Copy link
Contributor

Just verifying that this new behavior should only occur when "All Projects" is selected in the Project Selector. Looks that way, but I can't verify.

but creating a new project from the add page redirects to the overview of the newly created Project instead of empty state of add page. Is this the correct flow?

This isn't the correct flow. If the user creates a new project from the +Add page, the flow should be:

  • create a new project
  • select that project in the project select
  • remain on the +Add page

};
ProjectSelectorRow.displayName = 'ProjectSelectorRow';

export const ProjectsTable = props => <Table {...props} aria-label="Projects" Header={ProjectTableHeader} Row={ProjectSelectorRow} virtualize />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that this should live in dev console for now.

title: string;
children?: React.ReactNode;
}
const HintBlock: React.FC<HintBlockProps> = (props) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is used in a single location: DefaultPage.
Could you just merge the contents of this into DefaultPage? It doesn't really add much value over the PageHeading and SectionDivider separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it

{namespace ? (
<ODCEmptyState title="+Add" />
) : (
<DefaultPage title="Add">

This comment was marked as resolved.

exact: true,
path: ['/buildconfigs/all-namespaces', '/buildconfigs/ns/:ns'],
loader: async () =>
(await import('./components/BuildconfigPage' /* webpackChunkName: "dev-console-import" */))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the chunk name.

Select a project to start adding to it or
<button
type="button"
className="btn btn-link btn-link--no-padding"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btn-link--no-padding doesn't seem to do anything.
The button alignment looks off:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btn-link--no-padding doesn't seem to do anything.
The button alignment looks off:
image

We use btn-link--no-btn-default-values (although I'd like to rename it).

Looks like we have another btn-link--no-padding we should fix:

packages/dev-console/src/components/source-to-image/SourceToImage.tsx
324: className="btn btn-link btn-link--no-padding"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used btn-link--no-btn-default-values to fix the alignment issue.
screenshot-localhost-9000-2019 06 29-00-53-23

const HintBlock: React.FC<HintBlockProps> = (props) => (
<React.Fragment>
<PageHeading title={props.title}>{props.children}</PageHeading>
<SectionDivider />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very harsh line:
image

UX design had a soft line:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the border color

style={{
marginTop: '30px',
marginBottom: '30px',
borderBottom: '0.8px solid var(--pf-global--BackgroundColor--light-300)',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we consider $color-grey-background-border(#ccc) for consistency with other pages? We should eventually align with PF4 palette, but we use #ccc elsewhere today.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to #ccc

@karthikjeeyar karthikjeeyar force-pushed the landing-page branch 2 times, most recently from 0476f76 to 6104968 Compare June 28, 2019 19:23
@karthikjeeyar
Copy link
Contributor Author

This isn't the correct flow. If the user creates a new project from the +Add page, the flow should be:

  • create a new project
  • select that project in the project select
  • remain on the +Add page

@serenamarie125 @sahil143 The above-mentioned flow is implemented in the previous PR https://github.com/openshift/console/pull/1811. This PR contains only the project list as a default page when all projects is selected in project selector.

@karthikjeeyar
Copy link
Contributor Author

/retest

{namespace ? (
<ODCEmptyState title="+Add" />
) : (
<DefaultPage title="+Add">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@serenamarie125 Please confirm if the page header should be +Add or Add

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Page header should just be “Add”

@rohitkrai03
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2019
<ODCEmptyState title="+Add" />
) : (
<DefaultPage title="+Add">
<div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this extra div?

<BuildsPage {...props} />
) : (
<DefaultPage title="Builds">
<div>Select a project to view the builds</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this extra div?

/>
) : (
<DefaultPage title="Pipelines">
<div>Select a project to view the list of pipelines</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this extra div?

@@ -67,7 +68,9 @@ const TopologyPage: React.FC<Props> = ({ match, activeApplication }) => {
render={renderTopology}
/>
) : (
<EmptyMsg />
<DefaultPage title="Topology">
<div>Select a project to view the topology</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this extra div?

import { PageHeading } from '@console/internal/components/utils';
import './DefaultPage.scss';

interface DefaultPageProps {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Export the prop types.

)(({ project, setActiveNamespace }) => (
<span className="co-resource-item co-resource-item--truncate">
<ResourceIcon kind="Project" />
<button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add e title to be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResourceIcon doesn't have title, only ResourceLink component has the title property

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this button doesn't have the title.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added title prop to the button

@@ -136,14 +136,36 @@ const ProjectTableHeader = () => {
};
ProjectTableHeader.displayName = 'ProjectTableHeader';

const ProjectTableRow = ({obj: project, index, key, style}) => {
const projectLink = connect(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Component names should be Pascal case

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2019
<span className="co-resource-item">
<ResourceLink kind="Project" name={project.metadata.name} title={project.metadata.uid} />
</span>
{customData && ProjectLinkComponent ? (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to reuse the ProjectTableRow component in the dev console pages, I have used the customData prop to pass the custom Component to the first cell in the row. @spadgett what do you think about this approach?
cc: @christianvogt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are couple of ways this could be done. Not sure if one way is really better than the other considering this is sort of an internal implementation detail.

<ResourceKebab actions={projectMenuActions} kind="Project" resource={project} />
</TableData>
{
actionsEnabled && (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used customData prop here to disable the resource action column.

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2019
@christianvogt
Copy link
Contributor

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 3, 2019
@christianvogt
Copy link
Contributor

On hold because there are some doubts regarding the customization of routes.

@christianvogt
Copy link
Contributor

/approve cancel
/lgtm cancel

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 4, 2019
@karthikjeeyar
Copy link
Contributor Author

PR has been updated with the additional changes which contain perspective property in page/route extension and overriding default k8s routes to show a different component in dev perspective. This PR is now ready for review.
cc: @christianvogt

@karthikjeeyar
Copy link
Contributor Author

/retest

);
};

export default BuildConfigPage;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename file to BuildConfigPage.tsx

<title>Builds</title>
</Helmet>
{namespace ? (
<BuildConfigsPage filterLabel="Resources by name" {...props} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not change the filterLabel. Make it an optional prop in build-config.tsx

{namespace ? (
<BuildConfigsPage filterLabel="Resources by name" {...props} />
) : (
<DefaultPage title="Build Configs">Select a project to view the build configs</DefaultPage>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way this message is written differs from pipelines as it adds here list of
Select a project to view the list of pipelines

@karthikjeeyar
Copy link
Contributor Author

/retest

@christianvogt
Copy link
Contributor

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 10, 2019
@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 10, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, karthikjeeyar, rohitkrai03

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2019
@openshift-merge-robot openshift-merge-robot merged commit ae1e69a into openshift:master Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants