Skip to content

Commit

Permalink
feat: show allowedFolderPath to user #2001
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Jan 18, 2023
1 parent ec65fda commit 1814dc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/features/android/android-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface AndroidInterface {
makeHttpRequestCallback(rId: string, result: { [key: string]: any }): void;

isGrantedFilePermission(): boolean;
allowedFolderPath(): string;
grantFilePermissionWrapped(): Promise<object>;
grantFilePermission(rId: string): void;
grantFilePermissionCallBack(rId: string): void;
Expand Down
16 changes: 16 additions & 0 deletions src/app/features/config/form-cfgs/sync-form.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ export const SYNC_FORM: ConfigFormSection<SyncConfig> = {
},
],
},
{
hideExpression: (m, v, field) =>
!IS_ANDROID_WEB_VIEW ||
field?.parent?.model.syncProvider !== SyncProvider.LocalFile ||
!androidInterface?.isGrantedFilePermission() ||
!androidInterface?.allowedFolderPath,
type: 'tpl',
className: `tpl`,
expressionProperties: {
template: () =>
// NOTE: hard to translate here, that's why we don't
`<div>Granted file access permission:<br />${
androidInterface.allowedFolderPath && androidInterface.allowedFolderPath()
}</div>`,
},
},
{
hideExpression: (m, v, field) =>
field?.parent?.model.syncProvider !== SyncProvider.LocalFile,
Expand Down

1 comment on commit 1814dc7

@lrq3000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.