Open platform to collect and prioritize feedback
fix: show lonely text if all ideas are deleted (#411)
Guilherme Oenning3c7fa8549162
diff --git a/public/models/idea.ts b/public/models/idea.tsindex 70bde4e5a..22bd6ee4c 100644--- a/public/models/idea.ts+++ b/public/models/idea.ts@@ -32,6 +32,7 @@ export class IdeaStatus {public static Completed = new IdeaStatus(2, "Completed", "completed", true, true, true);public static Declined = new IdeaStatus(3, "Declined", "declined", true, true, true);public static Duplicate = new IdeaStatus(5, "Duplicate", "duplicate", true, true, false);+ public static Deleted = new IdeaStatus(6, "Deleted", "deleted", false, true, false);public static Get(value: number): IdeaStatus {for (const status of IdeaStatus.All) {diff --git a/public/pages/Home/Home.page.tsx b/public/pages/Home/Home.page.tsxindex 8251b332d..7f3b08300 100644--- a/public/pages/Home/Home.page.tsx+++ b/public/pages/Home/Home.page.tsx@@ -41,6 +41,19 @@ export class HomePage extends React.Component<HomePageProps, HomePageState> {};}+ private isLonely(): boolean {+ const len = Object.keys(this.props.countPerStatus).length;+ if (len === 0) {+ return true;+ }++ if (len === 1 && IdeaStatus.Deleted.value in this.props.countPerStatus) {+ return true;+ }++ return false;+ }+private setTitle = (title: string) => {this.setState({ title });};@@ -62,7 +75,7 @@ export class HomePage extends React.Component<HomePageProps, HomePageState> {/></div><div className="col-md-8">- {Object.keys(this.props.countPerStatus).length === 0 ? (+ {this.isLonely() ? (<Lonely />) : (<IdeasContainerdiff --git a/public/pages/Home/components/ListIdeas.tsx b/public/pages/Home/components/ListIdeas.tsxindex 80314548b..07b58855d 100644--- a/public/pages/Home/components/ListIdeas.tsx+++ b/public/pages/Home/components/ListIdeas.tsx@@ -64,7 +64,7 @@ export class ListIdeas extends React.Component<ListIdeasProps, ListIdeasState> {public render() {if (this.props.ideas.length === 0) {- return <p>{this.props.emptyText}</p>;+ return <p className="center">{this.props.emptyText}</p>;}const ideasToList = this.props.ideas.slice(0, this.state.showCount);diff --git a/scripts/git-prune-local.sh b/scripts/git-prune-local.shnew file mode 100755index 000000000..2d7575e16--- /dev/null+++ b/scripts/git-prune-local.sh@@ -0,0 +1,2 @@+# https://medium.com/@kcmueller/delete-local-git-branches-that-were-deleted-on-remote-repository-b596b71b530c+git branch -vv | grep ' gone]' | awk '{print $1}' | xargs git branch -D\ No newline at end of file