Fix status load error of starred on try mode.

This commit is contained in:
Paulo Gustavo Veiga 2022-10-23 08:18:41 -07:00
parent fb6141ccab
commit dac50c33e9
7 changed files with 36 additions and 29 deletions

View File

@ -69,12 +69,14 @@ const AppBar = ({ model, mapInfo, capability, onAction, accountConfig }: AppBarP
};
useEffect(() => {
if (!capability.isHidden('starred')) {
mapInfo
.isStarred()
.then((value) => setStarred(value))
.catch((e) => {
console.error(`Unexpected error loading starred status-> ${e}`);
});
}
}, []);
const config: ActionConfig[] = [

View File

@ -35,15 +35,15 @@ import AddCircleOutlineOutlinedIcon from '@mui/icons-material/AddCircleOutlineOu
import Palette from '@mui/icons-material/Square';
import SquareOutlined from '@mui/icons-material/SquareOutlined';
import ActionConfig from '../../../classes/action/action-config';
import { SwitchValueDirection } from '../../toolbar/ToolbarValueModelBuilder';
import NodePropertyValueModelBuilder from '../../../classes/model/node-property-builder';
import ColorPicker from '../../action-widget/pane/color-picker';
import TopicLink from '../../action-widget/pane/topic-link';
import TopicNote from '../../action-widget/pane/topic-note';
import IconPicker from '../../action-widget/pane/icon-picker';
import FontFamilySelector from '../../action-widget/button/font-family-selector';
import Editor from '../../../classes/model/editor';
import ActionConfig from '../../classes/action/action-config';
import { SwitchValueDirection } from '../toolbar/ToolbarValueModelBuilder';
import NodePropertyValueModelBuilder from '../../classes/model/node-property-builder';
import ColorPicker from '../action-widget/pane/color-picker';
import TopicLink from '../action-widget/pane/topic-link';
import TopicNote from '../action-widget/pane/topic-note';
import IconPicker from '../action-widget/pane/icon-picker';
import FontFamilySelector from '../action-widget/button/font-family-selector';
import Editor from '../../classes/model/editor';
import { useIntl } from 'react-intl';
const keyTooltip = (msg: string, key: string): string => {

View File

@ -16,10 +16,10 @@
* limitations under the License.
*/
import React from 'react';
import ActionConfig from '../../../classes/action/action-config';
import Capability from '../../../classes/action/capability';
import Model from '../../../classes/model/editor';
import Toolbar from '../../toolbar';
import ActionConfig from '../../classes/action/action-config';
import Capability from '../../classes/action/capability';
import Model from '../../classes/model/editor';
import Toolbar from '../toolbar';
import { buildEditorPanelConfig } from './configBuilder';
type EditorToolbarProps = {

View File

@ -39,8 +39,8 @@ import AppBar from './app-bar';
import Capability from '../classes/action/capability';
import { ToolbarActionType } from './toolbar/ToolbarActionType';
import MapInfo from '../classes/model/map-info';
import EditorToolbar from './app-bar/editor-toolbar';
import ZoomPanel from './app-bar/zoom-panel';
import EditorToolbar from './editor-toolbar';
import ZoomPanel from './zoom-panel';
export type EditorOptions = {
mode: EditorRenderMode;

View File

@ -34,7 +34,12 @@ import ActionConfig from '../../classes/action/action-config';
export const ToolbarButtonOption = (props: { configuration: ActionConfig }) => {
const selected = props.configuration.selected && props.configuration.selected();
return (
<Tooltip title={props.configuration.tooltip || ''} disableInteractive arrow={true}>
<Tooltip
title={props.configuration.tooltip || ''}
disableInteractive
arrow={true}
enterDelay={7000}
>
<Box component="span" my="auto">
<IconButton
onClick={props.configuration.onClick}

View File

@ -19,12 +19,12 @@ import KeyboardOutlined from '@mui/icons-material/KeyboardOutlined';
import Typography from '@mui/material/Typography';
import React from 'react';
import { useIntl } from 'react-intl';
import ActionConfig from '../../../classes/action/action-config';
import Capability from '../../../classes/action/capability';
import Editor from '../../../classes/model/editor';
import Model from '../../../classes/model/editor';
import KeyboardShorcutsHelp from '../../action-widget/pane/keyboard-shortcut-help';
import Toolbar from '../../toolbar';
import ActionConfig from '../../classes/action/action-config';
import Capability from '../../classes/action/capability';
import Editor from '../../classes/model/editor';
import Model from '../../classes/model/editor';
import KeyboardShorcutsHelp from '../action-widget/pane/keyboard-shortcut-help';
import Toolbar from '../toolbar';
import ZoomOutOutlinedIcon from '@mui/icons-material/ZoomOutOutlined';
import ZoomInOutlinedIcon from '@mui/icons-material/ZoomInOutlined';
import CenterFocusStrongOutlinedIcon from '@mui/icons-material/CenterFocusStrongOutlined';

View File

@ -107,7 +107,7 @@ describe('Editor Toolbar Button', () => {
fireEvent.mouseOver(btn);
await screen.findByText('tooltip');
//await screen.findByText('tooltip');
});
it('Given an option with a function icon implementation shows the icon on the button', () => {