Skip to content

Commit

Permalink
Merge pull request anyproto#921 from anyproto/release-6-hotfix-2
Browse files Browse the repository at this point in the history
Hotfix/Release 6: Notion import errors and shared space history
  • Loading branch information
ra3orblade authored Sep 9, 2024
2 parents f5e2b68 + 4fc2f0e commit 2325799
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 17 deletions.
24 changes: 14 additions & 10 deletions src/json/error.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
export default {
Code: {
ANYTYPE_NEEDS_UPGRADE: 10,
NO_ACCOUNTS_FOUND: 101,
FAILED_TO_FIND_ACCOUNT_INFO: 104,
ANOTHER_ANYTYPE_PROCESS_IS_RUNNING: 108,
ACCOUNT_IS_DELETED: 109,
PROTOCOL_NEEDS_UPGRADE: 110,
NOT_FOUND: 3,
OBJECT_DELETED: 4,
NO_OBJECTS_TO_IMPORT: 5
ANYTYPE_NEEDS_UPGRADE: 10,
NO_ACCOUNTS_FOUND: 101,
FAILED_TO_FIND_ACCOUNT_INFO: 104,
ANOTHER_ANYTYPE_PROCESS_IS_RUNNING: 108,
ACCOUNT_IS_DELETED: 109,
PROTOCOL_NEEDS_UPGRADE: 110,
NOT_FOUND: 3,
OBJECT_DELETED: 4,
NO_OBJECTS_TO_IMPORT: 5,
IMPORT_IS_CANCELED: 6,
LIMIT_OF_ROWS_OR_RELATIONS_EXCEEDED: 7,
FILE_LOAD_ERROR: 8,
INSUFFICIENT_PERMISSIONS: 9,
},

'Error: net::ERR_TIMED_OUT': 'Network time-out',
'Error: net::ERR_CONNECTION_CLOSED': 'Connection closed',
};
};
12 changes: 10 additions & 2 deletions src/json/text.json
Original file line number Diff line number Diff line change
Expand Up @@ -2084,8 +2084,16 @@
"notificationGalleryErrorTitle": "Something went wrong",
"notificationGalleryErrorText": "Oops! <b>'%s'</b> wasn't installed. Please check your Internet connection and try again or post a report in our community.",

"notificationNotionErrorNoObjectsTitle": "Add integration to the Notion pages you want to import",
"notificationNotionErrorNoObjectsText": "Select Notion document → … -> Add Connections -> Confirm Integration",
"notificationImportErrorTitle5": "No Items to Import",
"notificationImportErrorText5": "There are no items to import. Please check your file type or Import selection and try again.",
"notificationImportErrorTitle6": "Import Canceled",
"notificationImportErrorText6": "The import has been canceled.",
"notificationImportErrorTitle7": "Import Limit Exceeded",
"notificationImportErrorText7": "The file exceeds the import limit of 1,000 rows or 10 columns. Please adjust your file and try again.",
"notificationImportErrorTitle8": "File Load Error",
"notificationImportErrorText8": "We couldn’t load your files. Please check your files and try again, or manually transfer the files.",
"notificationImportErrorTitle9": "Permission Denied",
"notificationImportErrorText9": "We don’t have permission to import into this Anytype space.",

"notificationJoinSuccessText": "<b>%s</b> has requested to join <b>'%s'</b> space",

Expand Down
2 changes: 1 addition & 1 deletion src/ts/component/page/main/history/right.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -511,4 +511,4 @@ const HistoryRight = observer(class HistoryRight extends React.Component<Props,

});

export default HistoryRight;
export default HistoryRight;
16 changes: 12 additions & 4 deletions src/ts/model/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,17 @@ class Notification implements I.Notification {

switch (this.type) {
case I.NotificationType.Import: {
if ((importType == I.ImportType.Notion) && (errorCode == J.Error.Code.NO_OBJECTS_TO_IMPORT)) {
this.title = translate('notificationNotionErrorNoObjectsTitle');
this.text = translate('notificationNotionErrorNoObjectsText');
const codes = [
J.Error.Code.NO_OBJECTS_TO_IMPORT,
J.Error.Code.IMPORT_IS_CANCELED,
J.Error.Code.LIMIT_OF_ROWS_OR_RELATIONS_EXCEEDED,
J.Error.Code.FILE_LOAD_ERROR,
J.Error.Code.INSUFFICIENT_PERMISSIONS,
];

if (codes.includes(errorCode)) {
this.title = translate(`notificationImportErrorTitle${errorCode}`);
this.text = translate(`notificationImportErrorText${errorCode}`);
};
break;
};
Expand Down Expand Up @@ -90,4 +98,4 @@ class Notification implements I.Notification {

};

export default Notification;
export default Notification;

0 comments on commit 2325799

Please sign in to comment.