mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 22:57:12 -04:00
fix: lock page issues (#7380)
* fix: unable to click the swith to lock/unlock page * fix: add divider above delete button on mobile * fix: enable lock/unlock page by tapping the lock icon * chore: update translations * fix: hide cursor when the page is locked * fix: the inline databaes still can be edited if the document is locked * fix: disable auto update checker * chore: change my account to account & app
This commit is contained in:
parent
0e7ac85f90
commit
e028e45e93
8 changed files with 90 additions and 34 deletions
|
@ -368,15 +368,45 @@ class _MobileViewPageState extends State<MobileViewPage> {
|
|||
},
|
||||
builder: (context, state) {
|
||||
if (state.isLocked) {
|
||||
return FlowySvg(
|
||||
FlowySvgs.lock_page_s,
|
||||
color: const Color(0xFFD95A0B),
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
context.read<ViewLockStatusBloc>().add(
|
||||
const ViewLockStatusEvent.unlock(),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 4.0,
|
||||
right: 8,
|
||||
bottom: 4.0,
|
||||
),
|
||||
child: FlowySvg(
|
||||
FlowySvgs.lock_page_s,
|
||||
color: const Color(0xFFD95A0B),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else if (!state.isLocked && state.lockCounter > 0) {
|
||||
return FlowySvg(
|
||||
FlowySvgs.unlock_page_s,
|
||||
color: Color(0xFF8F959E),
|
||||
blendMode: null,
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
context.read<ViewLockStatusBloc>().add(
|
||||
const ViewLockStatusEvent.lock(),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 4.0,
|
||||
right: 8,
|
||||
bottom: 4.0,
|
||||
),
|
||||
child: FlowySvg(
|
||||
FlowySvgs.unlock_page_s,
|
||||
color: Color(0xFF8F959E),
|
||||
blendMode: null,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
|
|
|
@ -182,6 +182,7 @@ class MobileViewBottomSheetBody extends StatelessWidget {
|
|||
),
|
||||
_divider(),
|
||||
..._buildPublishActions(context),
|
||||
_divider(),
|
||||
MobileQuickActionButton(
|
||||
text: LocaleKeys.button_delete.tr(),
|
||||
textColor: Theme.of(context).colorScheme.error,
|
||||
|
@ -275,7 +276,7 @@ class _LockPageRightIconBuilder extends StatelessWidget {
|
|||
onAction(
|
||||
MobileViewBottomSheetBodyAction.lockPage,
|
||||
arguments: {
|
||||
MobileViewBottomSheetBodyActionArguments.isLockedKey: !value,
|
||||
MobileViewBottomSheetBodyActionArguments.isLockedKey: value,
|
||||
},
|
||||
);
|
||||
},
|
||||
|
|
|
@ -165,6 +165,7 @@ class _DocumentPageState extends State<DocumentPage>
|
|||
context: context,
|
||||
width: width,
|
||||
padding: EditorStyleCustomizer.documentPadding,
|
||||
editorState: editorState,
|
||||
),
|
||||
header: buildCoverAndIcon(context, state),
|
||||
initialSelection: initialSelection,
|
||||
|
@ -183,6 +184,7 @@ class _DocumentPageState extends State<DocumentPage>
|
|||
context: context,
|
||||
width: width,
|
||||
padding: EditorStyleCustomizer.documentPadding,
|
||||
editorState: editorState,
|
||||
),
|
||||
header: buildCoverAndIcon(context, state),
|
||||
initialSelection: initialSelection,
|
||||
|
|
|
@ -203,24 +203,33 @@ void _customBlockOptionActions(
|
|||
} else {
|
||||
top += 2.0;
|
||||
}
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(top: top),
|
||||
child: BlockActionList(
|
||||
blockComponentContext: context,
|
||||
blockComponentState: state,
|
||||
editorState: editorState,
|
||||
blockComponentBuilder: builders,
|
||||
actions: actions,
|
||||
showSlashMenu: slashMenuItemsBuilder != null
|
||||
? () => customAppFlowySlashCommand(
|
||||
itemsBuilder: slashMenuItemsBuilder,
|
||||
shouldInsertSlash: false,
|
||||
deleteKeywordsByDefault: true,
|
||||
style: styleCustomizer.selectionMenuStyleBuilder(),
|
||||
supportSlashMenuNodeTypes: supportSlashMenuNodeTypes,
|
||||
).handler.call(editorState)
|
||||
: () {},
|
||||
),
|
||||
return ValueListenableBuilder(
|
||||
valueListenable: editorState.editableNotifier,
|
||||
builder: (_, editable, child) {
|
||||
return Opacity(
|
||||
opacity: editable ? 1.0 : 0.0,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: top),
|
||||
child: BlockActionList(
|
||||
blockComponentContext: context,
|
||||
blockComponentState: state,
|
||||
editorState: editorState,
|
||||
blockComponentBuilder: builders,
|
||||
actions: actions,
|
||||
showSlashMenu: slashMenuItemsBuilder != null
|
||||
? () => customAppFlowySlashCommand(
|
||||
itemsBuilder: slashMenuItemsBuilder,
|
||||
shouldInsertSlash: false,
|
||||
deleteKeywordsByDefault: true,
|
||||
style: styleCustomizer.selectionMenuStyleBuilder(),
|
||||
supportSlashMenuNodeTypes:
|
||||
supportSlashMenuNodeTypes,
|
||||
).handler.call(editorState)
|
||||
: () {},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -95,6 +95,12 @@ class _DatabaseBlockComponentWidgetState
|
|||
);
|
||||
}
|
||||
|
||||
if (!editorState.editable) {
|
||||
child = IgnorePointer(
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,11 +32,13 @@ class EditorStyleCustomizer {
|
|||
required this.context,
|
||||
required this.padding,
|
||||
this.width,
|
||||
this.editorState,
|
||||
});
|
||||
|
||||
final BuildContext context;
|
||||
final EdgeInsets padding;
|
||||
final double? width;
|
||||
final EditorState? editorState;
|
||||
|
||||
static const double maxDocumentWidth = 480 * 4;
|
||||
static const double minDocumentWidth = 480;
|
||||
|
@ -76,11 +78,15 @@ class EditorStyleCustomizer {
|
|||
fontFamily = appearanceFont;
|
||||
}
|
||||
|
||||
final cursorColor = (editorState?.editable ?? true)
|
||||
? (appearance.cursorColor ??
|
||||
DefaultAppearanceSettings.getDefaultCursorColor(context))
|
||||
: Colors.transparent;
|
||||
|
||||
return EditorStyle.desktop(
|
||||
padding: padding,
|
||||
maxWidth: width,
|
||||
cursorColor: appearance.cursorColor ??
|
||||
DefaultAppearanceSettings.getDefaultCursorColor(context),
|
||||
cursorColor: cursorColor,
|
||||
selectionColor: appearance.selectionColor ??
|
||||
DefaultAppearanceSettings.getDefaultSelectionColor(context),
|
||||
defaultTextDirection: appearance.defaultTextDirection,
|
||||
|
|
|
@ -23,6 +23,8 @@ class VersionChecker {
|
|||
|
||||
if (UniversalPlatform.isWindows || UniversalPlatform.isMacOS) {
|
||||
autoUpdater.setFeedURL(url);
|
||||
// disable the auto update check
|
||||
autoUpdater.setScheduledCheckInterval(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -556,7 +556,7 @@
|
|||
}
|
||||
},
|
||||
"accountPage": {
|
||||
"menuLabel": "My account",
|
||||
"menuLabel": "Account & App",
|
||||
"title": "My account",
|
||||
"general": {
|
||||
"title": "Account name & profile image",
|
||||
|
@ -2008,8 +2008,8 @@
|
|||
"searchForAnImage": "Search for an image",
|
||||
"pleaseInputYourOpenAIKey": "please input your AI key in Settings page",
|
||||
"saveImageToGallery": "Save image",
|
||||
"failedToAddImageToGallery": "Failed to add image to gallery",
|
||||
"successToAddImageToGallery": "Image added to gallery successfully",
|
||||
"failedToAddImageToGallery": "Failed to save image",
|
||||
"successToAddImageToGallery": "Saved image to Photos",
|
||||
"unableToLoadImage": "Unable to load image",
|
||||
"maximumImageSize": "Maximum supported upload image size is 10MB",
|
||||
"uploadImageErrorImageSizeTooBig": "Image size must be less than 10MB",
|
||||
|
@ -3097,13 +3097,13 @@
|
|||
"autoUpdate": {
|
||||
"criticalUpdateTitle": "Update required to continue",
|
||||
"criticalUpdateDescription": "We've made improvements to enhance your experience! Please update from {currentVersion} to {newVersion} to keep using the app.",
|
||||
"criticalUpdateButton": "Update now",
|
||||
"criticalUpdateButton": "Update",
|
||||
"bannerUpdateTitle": "New Version Available!",
|
||||
"bannerUpdateDescription": "Get the latest features and bug fixes. Click \"Update\" to install now",
|
||||
"bannerUpdateDescription": "Get the latest features and fixes. Click \"Update\" to install now",
|
||||
"bannerUpdateButton": "Update",
|
||||
"settingsUpdateTitle": "New Version ({newVersion}) Available!",
|
||||
"settingsUpdateDescription": "Current version: {currentVersion} (Official build) → {newVersion}",
|
||||
"settingsUpdateButton": "Update now",
|
||||
"settingsUpdateButton": "Update",
|
||||
"settingsUpdateWhatsNew": "What's new"
|
||||
},
|
||||
"lockPage": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue