mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove newBrowseDashboards feature toggle (#78190)
* remove all the things * fix OldFolderPicker tests * i18n * remove more unused code * remove mutation of error object since it's now frozen in the redux state * fix error handling
This commit is contained in:
@@ -9,7 +9,6 @@ import { SlideDown } from 'app/core/components/Animations/SlideDown';
|
||||
import { Trans, t } from 'app/core/internationalization';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { DescendantCount } from 'app/features/browse-dashboards/components/BrowseActions/DescendantCount';
|
||||
import { newBrowseDashboardsEnabled } from 'app/features/browse-dashboards/featureFlag';
|
||||
|
||||
import { AddPermission } from './AddPermission';
|
||||
import { PermissionList } from './PermissionList';
|
||||
@@ -156,7 +155,7 @@ export const Permissions = ({
|
||||
<div>
|
||||
{canSetPermissions && (
|
||||
<>
|
||||
{newBrowseDashboardsEnabled() && resource === 'folders' && (
|
||||
{resource === 'folders' && (
|
||||
<>
|
||||
<Trans i18nKey="access-control.permissions.permissions-change-warning">
|
||||
This will change permissions for this folder and all its descendants. In total, this will affect:
|
||||
|
||||
@@ -76,7 +76,7 @@ describe('OldFolderPicker', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should show the General folder by default for editors', async () => {
|
||||
it('should show the Dashboards root by default for editors', async () => {
|
||||
jest
|
||||
.spyOn(api, 'searchFolders')
|
||||
.mockResolvedValue([
|
||||
@@ -94,10 +94,10 @@ describe('OldFolderPicker', () => {
|
||||
|
||||
const pickerOptions = await screen.findAllByLabelText('Select option');
|
||||
|
||||
expect(pickerOptions[0]).toHaveTextContent('General');
|
||||
expect(pickerOptions[0]).toHaveTextContent('Dashboards');
|
||||
});
|
||||
|
||||
it('should not show the General folder by default if showRoot is false', async () => {
|
||||
it('should not show the Dashboards root by default if showRoot is false', async () => {
|
||||
jest
|
||||
.spyOn(api, 'searchFolders')
|
||||
.mockResolvedValue([
|
||||
@@ -115,10 +115,10 @@ describe('OldFolderPicker', () => {
|
||||
|
||||
const pickerOptions = await screen.findAllByLabelText('Select option');
|
||||
|
||||
expect(pickerOptions[0]).not.toHaveTextContent('General');
|
||||
expect(pickerOptions[0]).not.toHaveTextContent('Dashboards');
|
||||
});
|
||||
|
||||
it('should not show the General folder by default for not editors', async () => {
|
||||
it('should not show the Dashboards root by default for not editors', async () => {
|
||||
jest
|
||||
.spyOn(api, 'searchFolders')
|
||||
.mockResolvedValue([
|
||||
@@ -136,7 +136,7 @@ describe('OldFolderPicker', () => {
|
||||
|
||||
const pickerOptions = await screen.findAllByLabelText('Select option');
|
||||
|
||||
expect(pickerOptions[0]).not.toHaveTextContent('General');
|
||||
expect(pickerOptions[0]).not.toHaveTextContent('Dashboards');
|
||||
});
|
||||
|
||||
it('should return the correct search results when typing in the select', async () => {
|
||||
|
||||
@@ -10,7 +10,6 @@ import { useStyles2, ActionMeta, Input, InputActionMeta, AsyncVirtualizedSelect
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { t } from 'app/core/internationalization';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { newBrowseDashboardsEnabled } from 'app/features/browse-dashboards/featureFlag';
|
||||
import { createFolder, getFolderByUid, searchFolders } from 'app/features/manage-dashboards/state/actions';
|
||||
import { DashboardSearchHit } from 'app/features/search/types';
|
||||
import { AccessControlAction, PermissionLevelString, SearchQueryType } from 'app/types';
|
||||
@@ -81,7 +80,7 @@ export function OldFolderPicker(props: Props) {
|
||||
folderWarning,
|
||||
} = props;
|
||||
|
||||
const rootName = rootNameProp ?? newBrowseDashboardsEnabled() ? 'Dashboards' : 'General';
|
||||
const rootName = rootNameProp ?? 'Dashboards';
|
||||
|
||||
const [folder, setFolder] = useState<SelectedFolder | null>(null);
|
||||
const [isCreatingNew, setIsCreatingNew] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user