Skip to content

Commit

Permalink
chore: remove projectScopedStickinessFlag (#3620)
Browse files Browse the repository at this point in the history
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
  • Loading branch information
andreas-unleash committed Apr 26, 2023
1 parent a7213bf commit 2667e55
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 22 deletions.
Expand Up @@ -9,7 +9,6 @@ import {
StyledInput,
StyledTextField,
} from './ProjectForm.styles';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { StickinessSelect } from 'component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import Select from 'component/common/select';
Expand Down Expand Up @@ -60,9 +59,6 @@ const ProjectForm: React.FC<IProjectForm> = ({
validateProjectId,
clearErrors,
}) => {
const { uiConfig } = useUiConfig();
const { projectScopedStickiness } = uiConfig.flags;

return (
<StyledForm onSubmit={handleSubmit}>
<StyledContainer>
Expand Down Expand Up @@ -109,10 +105,7 @@ const ProjectForm: React.FC<IProjectForm> = ({
/>

<ConditionallyRender
condition={
Boolean(projectScopedStickiness) &&
setProjectStickiness != null
}
condition={setProjectStickiness != null}
show={
<>
<StyledDescription>
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/hooks/useDefaultProjectSettings.ts
@@ -1,15 +1,10 @@
import useUiConfig from './api/getters/useUiConfig/useUiConfig';
import useProject from './api/getters/useProject/useProject';

const DEFAULT_STICKINESS = 'default';
export const useDefaultProjectSettings = (projectId: string) => {
const { uiConfig } = useUiConfig();

const { projectScopedStickiness } = uiConfig.flags;

const { project, loading, error } = useProject(projectId);
return {
defaultStickiness: Boolean(projectScopedStickiness)
defaultStickiness: Boolean(project.defaultStickiness)
? project.defaultStickiness
: DEFAULT_STICKINESS,
mode: project.mode,
Expand Down
1 change: 0 additions & 1 deletion frontend/src/interfaces/uiConfig.ts
Expand Up @@ -46,7 +46,6 @@ export interface IFlags {
proPlanAutoCharge?: boolean;
notifications?: boolean;
bulkOperations?: boolean;
projectScopedStickiness?: boolean;
personalAccessTokensKillSwitch?: boolean;
demo?: boolean;
strategyTitle?: boolean;
Expand Down
2 changes: 0 additions & 2 deletions src/lib/__snapshots__/create-config.test.ts.snap
Expand Up @@ -85,7 +85,6 @@ exports[`should create default config 1`] = `
"optimal304Differ": false,
"personalAccessTokensKillSwitch": false,
"proPlanAutoCharge": false,
"projectScopedStickiness": false,
"responseTimeWithAppNameKillSwitch": false,
"strategyDisable": false,
"strategyTitle": false,
Expand Down Expand Up @@ -113,7 +112,6 @@ exports[`should create default config 1`] = `
"optimal304Differ": false,
"personalAccessTokensKillSwitch": false,
"proPlanAutoCharge": false,
"projectScopedStickiness": false,
"responseTimeWithAppNameKillSwitch": false,
"strategyDisable": false,
"strategyTitle": false,
Expand Down
4 changes: 0 additions & 4 deletions src/lib/types/experimental.ts
Expand Up @@ -53,10 +53,6 @@ const flags = {
process.env.UNLEASH_BULK_OPERATIONS,
false,
),
projectScopedStickiness: parseEnvVarBoolean(
process.env.PROJECT_SCOPED_STICKINESS,
false,
),
personalAccessTokensKillSwitch: parseEnvVarBoolean(
process.env.UNLEASH_PAT_KILL_SWITCH,
false,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Expand Up @@ -40,7 +40,6 @@ process.nextTick(async () => {
responseTimeWithAppNameKillSwitch: false,
newProjectOverview: true,
bulkOperations: true,
projectScopedStickiness: true,
optimal304: true,
optimal304Differ: false,
},
Expand Down

0 comments on commit 2667e55

Please sign in to comment.