Skip to content

Commit

Permalink
chore: Remove enable_metadata flag (#4759)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolodato authored Oct 25, 2024
1 parent 1567487 commit f4fd34b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 33 deletions.
1 change: 0 additions & 1 deletion docs/docs/deployment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ The list of the flags and remote config we're currently using in production is b
| `default_environment_names_for_new_project` | Names of default environments to create when creating a new project (e.g. `["Development", "Production"]`) | None |
| `disable_create_org` | Turning this on will prevent users from creating any additional organisations | None |
| `disable_users_as_reviewers` | If enabled, this flag will hide the Assigned users section in the Change Requests and in the Create Change Request modal in the Features page. | None |
| `enable_metadata` | If enabled, metadata can be handled | None |
| `feature_versioning` | Opt into feature versioning for your environment | None |
| `integration_data` | Integration config for different providers | [See Below](#integration_data) |
| `mailing_list` | Determines if mailing list consent is shown on signup | None |
Expand Down
9 changes: 2 additions & 7 deletions frontend/web/components/modals/CreateFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,7 @@ const CreateFlag = class extends Component {
) {
this.getFeatureUsage()
}
if (
Utils.getPlansPermission('METADATA') &&
Utils.getFlagsmithHasFeature('enable_metadata')
) {
if (Utils.getPlansPermission('METADATA')) {
getSupportedContentType(getStore(), {
organisation_id: AccountStore.getOrganisation().id,
}).then((res) => {
Expand Down Expand Up @@ -566,9 +563,7 @@ parseError = (error)=>{
const hideIdentityOverridesTab = Utils.getShouldHideIdentityOverridesTab()
const noPermissions = this.props.noPermissions
let regexValid = true
const metadataEnable =
Utils.getPlansPermission('METADATA') &&
Utils.getFlagsmithHasFeature('enable_metadata')
const metadataEnable = Utils.getPlansPermission('METADATA')

try {
if (!isEdit && name && regex) {
Expand Down
4 changes: 1 addition & 3 deletions frontend/web/components/modals/CreateSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ const CreateSegment: FC<CreateSegmentType> = ({
const [metadata, setMetadata] = useState<CustomMetadataField[]>(
segment.metadata,
)
const metadataEnable =
Utils.getPlansPermission('METADATA') &&
Utils.getFlagsmithHasFeature('enable_metadata')
const metadataEnable = Utils.getPlansPermission('METADATA')
const error = createError || updateError
const totalSegments = ProjectStore.getTotalSegments() ?? 0
const maxSegmentsAllowed = ProjectStore.getMaxSegmentsAllowed() ?? 0
Expand Down
6 changes: 1 addition & 5 deletions frontend/web/components/pages/CreateEnvironmentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ const CreateEnvironmentPage = class extends Component {
componentDidMount = () => {
API.trackPage(Constants.pages.CREATE_ENVIRONMENT)

if (
Utils.getPlansPermission('METADATA') &&
Utils.getFlagsmithHasFeature('enable_metadata')
) {
if (Utils.getPlansPermission('METADATA')) {
getSupportedContentType(getStore(), {
organisation_id: AccountStore.getOrganisation().id,
}).then((res) => {
Expand Down Expand Up @@ -200,7 +197,6 @@ const CreateEnvironmentPage = class extends Component {
)}
</div>
{Utils.getPlansPermission('METADATA') &&
Utils.getFlagsmithHasFeature('enable_metadata') &&
envContentType?.id && (
<CondensedRow>
<FormGroup className='mt-5 setting'>
Expand Down
9 changes: 2 additions & 7 deletions frontend/web/components/pages/EnvironmentSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ const EnvironmentSettingsPage = class extends Component {
})
})

if (
Utils.getPlansPermission('METADATA') &&
Utils.getFlagsmithHasFeature('enable_metadata')
) {
if (Utils.getPlansPermission('METADATA')) {
getSupportedContentType(getStore(), {
organisation_id: AccountStore.getOrganisation().id,
}).then((res) => {
Expand Down Expand Up @@ -266,9 +263,7 @@ const EnvironmentSettingsPage = class extends Component {
},
} = this
const has4EyesPermission = Utils.getPlansPermission('4_EYES')
const metadataEnable =
Utils.getPlansPermission('METADATA') &&
Utils.getFlagsmithHasFeature('enable_metadata')
const metadataEnable = Utils.getPlansPermission('METADATA')

return (
<div className='app-container container'>
Expand Down
16 changes: 6 additions & 10 deletions frontend/web/components/pages/ProjectSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ const ProjectSettingsPage = class extends Component {
const { name, stale_flags_limit_days } = this.state
const hasStaleFlagsPermission = Utils.getPlansPermission('STALE_FLAGS')

const metadataEnable = Utils.getFlagsmithHasFeature('enable_metadata')

return (
<div className='app-container container'>
<ProjectProvider
Expand Down Expand Up @@ -605,14 +603,12 @@ const ProjectSettingsPage = class extends Component {
roles={this.state.roles}
/>
</TabItem>
{metadataEnable && (
<TabItem tabLabel='Custom Fields'>
<MetadataPage
organisationId={AccountStore.getOrganisation().id}
projectId={this.props.match.params.projectId}
/>
</TabItem>
)}
<TabItem tabLabel='Custom Fields'>
<MetadataPage
organisationId={AccountStore.getOrganisation().id}
projectId={this.props.match.params.projectId}
/>
</TabItem>
{!!ProjectStore.getEnvs()?.length && (
<TabItem data-test='js-import-page' tabLabel='Import'>
<ImportPage
Expand Down

0 comments on commit f4fd34b

Please sign in to comment.