Skip to content

Commit 6fe0a12

Browse files
author
Vikas Agarwal
committed
Github issue#1218, Proper fix for hiding any project category
— Fixed with proper way
1 parent b2d7311 commit 6fe0a12

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/config/projectWizard/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const products = {
3535
info: 'Build a cognitive chat bot for your product',
3636
question: 'What do you need to develop?',
3737
id: 'chatbot',
38+
hidden: true,
3839
subtypes: {
3940
'Watson Chatbot': {
4041
brief: 'Watson Chatbot',
@@ -188,7 +189,7 @@ export function findProduct(product) {
188189

189190
export function findCategory(categoryId) {
190191
for(const key in products) {
191-
if (products[key].id === categoryId) {
192+
if (products[key].id === categoryId && !products[key].disabled) {
192193
return { ...products[key], name: key}
193194
}
194195
}

src/projects/create/components/ProjectTypeCard.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
-moz-transition: 300ms all ease;
1616
-webkit-transition: 300ms all ease;
1717

18-
// Hide the chatbot card
19-
// FIXME: Remove when chatbot should be enabled again
20-
&:nth-child(3) {
21-
display: none;
22-
}
23-
2418
.sub-type-details {
2519
padding: 0 20px;
2620
font-size: 13px;

src/projects/create/components/SelectProjectType.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ function SelectProjectType(props) {
1515
const item = config[key]
1616
const icon = <SVGIconImage filePath={item.icon} />
1717
const products = findProductsOfCategory(item.id) || []
18+
// don't render disabled items for selection
19+
// don't render hidden items as well, hidden items can be reached via direct link though
20+
if (item.disabled || item.hidden) continue
1821
cards.push(
1922
<ProjectTypeCard
2023
icon={icon}

0 commit comments

Comments
 (0)