Skip to content

Commit

Permalink
Merge pull request #29 from 51ngul4r1ty/story/000494/guiding-msg-for-…
Browse files Browse the repository at this point in the history
…no-pbis

No Content Message for Empty Product Backlog
  • Loading branch information
51ngul4r1ty authored Dec 13, 2024
2 parents 2b504e2 + 9e9b054 commit f28830b
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.noContentMsg {
position: absolute;
display: grid;
top: 0;
left: 0;
right: 0;
bottom: 0;
font-size: 1.2rem;
padding: 1.5rem;
}

:global(.mobile) .noContentMsg {
text-align: center;
}
19 changes: 19 additions & 0 deletions packages/shared/src/components/atoms/text/NoContentMessage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// externals
import * as React from "react";

// style
import css from "./NoContentMessage.module.css";

/* exported interfaces/types */

export type NoContentMessageStateProps = React.PropsWithChildren<Record<never, any>>;

export type NoContentMessageDispatchProps = {};

export type NoContentMessageProps = NoContentMessageStateProps & NoContentMessageDispatchProps;

/* exported components */

export const NoContentMessage: React.FC<NoContentMessageProps> = (props) => {
return <div className={css.noContentMsg}>{props.children}</div>;
};
1 change: 1 addition & 0 deletions packages/shared/src/components/atoms/text/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./NoContentMessage";
export * from "./SimpleText";
9 changes: 9 additions & 0 deletions packages/shared/src/components/common/base.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
Purpose: This is for use in the components and should only contain VERY
common CSS that's used in a lot of them. This is not the file for CSS
that's "global" in nature but used in a small subset of files. At
present there isn't a file for that purpose but the guidance is that you
should try to create components to encapsulate the common style rather
than making the styles "global".
*/

.fill {
fill: var(--normal-pen-color, black);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
buildDividerKey
} from "../../../molecules/cards/BacklogItemCard";
import { SimpleDivider } from "../../../atoms/dividers/SimpleDivider";
import { NoContentMessage } from "../../../atoms/text/NoContentMessage";

// consts/enums
import { EditMode } from "../../../common/componentEnums";
Expand Down Expand Up @@ -567,6 +568,9 @@ export const InnerProductPlanningPanel: React.FC<ProductPlanningPanelProps> = (p
}
return null;
};
if (renderElts.length === 0) {
renderElts.push(<NoContentMessage>The product backlog is empty. To add content click the Edit button!</NoContentMessage>);
}
return (
<div
ref={ref}
Expand Down
15 changes: 0 additions & 15 deletions packages/shared/src/views/PlanView.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,3 @@
height: 100%;
display: flex;
}

.noContentMsg {
position: absolute;
display: grid;
top: 0;
left: 0;
right: 0;
bottom: 0;
font-size: 1.2rem;
padding: 1.5rem;
}

:global(.mobile) .noContentMsg {
text-align: center;
}
3 changes: 2 additions & 1 deletion packages/shared/src/views/PlanView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { SprintPlanningPanel } from "../components/organisms/panels/sprintPlanni
import { SmartSpinner } from "../components/molecules/unique/smartSpinner/SmartSpinner";
import { BottomPanelContainer } from "../containers/BottomPanelContainer";
import { ContentPanel } from "../components/organisms/panels/ContentPanel";
import { NoContentMessage } from "../components/atoms/text/NoContentMessage";

// contexts
import { AppContext } from "../contexts/appContextUtil";
Expand Down Expand Up @@ -232,7 +233,7 @@ export class PlanView extends React.Component<PlanViewProps, {}> {
} else if (hasContent || this.props.editMode === EditMode.Edit) {
pageContent = pageContentsElts;
} else {
pageContent = <div className={css.noContentMsg}>This project is empty. To add content click the Edit button!</div>;
pageContent = <NoContentMessage>This project is empty. To add content click the Edit button!</NoContentMessage>;
}
return (
<>
Expand Down

0 comments on commit f28830b

Please sign in to comment.