diff --git a/.github/workflows/ui-tests.js.yml b/.github/workflows/ui-tests.js.yml
index 94cdc183b..5180a40e2 100644
--- a/.github/workflows/ui-tests.js.yml
+++ b/.github/workflows/ui-tests.js.yml
@@ -104,6 +104,12 @@ jobs:
run: |
cd frontend
yarn test
+ - name: Upload coverage reports to Codecov
+ uses: codecov/codecov-action@v3
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ flags: ui
+ name: ui
- name: Run Frontend
run: |
cd frontend
diff --git a/frontend/app/components/FFlags/FFlagItem/FFlagItem.tsx b/frontend/app/components/FFlags/FFlagItem/FFlagItem.tsx
index 09886902a..1ca99f11d 100644
--- a/frontend/app/components/FFlags/FFlagItem/FFlagItem.tsx
+++ b/frontend/app/components/FFlags/FFlagItem/FFlagItem.tsx
@@ -10,10 +10,15 @@ function FFlagItem({ flag }: { flag: FeatureFlag }) {
const { featureFlagsStore, userStore } = useStore();
const toggleActivity = () => {
- flag.setIsEnabled(!flag.isActive);
+ const newValue = !flag.isActive
+ flag.setIsEnabled(newValue);
featureFlagsStore.updateFlag(flag, true).then(() => {
toast.success('Feature flag updated.');
})
+ .catch(() => {
+ flag.setIsEnabled(!newValue);
+ toast.error('Failed to update flag.')
+ })
}
const flagIcon = flag.isSingleOption ? 'fflag-single' : 'fflag-multi' as const
diff --git a/frontend/app/components/FFlags/NewFFlag/Conditions.tsx b/frontend/app/components/FFlags/NewFFlag/Conditions.tsx
index e8f5cc6c3..17fe36817 100644
--- a/frontend/app/components/FFlags/NewFFlag/Conditions.tsx
+++ b/frontend/app/components/FFlags/NewFFlag/Conditions.tsx
@@ -5,6 +5,7 @@ import FilterList from 'Shared/Filters/FilterList';
import { nonFlagFilters } from 'Types/filter/newFilter';
import { observer } from 'mobx-react-lite';
import { Conditions } from "App/mstore/types/FeatureFlag";
+import FilterSelection from 'Shared/Filters/FilterSelection';
interface Props {
set: number;
@@ -15,8 +16,8 @@ interface Props {
function RolloutCondition({ set, conditions, removeCondition, index }: Props) {
const [forceRender, forceRerender] = React.useState(false);
- const onAddFilter = () => {
- conditions.filter.addFilter({});
+ const onAddFilter = (filter = {}) => {
+ conditions.filter.addFilter(filter);
forceRerender(!forceRender);
};
const onUpdateFilter = (filterIndex: number, filter: any) => {
@@ -48,7 +49,7 @@ function RolloutCondition({ set, conditions, removeCondition, index }: Props) {
Set {set}
removeCondition(index)}
@@ -63,14 +64,17 @@ function RolloutCondition({ set, conditions, removeCondition, index }: Props) {
onUpdateFilter={onUpdateFilter}
onRemoveFilter={onRemoveFilter}
onChangeEventsOrder={onChangeEventsOrder}
- supportsEmpty
hideEventsOrder
excludeFilterKeys={nonFlagFilters}
/>
-
+
+
+
Rollout to
diff --git a/frontend/app/components/FFlags/NewFFlag/Header.tsx b/frontend/app/components/FFlags/NewFFlag/Header.tsx
index 4e6646d76..0758aaac8 100644
--- a/frontend/app/components/FFlags/NewFFlag/Header.tsx
+++ b/frontend/app/components/FFlags/NewFFlag/Header.tsx
@@ -12,7 +12,7 @@ function Header({ current, onCancel, onSave, isNew }: any) {