mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-25 07:07:32 -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) {
|
builder: (context, state) {
|
||||||
if (state.isLocked) {
|
if (state.isLocked) {
|
||||||
return FlowySvg(
|
return GestureDetector(
|
||||||
FlowySvgs.lock_page_s,
|
behavior: HitTestBehavior.opaque,
|
||||||
color: const Color(0xFFD95A0B),
|
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) {
|
} else if (!state.isLocked && state.lockCounter > 0) {
|
||||||
return FlowySvg(
|
return GestureDetector(
|
||||||
FlowySvgs.unlock_page_s,
|
behavior: HitTestBehavior.opaque,
|
||||||
color: Color(0xFF8F959E),
|
onTap: () {
|
||||||
blendMode: null,
|
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();
|
return const SizedBox.shrink();
|
||||||
|
|
|
@ -182,6 +182,7 @@ class MobileViewBottomSheetBody extends StatelessWidget {
|
||||||
),
|
),
|
||||||
_divider(),
|
_divider(),
|
||||||
..._buildPublishActions(context),
|
..._buildPublishActions(context),
|
||||||
|
_divider(),
|
||||||
MobileQuickActionButton(
|
MobileQuickActionButton(
|
||||||
text: LocaleKeys.button_delete.tr(),
|
text: LocaleKeys.button_delete.tr(),
|
||||||
textColor: Theme.of(context).colorScheme.error,
|
textColor: Theme.of(context).colorScheme.error,
|
||||||
|
@ -275,7 +276,7 @@ class _LockPageRightIconBuilder extends StatelessWidget {
|
||||||
onAction(
|
onAction(
|
||||||
MobileViewBottomSheetBodyAction.lockPage,
|
MobileViewBottomSheetBodyAction.lockPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
MobileViewBottomSheetBodyActionArguments.isLockedKey: !value,
|
MobileViewBottomSheetBodyActionArguments.isLockedKey: value,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -165,6 +165,7 @@ class _DocumentPageState extends State<DocumentPage>
|
||||||
context: context,
|
context: context,
|
||||||
width: width,
|
width: width,
|
||||||
padding: EditorStyleCustomizer.documentPadding,
|
padding: EditorStyleCustomizer.documentPadding,
|
||||||
|
editorState: editorState,
|
||||||
),
|
),
|
||||||
header: buildCoverAndIcon(context, state),
|
header: buildCoverAndIcon(context, state),
|
||||||
initialSelection: initialSelection,
|
initialSelection: initialSelection,
|
||||||
|
@ -183,6 +184,7 @@ class _DocumentPageState extends State<DocumentPage>
|
||||||
context: context,
|
context: context,
|
||||||
width: width,
|
width: width,
|
||||||
padding: EditorStyleCustomizer.documentPadding,
|
padding: EditorStyleCustomizer.documentPadding,
|
||||||
|
editorState: editorState,
|
||||||
),
|
),
|
||||||
header: buildCoverAndIcon(context, state),
|
header: buildCoverAndIcon(context, state),
|
||||||
initialSelection: initialSelection,
|
initialSelection: initialSelection,
|
||||||
|
|
|
@ -203,24 +203,33 @@ void _customBlockOptionActions(
|
||||||
} else {
|
} else {
|
||||||
top += 2.0;
|
top += 2.0;
|
||||||
}
|
}
|
||||||
return Padding(
|
return ValueListenableBuilder(
|
||||||
padding: EdgeInsets.only(top: top),
|
valueListenable: editorState.editableNotifier,
|
||||||
child: BlockActionList(
|
builder: (_, editable, child) {
|
||||||
blockComponentContext: context,
|
return Opacity(
|
||||||
blockComponentState: state,
|
opacity: editable ? 1.0 : 0.0,
|
||||||
editorState: editorState,
|
child: Padding(
|
||||||
blockComponentBuilder: builders,
|
padding: EdgeInsets.only(top: top),
|
||||||
actions: actions,
|
child: BlockActionList(
|
||||||
showSlashMenu: slashMenuItemsBuilder != null
|
blockComponentContext: context,
|
||||||
? () => customAppFlowySlashCommand(
|
blockComponentState: state,
|
||||||
itemsBuilder: slashMenuItemsBuilder,
|
editorState: editorState,
|
||||||
shouldInsertSlash: false,
|
blockComponentBuilder: builders,
|
||||||
deleteKeywordsByDefault: true,
|
actions: actions,
|
||||||
style: styleCustomizer.selectionMenuStyleBuilder(),
|
showSlashMenu: slashMenuItemsBuilder != null
|
||||||
supportSlashMenuNodeTypes: supportSlashMenuNodeTypes,
|
? () => customAppFlowySlashCommand(
|
||||||
).handler.call(editorState)
|
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;
|
return child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,11 +32,13 @@ class EditorStyleCustomizer {
|
||||||
required this.context,
|
required this.context,
|
||||||
required this.padding,
|
required this.padding,
|
||||||
this.width,
|
this.width,
|
||||||
|
this.editorState,
|
||||||
});
|
});
|
||||||
|
|
||||||
final BuildContext context;
|
final BuildContext context;
|
||||||
final EdgeInsets padding;
|
final EdgeInsets padding;
|
||||||
final double? width;
|
final double? width;
|
||||||
|
final EditorState? editorState;
|
||||||
|
|
||||||
static const double maxDocumentWidth = 480 * 4;
|
static const double maxDocumentWidth = 480 * 4;
|
||||||
static const double minDocumentWidth = 480;
|
static const double minDocumentWidth = 480;
|
||||||
|
@ -76,11 +78,15 @@ class EditorStyleCustomizer {
|
||||||
fontFamily = appearanceFont;
|
fontFamily = appearanceFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final cursorColor = (editorState?.editable ?? true)
|
||||||
|
? (appearance.cursorColor ??
|
||||||
|
DefaultAppearanceSettings.getDefaultCursorColor(context))
|
||||||
|
: Colors.transparent;
|
||||||
|
|
||||||
return EditorStyle.desktop(
|
return EditorStyle.desktop(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
maxWidth: width,
|
maxWidth: width,
|
||||||
cursorColor: appearance.cursorColor ??
|
cursorColor: cursorColor,
|
||||||
DefaultAppearanceSettings.getDefaultCursorColor(context),
|
|
||||||
selectionColor: appearance.selectionColor ??
|
selectionColor: appearance.selectionColor ??
|
||||||
DefaultAppearanceSettings.getDefaultSelectionColor(context),
|
DefaultAppearanceSettings.getDefaultSelectionColor(context),
|
||||||
defaultTextDirection: appearance.defaultTextDirection,
|
defaultTextDirection: appearance.defaultTextDirection,
|
||||||
|
|
|
@ -23,6 +23,8 @@ class VersionChecker {
|
||||||
|
|
||||||
if (UniversalPlatform.isWindows || UniversalPlatform.isMacOS) {
|
if (UniversalPlatform.isWindows || UniversalPlatform.isMacOS) {
|
||||||
autoUpdater.setFeedURL(url);
|
autoUpdater.setFeedURL(url);
|
||||||
|
// disable the auto update check
|
||||||
|
autoUpdater.setScheduledCheckInterval(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -556,7 +556,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"accountPage": {
|
"accountPage": {
|
||||||
"menuLabel": "My account",
|
"menuLabel": "Account & App",
|
||||||
"title": "My account",
|
"title": "My account",
|
||||||
"general": {
|
"general": {
|
||||||
"title": "Account name & profile image",
|
"title": "Account name & profile image",
|
||||||
|
@ -2008,8 +2008,8 @@
|
||||||
"searchForAnImage": "Search for an image",
|
"searchForAnImage": "Search for an image",
|
||||||
"pleaseInputYourOpenAIKey": "please input your AI key in Settings page",
|
"pleaseInputYourOpenAIKey": "please input your AI key in Settings page",
|
||||||
"saveImageToGallery": "Save image",
|
"saveImageToGallery": "Save image",
|
||||||
"failedToAddImageToGallery": "Failed to add image to gallery",
|
"failedToAddImageToGallery": "Failed to save image",
|
||||||
"successToAddImageToGallery": "Image added to gallery successfully",
|
"successToAddImageToGallery": "Saved image to Photos",
|
||||||
"unableToLoadImage": "Unable to load image",
|
"unableToLoadImage": "Unable to load image",
|
||||||
"maximumImageSize": "Maximum supported upload image size is 10MB",
|
"maximumImageSize": "Maximum supported upload image size is 10MB",
|
||||||
"uploadImageErrorImageSizeTooBig": "Image size must be less than 10MB",
|
"uploadImageErrorImageSizeTooBig": "Image size must be less than 10MB",
|
||||||
|
@ -3097,13 +3097,13 @@
|
||||||
"autoUpdate": {
|
"autoUpdate": {
|
||||||
"criticalUpdateTitle": "Update required to continue",
|
"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.",
|
"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!",
|
"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",
|
"bannerUpdateButton": "Update",
|
||||||
"settingsUpdateTitle": "New Version ({newVersion}) Available!",
|
"settingsUpdateTitle": "New Version ({newVersion}) Available!",
|
||||||
"settingsUpdateDescription": "Current version: {currentVersion} (Official build) → {newVersion}",
|
"settingsUpdateDescription": "Current version: {currentVersion} (Official build) → {newVersion}",
|
||||||
"settingsUpdateButton": "Update now",
|
"settingsUpdateButton": "Update",
|
||||||
"settingsUpdateWhatsNew": "What's new"
|
"settingsUpdateWhatsNew": "What's new"
|
||||||
},
|
},
|
||||||
"lockPage": {
|
"lockPage": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue