Skip to content
Snippets Groups Projects
Unverified Commit 89698480 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:bug: (rules) add 'no rules' message & always show rule table (#2199)

parent 1a6db82c
No related branches found
No related tags found
No related merge requests found
......@@ -241,10 +241,6 @@ function ManageRulesContent({
setHoveredRule(id);
}, []);
if (allRules.length === 0) {
return null;
}
return (
<SelectedProvider instance={selectedInst}>
<View>
......@@ -288,13 +284,17 @@ function ManageRulesContent({
// Hide the last border of the item in the table
style={{ marginBottom: -1 }}
>
<RulesList
rules={filteredRules}
selectedItems={selectedInst.items}
hoveredRule={hoveredRule}
onHover={onHover}
onEditRule={onEditRule}
/>
{filteredRules.length === 0 ? (
<EmptyMessage text="No rules" style={{ marginTop: 15 }} />
) : (
<RulesList
rules={filteredRules}
selectedItems={selectedInst.items}
hoveredRule={hoveredRule}
onHover={onHover}
onEditRule={onEditRule}
/>
)}
</SimpleTable>
</View>
<View
......@@ -321,6 +321,23 @@ function ManageRulesContent({
);
}
function EmptyMessage({ text, style }) {
return (
<View
style={{
textAlign: 'center',
color: theme.pageTextSubdued,
fontStyle: 'italic',
fontSize: 13,
marginTop: 5,
style,
}}
>
{text}
</View>
);
}
type ManageRulesProps = {
isModal: boolean;
payeeId: string | null;
......
---
category: Bugfix
authors: [MatissJanis]
---
rules: add 'no rules' message and always show the rules table (even if no rules exist)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment