mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-06-28 05:52:07 +02:00
#524 - Remove global settings
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
### 🎨 Enhancements
|
||||
|
||||
- [#522](https://github.com/estruyf/vscode-front-matter/issues/522): Configuration support added for [Astro](https://astro.build)
|
||||
- [#524](https://github.com/estruyf/vscode-front-matter/issues/524): Removed the **Global settings** view from the panel. You can still get it back by configuring a [custom view mode](https://frontmatter.codes/docs/panel#view-modes).
|
||||
|
||||
### ⚡️ Optimizations
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { FeatureFlag } from '../components/features/FeatureFlag';
|
||||
import { FEATURE_FLAG } from '../constants/Features';
|
||||
import { GitAction } from './components/Git/GitAction';
|
||||
import { CustomView } from './components/CustomView';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
|
||||
export interface IViewPanelProps { }
|
||||
|
||||
@@ -32,6 +32,10 @@ export const ViewPanel: React.FunctionComponent<IViewPanelProps> = (
|
||||
mode
|
||||
} = useMessages();
|
||||
|
||||
const allPanelValues = useMemo(() => {
|
||||
return Object.values(FEATURE_FLAG.panel).filter(v => v !== FEATURE_FLAG.panel.globalSettings)
|
||||
}, [FEATURE_FLAG.panel]);
|
||||
|
||||
useEffect(() => {
|
||||
if (window.fmExternal && window.fmExternal.isDevelopment) {
|
||||
setIsDevMode(true);
|
||||
@@ -80,7 +84,7 @@ export const ViewPanel: React.FunctionComponent<IViewPanelProps> = (
|
||||
|
||||
<CustomView metadata={metadata} />
|
||||
|
||||
<FeatureFlag features={mode?.features || []} flag={FEATURE_FLAG.panel.globalSettings}>
|
||||
<FeatureFlag features={mode?.features || [...allPanelValues]} flag={FEATURE_FLAG.panel.globalSettings}>
|
||||
<GlobalSettings settings={settings} />
|
||||
</FeatureFlag>
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import { FeatureFlag } from '../../components/features/FeatureFlag';
|
||||
import { FEATURE_FLAG } from '../../constants/Features';
|
||||
import { Messenger } from '@estruyf/vscode/dist/client';
|
||||
import { GitAction } from './Git/GitAction';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export interface IBaseViewProps {
|
||||
settings: PanelSettings | undefined;
|
||||
@@ -50,6 +51,10 @@ const BaseView: React.FunctionComponent<IBaseViewProps> = ({
|
||||
(s) => s.bulk && (s.type === 'content' || !s.type)
|
||||
);
|
||||
|
||||
const allPanelValues = useMemo(() => {
|
||||
return Object.values(FEATURE_FLAG.panel).filter(v => v !== FEATURE_FLAG.panel.globalSettings)
|
||||
}, [FEATURE_FLAG.panel]);
|
||||
|
||||
return (
|
||||
<div className="frontmatter">
|
||||
<div className={`ext_actions`}>
|
||||
@@ -63,7 +68,7 @@ const BaseView: React.FunctionComponent<IBaseViewProps> = ({
|
||||
<>
|
||||
<GitAction settings={settings} />
|
||||
|
||||
<FeatureFlag features={mode?.features || []} flag={FEATURE_FLAG.panel.globalSettings}>
|
||||
<FeatureFlag features={mode?.features || [...allPanelValues]} flag={FEATURE_FLAG.panel.globalSettings}>
|
||||
<GlobalSettings settings={settings} isBase />
|
||||
</FeatureFlag>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user