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

feat(toolbar): issues/10 add usage filter #361

Merged
merged 2 commits into from
Aug 4, 2020
Merged
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
10 changes: 9 additions & 1 deletion public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@
"tableSkeletonAriaLabel": "Loading"
},
"curiosity-toolbar": {
"category": "Filter by",
"categoryPlaceholder": "Filter by",
"slaCategory": "SLA",
"slaNone": "No SLA",
"slaPlaceholder": "Filter by SLA",
"slaPremium": "Premium",
"slaSelfSupport": "Self-Support",
"slaStandard": "Standard"
"slaStandard": "Standard",
"usageCategory": "Usage",
"usagePlaceholder": "Filter by usage",
"usageDevelopment": "Development/Test",
"usageDisaster": "Disaster Recovery",
"usageProduction": "Production",
"usageUnspecified": "Unspecified"
},
"curiosity-optin": {
"buttonActivate": "Activate {{appName}}",
Expand Down
2 changes: 1 addition & 1 deletion src/components/c3GraphCard/c3GraphCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class C3GraphCard extends React.Component {
const { viewId } = this.props;

store.dispatch({
type: reduxTypes.rhsm.SET_FILTER_GRANULARITY_RHSM,
type: reduxTypes.query.SET_QUERY_GRANULARITY_RHSM,
viewId,
[rhsmApiTypes.RHSM_API_QUERY_GRANULARITY]: value
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/graphCard/graphCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class GraphCard extends React.Component {
const { viewId } = this.props;

store.dispatch({
type: reduxTypes.rhsm.SET_FILTER_GRANULARITY_RHSM,
type: reduxTypes.query.SET_QUERY_GRANULARITY_RHSM,
viewId,
[rhsmApiTypes.RHSM_API_QUERY_GRANULARITY]: value
});
Expand Down
44 changes: 44 additions & 0 deletions src/components/i18n/__tests__/__snapshots__/i18n.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,14 @@ Array [
Object {
"file": "./src/components/toolbar/toolbar.js",
"keys": Array [
Object {
"key": "curiosity-toolbar.category",
"match": "t('curiosity-toolbar.category')",
},
Object {
"key": "curiosity-toolbar.categoryPlaceholder",
"match": "t('curiosity-toolbar.categoryPlaceholder')",
},
Object {
"key": "curiosity-toolbar.slaCategory",
"match": "t('curiosity-toolbar.slaCategory')",
Expand All @@ -342,6 +350,18 @@ Array [
"key": "curiosity-toolbar.slaPlaceholder",
"match": "t('curiosity-toolbar.slaPlaceholder')",
},
Object {
"key": "curiosity-toolbar.usageCategory",
"match": "t('curiosity-toolbar.usageCategory')",
},
Object {
"key": "curiosity-toolbar.usageCategory",
"match": "t('curiosity-toolbar.usageCategory')",
},
Object {
"key": "curiosity-toolbar.usagePlaceholder",
"match": "t('curiosity-toolbar.usagePlaceholder')",
},
],
},
Object {
Expand All @@ -363,6 +383,30 @@ Array [
"key": "curiosity-toolbar.slaNone",
"match": "translate('curiosity-toolbar.slaNone')",
},
Object {
"key": "curiosity-toolbar.usageDevelopment",
"match": "translate('curiosity-toolbar.usageDevelopment')",
},
Object {
"key": "curiosity-toolbar.usageDisaster",
"match": "translate('curiosity-toolbar.usageDisaster')",
},
Object {
"key": "curiosity-toolbar.usageProduction",
"match": "translate('curiosity-toolbar.usageProduction')",
},
Object {
"key": "curiosity-toolbar.usageUnspecified",
"match": "translate('curiosity-toolbar.usageUnspecified')",
},
Object {
"key": "curiosity-toolbar.slaCategory",
"match": "translate('curiosity-toolbar.slaCategory')",
},
Object {
"key": "curiosity-toolbar.usageCategory",
"match": "translate('curiosity-toolbar.usageCategory')",
},
],
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ exports[`OpenshiftView Component should display an alternate graph on query-stri
t(curiosity-view.OpenShiftTitle, Subscription Watch)
</PageHeader>
<PageToolbar>
<Toolbar
isDisabled={false}
<Connect(Toolbar)
query={
Object {
"granularity": "daily",
}
}
t={[Function]}
viewId="OpenShift"
/>
</PageToolbar>
Expand Down Expand Up @@ -85,14 +83,12 @@ exports[`OpenshiftView Component should have a fallback title: title 1`] = `
t(curiosity-view.OpenShiftTitle, Subscription Watch)
</PageHeader>
<PageToolbar>
<Toolbar
isDisabled={false}
<Connect(Toolbar)
query={
Object {
"granularity": "daily",
}
}
t={[Function]}
viewId="OpenShift"
/>
</PageToolbar>
Expand Down Expand Up @@ -161,14 +157,12 @@ exports[`OpenshiftView Component should render a non-connected component: non-co
t(curiosity-view.OpenShiftTitle, Subscription Watch)
</PageHeader>
<PageToolbar>
<Toolbar
isDisabled={false}
<Connect(Toolbar)
query={
Object {
"granularity": "daily",
}
}
t={[Function]}
viewId="OpenShift"
/>
</PageToolbar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ exports[`RhelView Component should display an alternate graph on query-string up
t(curiosity-view.RHELTitle, Subscription Watch)
</PageHeader>
<PageToolbar>
<Toolbar
isDisabled={false}
<Connect(Toolbar)
query={
Object {
"granularity": "daily",
}
}
t={[Function]}
viewId="RHEL"
/>
</PageToolbar>
Expand Down Expand Up @@ -71,14 +69,12 @@ exports[`RhelView Component should have a fallback title: title 1`] = `
t(curiosity-view.RHELTitle, Subscription Watch)
</PageHeader>
<PageToolbar>
<Toolbar
isDisabled={false}
<Connect(Toolbar)
query={
Object {
"granularity": "daily",
}
}
t={[Function]}
viewId="RHEL"
/>
</PageToolbar>
Expand Down Expand Up @@ -133,14 +129,12 @@ exports[`RhelView Component should render a non-connected component: non-connect
t(curiosity-view.RHELTitle, Subscription Watch)
</PageHeader>
<PageToolbar>
<Toolbar
isDisabled={false}
<Connect(Toolbar)
query={
Object {
"granularity": "daily",
}
}
t={[Function]}
viewId="RHEL"
/>
</PageToolbar>
Expand Down
Loading