Fix public view style

This commit is contained in:
Paulo Gustavo Veiga 2022-02-16 12:43:53 -08:00
parent 94367c6e5e
commit 246d4ed538
6 changed files with 21 additions and 20 deletions

View File

@ -16,7 +16,6 @@
* limitations under the License. * limitations under the License.
*/ */
import $ from 'jquery'; import $ from 'jquery';
import { Mindmap } from '..';
import PersistenceManager from './PersistenceManager'; import PersistenceManager from './PersistenceManager';
class LocalStorageManager extends PersistenceManager { class LocalStorageManager extends PersistenceManager {
@ -64,7 +63,7 @@ class LocalStorageManager extends PersistenceManager {
return $.parseXML(xml); return $.parseXML(xml);
} }
unlockMap(mindmap: Mindmap) { unlockMap(): void {
// Ignore, no implementation required ... // Ignore, no implementation required ...
} }
} }

View File

@ -54,7 +54,7 @@ abstract class PersistenceManager {
abstract saveMapXml(mapId: string, mapXml: Document, pref?, saveHistory?: boolean, events?); abstract saveMapXml(mapId: string, mapXml: Document, pref?, saveHistory?: boolean, events?);
abstract unlockMap(mindmap: Mindmap): void; abstract unlockMap(mapId: string): void;
static init = (instance: PersistenceManager) => { static init = (instance: PersistenceManager) => {
this._instance = instance; this._instance = instance;

View File

@ -17,7 +17,6 @@
*/ */
import { $assert } from '@wisemapping/core-js'; import { $assert } from '@wisemapping/core-js';
import $ from 'jquery'; import $ from 'jquery';
import { Mindmap } from '..';
import { $msg } from './Messages'; import { $msg } from './Messages';
import PersistenceManager from './PersistenceManager'; import PersistenceManager from './PersistenceManager';
@ -132,8 +131,7 @@ class RESTPersistenceManager extends PersistenceManager {
}); });
} }
unlockMap(mindmap: Mindmap) { unlockMap(mapId: string):void {
const mapId = mindmap.getId();
fetch( fetch(
this.lockUrl.replace('{id}', mapId), this.lockUrl.replace('{id}', mapId),
{ {

View File

@ -70,7 +70,11 @@ class IMenu {
unlockMap(designer: Designer) { unlockMap(designer: Designer) {
const mindmap = designer.getMindmap(); const mindmap = designer.getMindmap();
const persistenceManager = PersistenceManager.getInstance(); const persistenceManager = PersistenceManager.getInstance();
persistenceManager.unlockMap(mindmap);
// If the map could not be loaded, partial map load could happen.
if (mindmap) {
persistenceManager.unlockMap(mindmap.getId());
}
} }
save(saveElem: JQuery, designer: Designer, saveHistory: boolean) { save(saveElem: JQuery, designer: Designer, saveHistory: boolean) {

View File

@ -57,7 +57,7 @@ class Menu extends IMenu {
return result; return result;
}, },
setValue(value) { setValue(value: string) {
designer.changeFontFamily(value); designer.changeFontFamily(value);
}, },
}; };

View File

@ -12,12 +12,12 @@ import FormControl from '@mui/material/FormControl';
import FormControlLabel from '@mui/material/FormControlLabel'; import FormControlLabel from '@mui/material/FormControlLabel';
import Checkbox from '@mui/material/Checkbox'; import Checkbox from '@mui/material/Checkbox';
import TabContext from '@mui/lab/TabContext'; import TabContext from '@mui/lab/TabContext';
import AppBar from '@mui/material/AppBar';
import TabList from '@mui/lab/TabList'; import TabList from '@mui/lab/TabList';
import Tab from '@mui/material/Tab'; import Tab from '@mui/material/Tab';
import TabPanel from '@mui/lab/TabPanel'; import TabPanel from '@mui/lab/TabPanel';
import Typography from '@mui/material/Typography'; import Typography from '@mui/material/Typography';
import TextareaAutosize from '@mui/material/TextareaAutosize'; import TextareaAutosize from '@mui/material/TextareaAutosize';
import Box from '@mui/system/Box';
const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement => { const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement => {
const { map } = fetchMapById(mapId); const { map } = fetchMapById(mapId);
@ -100,25 +100,25 @@ const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElemen
<div style={!model ? { visibility: 'hidden' } : {}}> <div style={!model ? { visibility: 'hidden' } : {}}>
<TabContext value={activeTab}> <TabContext value={activeTab}>
<AppBar position="static"> <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
<TabList onChange={handleTabChange}> <TabList onChange={handleTabChange}>
<Tab
label={intl.formatMessage({
id: 'publish.embedded',
defaultMessage: 'Embedded',
})}
value="1"
/>
<Tab <Tab
label={intl.formatMessage({ label={intl.formatMessage({
id: 'publish.public-url', id: 'publish.public-url',
defaultMessage: 'Public URL', defaultMessage: 'Public URL',
})} })}
value="1"
/>
<Tab
label={intl.formatMessage({
id: 'publish.embedded',
defaultMessage: 'Embedded',
})}
value="2" value="2"
/> />
</TabList> </TabList>
</AppBar> </Box>
<TabPanel value="1"> <TabPanel value="2">
<Typography variant="subtitle2"> <Typography variant="subtitle2">
<FormattedMessage <FormattedMessage
id="publish.embedded-msg" id="publish.embedded-msg"
@ -133,7 +133,7 @@ const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElemen
defaultValue={`<iframe style="width:600px;height:400px;border:1px solid black" src="https://app.wisemapping.com/c/maps/${mapId}/embed?zoom=1.0"></iframe>`} defaultValue={`<iframe style="width:600px;height:400px;border:1px solid black" src="https://app.wisemapping.com/c/maps/${mapId}/embed?zoom=1.0"></iframe>`}
/> />
</TabPanel> </TabPanel>
<TabPanel value="2"> <TabPanel value="1">
<Typography variant="subtitle2"> <Typography variant="subtitle2">
<FormattedMessage <FormattedMessage
id="publish.public-url-msg" id="publish.public-url-msg"