Merge pull request #2499 from ONLYOFFICE/feature/fix-bugs

Feature/fix bugs
This commit is contained in:
Julia Radzhabova
2023-07-24 10:43:16 +03:00
committed by GitHub
8 changed files with 49 additions and 37 deletions

View File

@ -116,30 +116,30 @@ const PageReviewChange = inject("storeAppOptions")(observer(props => {
<Page className='page-review'>
<Navbar title={_t.textReviewChange} backLink={!props.noBack && _t.textBack}>
{Device.phone &&
<NavRight>
<Link sheetClose=".coauth__sheet">
<Icon icon='icon-expand-down'/>
</Link>
</NavRight>
<NavRight>
<Link sheetClose=".coauth__sheet">
<Icon icon='icon-expand-down'/>
</Link>
</NavRight>
}
</Navbar>
<Toolbar position='bottom'>
<span className='change-buttons row'>
{!props.isReviewOnly &&
{(!props.isReviewOnly && !isProtected) &&
<span className='accept-reject row'>
<Link id='btn-accept-change'
href='#'
className={(isLockAcceptReject || isProtected) && 'disabled'}
className={(isLockAcceptReject) && 'disabled'}
onClick={() => {props.onAcceptCurrentChange()}}
>{_t.textAccept}</Link>
<Link id='btn-reject-change'
href='#'
className={(isLockAcceptReject || isProtected) && 'disabled'}
className={(isLockAcceptReject) && 'disabled'}
onClick={() => {props.onRejectCurrentChange()}}
>{_t.textReject}</Link>
</span>
}
{props.isReviewOnly && change && change.editable &&
{!props.isReviewOnly && change && change?.editable &&
<span className='delete'>
<Link href='#' id="btn-delete-change" onClick={() => {props.onDeleteChange()}}>{_t.textDelete}</Link>
</span>

View File

@ -534,6 +534,10 @@
.navbar-link-settings {
.navbar-inner {
background: @background-primary;
.icon-back {
color: @text-normal;
}
}
.title, a {
color: @text-normal;

View File

@ -1166,6 +1166,11 @@ input[type="number"]::-webkit-inner-spin-button {
}
}
// Review change
.accept-reject .link {
margin-right: 20px;
}

View File

@ -362,7 +362,7 @@ class ContextMenu extends ContextMenuController {
event: 'openlink'
});
if(isAllowedEditing) {
if(isAllowedEditing && !isViewer) {
itemsText.push({
caption: t('ContextMenu.menuEditLink'),
event: 'editlink'

View File

@ -83,16 +83,16 @@
// Review
.page-review {
--f7-toolbar-link-color: @brandColor;
.toolbar {
background-color: @background-secondary;
box-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
position: absolute;
#btn-reject-change {
margin-left: 20px;
}
#btn-goto-change {
margin-left: 10px;
}
.next-prev {
.link {
width: 44px;

View File

@ -8,13 +8,14 @@ const PageTypeLink = props => {
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
const [typeLink, setTypeLink] = useState(props.curType);
const isNavigate = props.isNavigate;
return (
<Page>
<Navbar className="navbar-link-settings" title={_t.textLinkType} backLink={_t.textBack}>
{Device.phone &&
<NavRight>
<Link icon='icon-close' popupClose="#add-link-popup"></Link>
<Link icon='icon-close' popupClose={!isNavigate ? "#add-link-popup" : ".add-popup"}></Link>
</NavRight>
}
</Navbar>
@ -30,6 +31,7 @@ const PageLinkTo = props => {
const isAndroid = Device.android;
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
const isNavigate = props.isNavigate;
const [stateTypeTo, setTypeTo] = useState(props.curTo);
const changeTypeTo = (type) => {
@ -55,7 +57,7 @@ const PageLinkTo = props => {
<Navbar className="navbar-link-settings" title={_t.textLinkTo} backLink={_t.textBack}>
{Device.phone &&
<NavRight>
<Link icon='icon-close' popupClose="#add-link-popup"></Link>
<Link icon='icon-close' popupClose={!isNavigate ? "#add-link-popup" : ".add-popup"}></Link>
</NavRight>
}
</Navbar>
@ -87,7 +89,7 @@ const PageLink = props => {
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
const regx = /["https://"]/g
const isNavigate = props.isNavigate;
const [typeLink, setTypeLink] = useState(1);
const textType = typeLink === 1 ? _t.textExternalLink : _t.textSlideInThisPresentation;
const changeType = (newType) => {
@ -121,7 +123,7 @@ const PageLink = props => {
<Navbar className="navbar-link-settings">
<NavLeft>
<Link text={Device.ios ? t('View.Add.textCancel') : ''} onClick={() => {
props.isNavigate ? f7.views.current.router.back() : props.closeModal('#add-link-popup', '#add-link-popover');
isNavigate ? f7.views.current.router.back() : props.closeModal('#add-link-popup', '#add-link-popover');
}}>
{Device.android && <Icon icon='icon-close' />}
</Link>
@ -140,7 +142,8 @@ const PageLink = props => {
<List inlineLabels className='inputs-list'>
<ListItem link={'/add-link-type/'} title={_t.textLinkType} after={textType} routeProps={{
changeType: changeType,
curType: typeLink
curType: typeLink,
isNavigate
}}/>
{typeLink === 1 ?
<ListInput label={_t.textLink}
@ -154,7 +157,8 @@ const PageLink = props => {
/> :
<ListItem link={'/add-link-to/'} title={_t.textLinkTo} after={displayTo} routeProps={{
changeTo: changeTo,
curTo: linkTo
curTo: linkTo,
isNavigate
}}/>
}
<ListInput label={_t.textDisplay}
@ -174,16 +178,6 @@ const PageLink = props => {
onChange={(event) => {setScreenTip(event.target.value)}}
/>
</List>
{/* <List className="buttons-list">
<ListButton title={_t.textInsert}
className={`button-fill button-raised ${typeLink === 1 && link.length < 1 && ' disabled'}`}
onClick={() => {
props.onInsertLink(typeLink, (typeLink === 1 ?
{url: link, display: stateDisplay, displayDisabled: displayDisabled, tip: screenTip } :
{linkTo: linkTo, numberTo: numberTo, display: stateDisplay, displayDisabled: displayDisabled, tip: screenTip}));
}}
/>
</List> */}
</Page>
)
};

View File

@ -263,7 +263,13 @@ const Statusbar = inject('storeWorksheets', 'storeAppOptions', 'users')(observer
{
text: _t.textCancel
}
]
],
on: {
opened: () => {
const nameField = document.querySelector('input[name="modal-sheet-name"]');
nameField.select();
},
}
}).open();
}
};

View File

@ -3,7 +3,7 @@ import {Page, Navbar, BlockTitle, List, ListItem, ListInput, ListButton, Icon, L
import { useTranslation } from 'react-i18next';
import {Device} from "../../../../../common/mobile/utils/device";
const PageTypeLink = ({curType, changeType}) => {
const PageTypeLink = ({curType, changeType, isNavigate}) => {
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
const [typeLink, setTypeLink] = useState(curType);
@ -13,7 +13,7 @@ const PageTypeLink = ({curType, changeType}) => {
<Navbar className="navbar-link-settings" title={_t.textLinkType} backLink={_t.textBack}>
{Device.phone &&
<NavRight>
<Link icon='icon-close' popupClose="#add-link-popup"></Link>
<Link icon='icon-close' popupClose={!isNavigate ? "#add-link-popup" : ".add-popup"}></Link>
</NavRight>
}
</Navbar>
@ -25,7 +25,7 @@ const PageTypeLink = ({curType, changeType}) => {
)
};
const PageSheet = ({curSheet, sheets, changeSheet}) => {
const PageSheet = ({curSheet, sheets, changeSheet, isNavigate}) => {
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
const [stateSheet, setSheet] = useState(curSheet.value);
@ -35,7 +35,7 @@ const PageSheet = ({curSheet, sheets, changeSheet}) => {
<Navbar className="navbar-link-settings" title={_t.textSheet} backLink={_t.textBack}>
{Device.phone &&
<NavRight>
<Link icon='icon-close' popupClose="#add-link-popup"></Link>
<Link icon='icon-close' popupClose={!isNavigate ? "#add-link-popup" : ".add-popup"}></Link>
</NavRight>
}
</Navbar>
@ -63,6 +63,7 @@ const AddLink = props => {
const isIos = Device.ios;
const { t } = useTranslation();
const _t = t('View.Add', {returnObjects: true});
const isNavigate = props.isNavigate;
const [typeLink, setTypeLink] = useState('ext');
const textType = typeLink === 'ext' ? _t.textExternalLink : _t.textInternalDataRange;
@ -93,7 +94,7 @@ const AddLink = props => {
<Navbar className="navbar-link-settings">
<NavLeft>
<Link text={Device.ios ? t('View.Add.textCancel') : ''} onClick={() => {
props.isNavigate ? f7.views.current.router.back() : props.closeModal('#add-link-popup', '#add-link-popover');
isNavigate ? f7.views.current.router.back() : props.closeModal('#add-link-popup', '#add-link-popover');
}}>
{Device.android && <Icon icon='icon-close' />}
</Link>
@ -113,7 +114,8 @@ const AddLink = props => {
{props.allowInternal &&
<ListItem link={'/add-link-type/'} title={_t.textLinkType} after={textType} routeProps={{
changeType: changeType,
curType: typeLink
curType: typeLink,
isNavigate
}}/>
}
{typeLink === 'ext' &&
@ -132,7 +134,8 @@ const AddLink = props => {
<ListItem link={'/add-link-sheet/'} title={_t.textSheet} after={curSheet.caption} routeProps={{
changeSheet: changeSheet,
sheets: props.sheets,
curSheet: curSheet
curSheet: curSheet,
isNavigate
}}/>
}
{typeLink === 'int' &&