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.
*/
import $ from 'jquery';
import { Mindmap } from '..';
import PersistenceManager from './PersistenceManager';
class LocalStorageManager extends PersistenceManager {
@ -64,7 +63,7 @@ class LocalStorageManager extends PersistenceManager {
return $.parseXML(xml);
}
unlockMap(mindmap: Mindmap) {
unlockMap(): void {
// Ignore, no implementation required ...
}
}

View File

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

View File

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

View File

@ -70,7 +70,11 @@ class IMenu {
unlockMap(designer: Designer) {
const mindmap = designer.getMindmap();
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) {

View File

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

View File

@ -12,12 +12,12 @@ import FormControl from '@mui/material/FormControl';
import FormControlLabel from '@mui/material/FormControlLabel';
import Checkbox from '@mui/material/Checkbox';
import TabContext from '@mui/lab/TabContext';
import AppBar from '@mui/material/AppBar';
import TabList from '@mui/lab/TabList';
import Tab from '@mui/material/Tab';
import TabPanel from '@mui/lab/TabPanel';
import Typography from '@mui/material/Typography';
import TextareaAutosize from '@mui/material/TextareaAutosize';
import Box from '@mui/system/Box';
const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement => {
const { map } = fetchMapById(mapId);
@ -100,25 +100,25 @@ const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElemen
<div style={!model ? { visibility: 'hidden' } : {}}>
<TabContext value={activeTab}>
<AppBar position="static">
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
<TabList onChange={handleTabChange}>
<Tab
label={intl.formatMessage({
id: 'publish.embedded',
defaultMessage: 'Embedded',
})}
value="1"
/>
<Tab
label={intl.formatMessage({
id: 'publish.public-url',
defaultMessage: 'Public URL',
})}
value="1"
/>
<Tab
label={intl.formatMessage({
id: 'publish.embedded',
defaultMessage: 'Embedded',
})}
value="2"
/>
</TabList>
</AppBar>
<TabPanel value="1">
</Box>
<TabPanel value="2">
<Typography variant="subtitle2">
<FormattedMessage
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>`}
/>
</TabPanel>
<TabPanel value="2">
<TabPanel value="1">
<Typography variant="subtitle2">
<FormattedMessage
id="publish.public-url-msg"