mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-18 01:18:23 +02:00
Remove favorites feature flag (#2722)
This commit is contained in:
parent
a0619e963d
commit
be045dc13a
@ -90,8 +90,6 @@ export const FeatureToggleListTable: VFC = () => {
|
|||||||
|
|
||||||
const columns = useMemo(
|
const columns = useMemo(
|
||||||
() => [
|
() => [
|
||||||
...(uiConfig?.flags?.favorites
|
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
Header: (
|
Header: (
|
||||||
<FavoriteIconHeader
|
<FavoriteIconHeader
|
||||||
@ -109,8 +107,6 @@ export const FeatureToggleListTable: VFC = () => {
|
|||||||
maxWidth: 50,
|
maxWidth: 50,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
},
|
},
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
Header: 'Seen',
|
Header: 'Seen',
|
||||||
accessor: 'lastSeenAt',
|
accessor: 'lastSeenAt',
|
||||||
@ -179,7 +175,7 @@ export const FeatureToggleListTable: VFC = () => {
|
|||||||
searchable: true,
|
searchable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[isFavoritesPinned, uiConfig?.flags?.favorites]
|
[isFavoritesPinned]
|
||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
@ -115,17 +115,10 @@ export const FeatureView = () => {
|
|||||||
<div className={styles.header}>
|
<div className={styles.header}>
|
||||||
<div className={styles.innerContainer}>
|
<div className={styles.innerContainer}>
|
||||||
<div className={styles.toggleInfoContainer}>
|
<div className={styles.toggleInfoContainer}>
|
||||||
<ConditionallyRender
|
|
||||||
condition={Boolean(
|
|
||||||
uiConfig?.flags?.favorites
|
|
||||||
)}
|
|
||||||
show={() => (
|
|
||||||
<FavoriteIconButton
|
<FavoriteIconButton
|
||||||
onClick={onFavorite}
|
onClick={onFavorite}
|
||||||
isFavorite={feature?.favorite}
|
isFavorite={feature?.favorite}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<h1
|
<h1
|
||||||
className={styles.featureViewHeader}
|
className={styles.featureViewHeader}
|
||||||
data-loading
|
data-loading
|
||||||
|
@ -156,15 +156,10 @@ const Project = () => {
|
|||||||
<div className={styles.innerContainer}>
|
<div className={styles.innerContainer}>
|
||||||
<StyledTopRow>
|
<StyledTopRow>
|
||||||
<StyledDiv>
|
<StyledDiv>
|
||||||
<ConditionallyRender
|
|
||||||
condition={Boolean(uiConfig?.flags?.favorites)}
|
|
||||||
show={() => (
|
|
||||||
<StyledFavoriteIconButton
|
<StyledFavoriteIconButton
|
||||||
onClick={onFavorite}
|
onClick={onFavorite}
|
||||||
isFavorite={project?.favorite}
|
isFavorite={project?.favorite}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<h2 className={styles.title}>
|
<h2 className={styles.title}>
|
||||||
<StyledName data-loading>
|
<StyledName data-loading>
|
||||||
{projectName}
|
{projectName}
|
||||||
|
@ -193,8 +193,6 @@ export const ProjectFeatureToggles = ({
|
|||||||
|
|
||||||
const columns = useMemo(
|
const columns = useMemo(
|
||||||
() => [
|
() => [
|
||||||
...(uiConfig?.flags?.favorites
|
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
id: 'favorite',
|
id: 'favorite',
|
||||||
Header: (
|
Header: (
|
||||||
@ -213,8 +211,6 @@ export const ProjectFeatureToggles = ({
|
|||||||
maxWidth: 50,
|
maxWidth: 50,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
},
|
},
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
{
|
||||||
Header: 'Seen',
|
Header: 'Seen',
|
||||||
accessor: 'lastSeenAt',
|
accessor: 'lastSeenAt',
|
||||||
@ -303,7 +299,7 @@ export const ProjectFeatureToggles = ({
|
|||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[projectId, environments, loading, onToggle, uiConfig?.flags?.favorites]
|
[projectId, environments, loading, onToggle]
|
||||||
);
|
);
|
||||||
|
|
||||||
const [searchValue, setSearchValue] = useState(
|
const [searchValue, setSearchValue] = useState(
|
||||||
|
@ -69,17 +69,12 @@ export const ProjectCard = ({
|
|||||||
return (
|
return (
|
||||||
<Card className={classes.projectCard} onMouseEnter={onHover}>
|
<Card className={classes.projectCard} onMouseEnter={onHover}>
|
||||||
<div className={classes.header} data-loading>
|
<div className={classes.header} data-loading>
|
||||||
<ConditionallyRender
|
|
||||||
condition={Boolean(uiConfig?.flags?.favorites)}
|
|
||||||
show={() => (
|
|
||||||
<FavoriteIconButton
|
<FavoriteIconButton
|
||||||
onClick={onFavorite}
|
onClick={onFavorite}
|
||||||
isFavorite={isFavorite}
|
isFavorite={isFavorite}
|
||||||
size="medium"
|
size="medium"
|
||||||
sx={{ ml: -1 }}
|
sx={{ ml: -1 }}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<h2 className={classes.title}>{name}</h2>
|
<h2 className={classes.title}>{name}</h2>
|
||||||
|
|
||||||
<PermissionIconButton
|
<PermissionIconButton
|
||||||
|
@ -44,7 +44,6 @@ export interface IFlags {
|
|||||||
embedProxyFrontend?: boolean;
|
embedProxyFrontend?: boolean;
|
||||||
changeRequests?: boolean;
|
changeRequests?: boolean;
|
||||||
variantsPerEnvironment?: boolean;
|
variantsPerEnvironment?: boolean;
|
||||||
favorites?: boolean;
|
|
||||||
networkView?: boolean;
|
networkView?: boolean;
|
||||||
maintenance?: boolean;
|
maintenance?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,6 @@ exports[`should create default config 1`] = `
|
|||||||
"changeRequests": false,
|
"changeRequests": false,
|
||||||
"embedProxy": true,
|
"embedProxy": true,
|
||||||
"embedProxyFrontend": true,
|
"embedProxyFrontend": true,
|
||||||
"favorites": false,
|
|
||||||
"maintenance": false,
|
"maintenance": false,
|
||||||
"maintenanceMode": false,
|
"maintenanceMode": false,
|
||||||
"networkView": false,
|
"networkView": false,
|
||||||
@ -92,7 +91,6 @@ exports[`should create default config 1`] = `
|
|||||||
"changeRequests": false,
|
"changeRequests": false,
|
||||||
"embedProxy": true,
|
"embedProxy": true,
|
||||||
"embedProxyFrontend": true,
|
"embedProxyFrontend": true,
|
||||||
"favorites": false,
|
|
||||||
"maintenance": false,
|
"maintenance": false,
|
||||||
"maintenanceMode": false,
|
"maintenanceMode": false,
|
||||||
"networkView": false,
|
"networkView": false,
|
||||||
|
@ -259,7 +259,7 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
|
|||||||
.modify(FeatureToggleStore.filterByArchived, archived);
|
.modify(FeatureToggleStore.filterByArchived, archived);
|
||||||
|
|
||||||
let selectColumns = ['features_view.*'] as (string | Raw<any>)[];
|
let selectColumns = ['features_view.*'] as (string | Raw<any>)[];
|
||||||
if (userId && this.flagResolver.isEnabled('favorites')) {
|
if (userId) {
|
||||||
query = query.leftJoin(`favorite_features`, function () {
|
query = query.leftJoin(`favorite_features`, function () {
|
||||||
this.on(
|
this.on(
|
||||||
'favorite_features.feature',
|
'favorite_features.feature',
|
||||||
@ -460,7 +460,7 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
|
|||||||
'ft.tag_type as tag_type',
|
'ft.tag_type as tag_type',
|
||||||
] as (string | Raw<any>)[];
|
] as (string | Raw<any>)[];
|
||||||
|
|
||||||
if (userId && this.flagResolver.isEnabled('favorites')) {
|
if (userId) {
|
||||||
query = query.leftJoin(`favorite_features`, function () {
|
query = query.leftJoin(`favorite_features`, function () {
|
||||||
this.on('favorite_features.feature', 'features.name').andOnVal(
|
this.on('favorite_features.feature', 'features.name').andOnVal(
|
||||||
'favorite_features.user_id',
|
'favorite_features.user_id',
|
||||||
|
@ -146,7 +146,7 @@ export default class FeatureToggleClientStore
|
|||||||
'ft.tag_type as tag_type',
|
'ft.tag_type as tag_type',
|
||||||
];
|
];
|
||||||
|
|
||||||
if (userId && this.flagResolver.isEnabled('favorites')) {
|
if (userId) {
|
||||||
query = query.leftJoin(`favorite_features`, function () {
|
query = query.leftJoin(`favorite_features`, function () {
|
||||||
this.on(
|
this.on(
|
||||||
'favorite_features.feature',
|
'favorite_features.feature',
|
||||||
|
@ -100,7 +100,7 @@ class ProjectStore implements IProjectStore {
|
|||||||
|
|
||||||
let groupByColumns = ['projects.id'];
|
let groupByColumns = ['projects.id'];
|
||||||
|
|
||||||
if (userId && this.flagResolver.isEnabled('favorites')) {
|
if (userId) {
|
||||||
projects = projects.leftJoin(`favorite_projects`, function () {
|
projects = projects.leftJoin(`favorite_projects`, function () {
|
||||||
this.on('favorite_projects.project', 'projects.id').andOnVal(
|
this.on('favorite_projects.project', 'projects.id').andOnVal(
|
||||||
'favorite_projects.user_id',
|
'favorite_projects.user_id',
|
||||||
|
@ -27,7 +27,6 @@ import PatController from './user/pat';
|
|||||||
import { PublicSignupController } from './public-signup';
|
import { PublicSignupController } from './public-signup';
|
||||||
import InstanceAdminController from './instance-admin';
|
import InstanceAdminController from './instance-admin';
|
||||||
import FavoritesController from './favorites';
|
import FavoritesController from './favorites';
|
||||||
import { conditionalMiddleware } from '../../middleware';
|
|
||||||
import MaintenanceController from './maintenance';
|
import MaintenanceController from './maintenance';
|
||||||
|
|
||||||
class AdminApi extends Controller {
|
class AdminApi extends Controller {
|
||||||
@ -120,10 +119,7 @@ class AdminApi extends Controller {
|
|||||||
);
|
);
|
||||||
this.app.use(
|
this.app.use(
|
||||||
`/projects`,
|
`/projects`,
|
||||||
conditionalMiddleware(
|
|
||||||
() => config.flagResolver.isEnabled('favorites'),
|
|
||||||
new FavoritesController(config, services).router,
|
new FavoritesController(config, services).router,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.app.use(
|
this.app.use(
|
||||||
|
@ -35,10 +35,6 @@ const flags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_VARIANTS_PER_ENVIRONMENT,
|
process.env.UNLEASH_EXPERIMENTAL_VARIANTS_PER_ENVIRONMENT,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
favorites: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_FAVORITES,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
networkView: parseEnvVarBoolean(
|
networkView: parseEnvVarBoolean(
|
||||||
process.env.UNLEASH_EXPERIMENTAL_NETWORK_VIEW,
|
process.env.UNLEASH_EXPERIMENTAL_NETWORK_VIEW,
|
||||||
false,
|
false,
|
||||||
|
@ -40,7 +40,6 @@ process.nextTick(async () => {
|
|||||||
anonymiseEventLog: false,
|
anonymiseEventLog: false,
|
||||||
responseTimeWithAppName: true,
|
responseTimeWithAppName: true,
|
||||||
changeRequests: true,
|
changeRequests: true,
|
||||||
favorites: true,
|
|
||||||
variantsPerEnvironment: true,
|
variantsPerEnvironment: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -29,7 +29,6 @@ export function createTestConfig(config?: IUnleashOptions): IUnleashConfig {
|
|||||||
batchMetrics: true,
|
batchMetrics: true,
|
||||||
changeRequests: true,
|
changeRequests: true,
|
||||||
variantsPerEnvironment: true,
|
variantsPerEnvironment: true,
|
||||||
favorites: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -5333,6 +5333,50 @@ If the provided project does not exist, the list of events will be empty.",
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"/api/admin/projects/{projectId}/favorites": {
|
||||||
|
"delete": {
|
||||||
|
"operationId": "removeFavoriteProject",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "projectId",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "This response has no body.",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Features",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"operationId": "addFavoriteProject",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "projectId",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "This response has no body.",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Features",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
"/api/admin/projects/{projectId}/features": {
|
"/api/admin/projects/{projectId}/features": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "getFeatures",
|
"operationId": "getFeatures",
|
||||||
@ -6304,6 +6348,66 @@ If the provided project does not exist, the list of events will be empty.",
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"/api/admin/projects/{projectId}/features/{featureName}/favorites": {
|
||||||
|
"delete": {
|
||||||
|
"operationId": "removeFavoriteFeature",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "projectId",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "featureName",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "This response has no body.",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Features",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"operationId": "addFavoriteFeature",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "projectId",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "path",
|
||||||
|
"name": "featureName",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "This response has no body.",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Features",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
"/api/admin/projects/{projectId}/features/{featureName}/variants": {
|
"/api/admin/projects/{projectId}/features/{featureName}/variants": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "getFeatureVariants",
|
"operationId": "getFeatureVariants",
|
||||||
|
Loading…
Reference in New Issue
Block a user