@@ -33,9 +33,9 @@ function FFlagItem({ flag }: { flag: FeatureFlag }) {
{flag.flagKey}
-
{flag.isSingleOption ? 'Single Option' : 'Multivariant'}
+
{flag.isSingleOption ? 'Single Variant' : 'Multivariant'}
{resentOrDate(flag.updatedAt || flag.createdAt)}
-
+
{user}
diff --git a/frontend/app/components/FFlags/FFlagsList.tsx b/frontend/app/components/FFlags/FFlagsList.tsx
index eb1812648..6508db776 100644
--- a/frontend/app/components/FFlags/FFlagsList.tsx
+++ b/frontend/app/components/FFlags/FFlagsList.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import FFlagsListHeader from 'Components/FFlags/FFlagsListHeader';
import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
-import { Loader, NoContent } from 'UI';
+import {Loader, NoContent, Pagination} from 'UI';
import FFlagItem from './FFlagItem';
import { useStore } from 'App/mstore';
import { observer } from 'mobx-react-lite';
@@ -17,7 +17,7 @@ function FFlagsList({ siteId }: { siteId: string }) {
return (
@@ -46,13 +46,12 @@ function FFlagsList({ siteId }: { siteId: string }) {
-
+
Key
Type
Last modified
-
Last modified by
+
By
Status
@@ -88,6 +86,23 @@ function FFlagsList({ siteId }: { siteId: string }) {
))}
+
+
+ {'Showing '}
+
+ {Math.min(featureFlagsStore.total, featureFlagsStore.pageSize)}
+
+ {' out of '}
+ {featureFlagsStore.total} Feature Flags
+
+
featureFlagsStore.setPage(page)}
+ limit={featureFlagsStore.pageSize}
+ debounceRequest={100}
+ />
+
diff --git a/frontend/app/mstore/featureFlagsStore.ts b/frontend/app/mstore/featureFlagsStore.ts
index 62133d4b9..b67bc51d0 100644
--- a/frontend/app/mstore/featureFlagsStore.ts
+++ b/frontend/app/mstore/featureFlagsStore.ts
@@ -17,6 +17,7 @@ export default class FeatureFlagsStore {
activity: Activity = '0';
sort = { order: 'DESC', query: '' };
page: number = 1;
+ total = 0
readonly pageSize: number = 10;
client: typeof fflagsService
@@ -31,6 +32,7 @@ export default class FeatureFlagsStore {
setPage = (page: number) => {
this.page = page;
+ void this.fetchFlags()
};
setEditing = ({ isDescrEditing = false, isTitleEditing = false }) => {
@@ -85,9 +87,10 @@ export default class FeatureFlagsStore {
isActive: this.activity === '0' ? undefined : this.activity === '1',
// userId: 3,
}
- const { list } = await this.client.fetchFlags(filters);
+ const { list, total } = await this.client.fetchFlags(filters);
const flags = list.map((record) => new FeatureFlag(record));
this.setList(flags);
+ this.setTotal(total)
} catch (e) {
console.error(e);
} finally {
@@ -95,6 +98,10 @@ export default class FeatureFlagsStore {
}
};
+ setTotal(total: number) {
+ this.total = total
+ }
+
checkFlagForm = () => {
if (!this.currentFflag) return 'Feature flag not initialized'
if (this.currentFflag.flagKey === '') {