feat: Added "Files Table View" to Labs

This commit is contained in:
Aman Harwara
2022-12-29 02:44:04 +05:30
parent b0c11b1b4d
commit b764296c8f
8 changed files with 28 additions and 15 deletions

View File

@@ -12,8 +12,7 @@ import { NavigationController } from '@/Controllers/Navigation/NavigationControl
import { NotesController } from '@/Controllers/NotesController/NotesController'
import { ElementIds } from '@/Constants/ElementIDs'
import { classNames } from '@standardnotes/utils'
import { ContentType, SNTag } from '@standardnotes/snjs'
import { featureTrunkEnabled, FeatureTrunkName } from '@/FeatureTrunk'
import { ContentType, FeatureIdentifier, SNTag } from '@standardnotes/snjs'
type Props = {
application: WebApplication
@@ -98,7 +97,7 @@ const ContentList: FunctionComponent<Props> = ({
const hasNotes = items.some((item) => item.content_type === ContentType.Note)
const isFilesTableViewEnabled = featureTrunkEnabled(FeatureTrunkName.FilesTableView)
const isFilesTableViewEnabled = application.features.isExperimentalFeatureEnabled(FeatureIdentifier.FilesTableView)
return (
<div

View File

@@ -1,5 +1,4 @@
import { featureTrunkEnabled, FeatureTrunkName } from '@/FeatureTrunk'
import { ContentType, FileItem, SNNote } from '@standardnotes/snjs'
import { ContentType, FeatureIdentifier, FileItem, SNNote } from '@standardnotes/snjs'
import React, { FunctionComponent } from 'react'
import FileListItem from './FileListItem'
import FileListItemCard from './FileListItemCard'
@@ -8,7 +7,9 @@ import { AbstractListItemProps, doListItemPropsMeritRerender } from './Types/Abs
import { ListableContentItem } from './Types/ListableContentItem'
const ContentListItem: FunctionComponent<AbstractListItemProps<ListableContentItem>> = (props) => {
const isFilesTableViewEnabled = featureTrunkEnabled(FeatureTrunkName.FilesTableView)
const isFilesTableViewEnabled = props.application.features.isExperimentalFeatureEnabled(
FeatureIdentifier.FilesTableView,
)
switch (props.item.content_type) {
case ContentType.Note:

View File

@@ -9,7 +9,7 @@ import {
} from '@standardnotes/ui-services'
import { WebApplication } from '@/Application/Application'
import { PANEL_NAME_NOTES } from '@/Constants/Constants'
import { FileItem, PrefKey, SystemViewId, WebAppEvent } from '@standardnotes/snjs'
import { FeatureIdentifier, FileItem, PrefKey, SystemViewId, WebAppEvent } from '@standardnotes/snjs'
import { observer } from 'mobx-react-lite'
import { forwardRef, useCallback, useEffect, useMemo } from 'react'
import ContentList from '@/Components/ContentListView/ContentList'
@@ -39,7 +39,6 @@ import { isMobileScreen } from '@/Utils'
import FloatingAddButton from './FloatingAddButton'
import FilesTableView from '../FilesTableView/FilesTableView'
import { FeaturesController } from '@/Controllers/FeaturesController'
import { featureTrunkEnabled, FeatureTrunkName } from '@/FeatureTrunk'
type Props = {
accountMenuController: AccountMenuController
@@ -182,7 +181,7 @@ const ContentListView = forwardRef<HTMLDivElement, Props>(
}
}, [isFilesSmartView, filesController, createNewNote, toggleAppPane, application])
const isFilesTableViewEnabled = featureTrunkEnabled(FeatureTrunkName.FilesTableView)
const isFilesTableViewEnabled = application.features.isExperimentalFeatureEnabled(FeatureIdentifier.FilesTableView)
const shouldShowFilesTableView = isFilesTableViewEnabled && selectedTag?.uuid === SystemViewId.Files
useEffect(() => {

View File

@@ -1,6 +1,7 @@
import {
CollectionSort,
CollectionSortProperty,
FeatureIdentifier,
IconType,
isSmartView,
isSystemView,
@@ -24,7 +25,6 @@ import NoSubscriptionBanner from '@/Components/NoSubscriptionBanner/NoSubscripti
import MenuRadioButtonItem from '@/Components/Menu/MenuRadioButtonItem'
import MenuSwitchButtonItem from '@/Components/Menu/MenuSwitchButtonItem'
import { Pill } from '@/Components/Preferences/PreferencesComponents/Content'
import { featureTrunkEnabled, FeatureTrunkName } from '@/FeatureTrunk'
const DailyEntryModeEnabled = true
@@ -250,7 +250,7 @@ const DisplayOptionsMenu: FunctionComponent<DisplayOptionsMenuProps> = ({
)
}
const isFilesTableViewEnabled = featureTrunkEnabled(FeatureTrunkName.FilesTableView)
const isFilesTableViewEnabled = application.features.isExperimentalFeatureEnabled(FeatureIdentifier.FilesTableView)
const shouldHideNonApplicableOptions = isFilesTableViewEnabled && selectedTag?.uuid === SystemViewId.Files
return (

View File

@@ -2,13 +2,11 @@ import { isDev } from '@/Utils'
export enum FeatureTrunkName {
Super,
FilesTableView,
ImportTools,
}
const FeatureTrunkStatus: Record<FeatureTrunkName, boolean> = {
[FeatureTrunkName.Super]: isDev && true,
[FeatureTrunkName.FilesTableView]: isDev && true,
[FeatureTrunkName.ImportTools]: isDev && true,
}