tutanota/src/common/gui/AttachmentBubble.ts

341 lines
11 KiB
TypeScript
Raw Normal View History

import m, { Children, Component, Vnode, VnodeDOM } from "mithril"
import { Attachment } from "../mailFunctionality/SendMailModel.js"
2023-04-12 16:51:08 +02:00
import { Button, ButtonType } from "./base/Button.js"
import { Icons } from "./base/icons/Icons.js"
import { formatStorageSize } from "../misc/Formatter.js"
import { defer, DeferredObject, noOp, Thunk } from "@tutao/tutanota-utils"
2023-04-12 16:51:08 +02:00
import { modal, ModalComponent } from "./base/Modal.js"
import { focusNext, focusPrevious, Shortcut } from "../misc/KeyManager.js"
2023-04-12 16:51:08 +02:00
import { PosRect } from "./base/Dropdown.js"
import { Keys } from "../api/common/TutanotaConstants.js"
import { px } from "./size.js"
import { AllIcons, Icon } from "./base/Icon.js"
2023-04-12 16:51:08 +02:00
import { theme } from "./theme.js"
import { animations, height, opacity, transform, TransformEnum, width } from "./animation/Animations.js"
import { ease } from "./animation/Easing.js"
import { getFileBaseName, getFileExtension, isTutanotaFile } from "../api/common/utils/FileUtils.js"
2023-04-12 16:51:08 +02:00
import { getSafeAreaInsetBottom } from "./HtmlUtils.js"
2024-01-09 15:47:35 +01:00
import { hasError } from "../api/common/utils/ErrorUtils.js"
import { BubbleButton, bubbleButtonHeight, bubbleButtonPadding } from "./base/buttons/BubbleButton.js"
import { BootIcons } from "./base/icons/BootIcons.js"
import { CALENDAR_MIME_TYPE, MAIL_MIME_TYPES, VCARD_MIME_TYPES } from "../file/FileController.js"
import { lang } from "../misc/LanguageViewModel.js"
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
export enum AttachmentType {
GENERIC,
CONTACT,
CALENDAR,
MAIL,
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
}
export type AttachmentBubbleAttrs = {
attachment: Attachment
download: Thunk | null
open: Thunk | null
remove: Thunk | null
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
fileImport: Thunk | null
type: AttachmentType
}
export class AttachmentBubble implements Component<AttachmentBubbleAttrs> {
private dom: HTMLElement | null = null
view(vnode: Vnode<AttachmentBubbleAttrs>): Children {
const { attachment } = vnode.attrs
if (isTutanotaFile(attachment) && hasError(attachment)) {
return m(BubbleButton, {
label: "emptyString_msg",
text: "corrupted_msg",
icon: Icons.Warning,
onclick: noOp,
})
} else {
const extension = getFileExtension(attachment.name)
const rest = getFileBaseName(attachment.name)
return m(
BubbleButton,
{
label: lang.makeTranslation("attachment_name", attachment.name),
text: lang.makeTranslation("attachment_base_name", rest),
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
icon: getAttachmentIcon(vnode.attrs.type),
onclick: () => {
showAttachmentDetailsPopup(this.dom!, vnode.attrs).then(() => this.dom?.focus())
},
},
`${extension}, ${formatStorageSize(Number(attachment.size))}`,
)
}
}
oncreate(vnode: VnodeDOM<AttachmentBubbleAttrs>): void {
this.dom = vnode.dom as HTMLElement
}
}
async function showAttachmentDetailsPopup(dom: HTMLElement, attrs: AttachmentBubbleAttrs): Promise<void> {
const parentRect = dom.getBoundingClientRect()
const panel = new AttachmentDetailsPopup(parentRect, parentRect.width, attrs)
panel.show()
return panel.deferAfterClose
}
function getAttachmentIcon(type: AttachmentType): AllIcons {
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
switch (type) {
case AttachmentType.CONTACT:
return Icons.People
case AttachmentType.CALENDAR:
return BootIcons.Calendar
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
default:
return Icons.Attachment
}
}
export function getAttachmentType(mimeType: string) {
if (Object.values<string>(VCARD_MIME_TYPES).includes(mimeType)) {
return AttachmentType.CONTACT
} else if (mimeType === CALENDAR_MIME_TYPE) {
return AttachmentType.CALENDAR
} else if (Object.values<string>(MAIL_MIME_TYPES).includes(mimeType)) {
return AttachmentType.MAIL
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
}
return AttachmentType.GENERIC
}
export class AttachmentDetailsPopup implements ModalComponent {
private readonly _shortcuts: Array<Shortcut> = []
private domContent: HTMLElement | null = null
private domPanel: HTMLElement | null = null
private closeDefer: DeferredObject<void> = defer()
private focusedBeforeShown: HTMLElement | null = null
get deferAfterClose(): Promise<void> {
return this.closeDefer.promise
}
constructor(
private readonly targetRect: PosRect,
private readonly targetWidth: number,
private readonly attrs: AttachmentBubbleAttrs,
) {
this._shortcuts.push({
key: Keys.ESC,
exec: () => this.onClose(),
help: "close_alt",
})
this._shortcuts.push({
key: Keys.TAB,
shift: true,
exec: () => (this.domContent ? focusPrevious(this.domContent) : false),
help: "selectPrevious_action",
})
this._shortcuts.push({
key: Keys.TAB,
shift: false,
exec: () => (this.domContent ? focusNext(this.domContent) : false),
help: "selectNext_action",
})
if (attrs.open) {
this._shortcuts.push({
key: Keys.O,
exec: () => this.thenClose(attrs.open),
help: "open_action",
})
}
if (attrs.download) {
this._shortcuts.push({
key: Keys.D,
exec: () => this.thenClose(attrs.download),
help: "download_action",
})
}
if (attrs.remove) {
this._shortcuts.push({
key: Keys.DELETE,
exec: () => this.thenClose(attrs.remove),
help: "remove_action",
})
}
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
if (attrs.fileImport) {
this._shortcuts.push({
key: Keys.I,
exec: () => this.thenClose(attrs.fileImport),
help: "import_action",
})
}
this.view = this.view.bind(this)
}
view(): Children {
return m(
".abs.bubble-color.border-radius.overflow-hidden.flex.flex-column",
{
class: bubbleButtonPadding(),
style: {
width: px(this.targetWidth),
// see hack description below. if #5587 persists, we might try visibility: hidden instead?
opacity: "0",
},
oncreate: (vnode) => {
this.domPanel = vnode.dom as HTMLElement
// This is a hack to get "natural" view size but render it invisibly first and then show the panel with inferred size.
// also focus the first tabbable element in the content after the panel opens.
deferToNextFrame(() => this.animatePanel().then(() => this.domContent && focusNext(this.domContent)))
},
onclick: () => this.onClose(),
},
this.renderContent(),
)
}
private renderContent(): Children {
// We are trying to make some contents look like the attachment button to make the transition look smooth.
// It is somewhat harder as it looks different with mobile layout.
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
const { remove, open, download, attachment, fileImport, type } = this.attrs
return m(
2025-10-17 15:06:50 +02:00
".flex.mb-8.pr-12",
{
oncreate: (vnode) => (this.domContent = vnode.dom as HTMLElement),
},
[
m(Icon, {
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
icon: getAttachmentIcon(type),
2025-10-17 15:06:50 +02:00
class: "pr-4 flex items-center",
style: {
fill: theme.on_surface,
"background-color": "initial",
minHeight: px(bubbleButtonHeight()),
},
}),
// flex-grow to cover the bubble in case it's bigger than our content
m(
".flex.col.flex-grow",
{
style: {
minHeight: px(bubbleButtonHeight()),
// set line-height to position the text like in the button
lineHeight: px(bubbleButtonHeight()),
},
},
m(".span.break-all.smaller", attachment.name),
// bottom info is inside the same column as file text to align them
m(".flex.row.justify-between.items-center", [
m("span.smaller", `${formatStorageSize(Number(attachment.size))}`),
m(".flex.no-wrap", [
remove ? m(Button, { type: ButtonType.Secondary, label: "remove_action", click: () => this.thenClose(remove) }) : null,
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
fileImport
? m(Button, {
type: ButtonType.Secondary,
label: "import_action",
click: () => this.thenClose(fileImport),
})
Contact book provider (#6553) * Added vCard import to attachments Now, when user receives a vCard as attachment an import option is displayed inside the attachment bubble, allowing the user to preview and import the users contained inside that vCard. The app handles both vCard mime types, text/vcard and text/x-vcard. * [android] Added vCard Handling * [android] Added readDataFile * [ios] Fix iOS readFile function The iOS readFile function was using the wrong Data constructor, leading to an Error related to invalid URL when trying to read the file. The readFile function now uses the Data(fileURLWithPath: ) instead of Data(contentsOf: ), allowing us to pass file paths to be loaded. * Add view file handling from native side to app's web part Now the app is capable to handle native side calls asking for importing files, mainly used when a user view a supported file and want that Tuta app handles it. Currently, the only supported format is .vcf and only on Android, since iOS doesn't support setting our app as a handler for vcf files. * Make array readonly * Create ContactFacade Implements a ContactFacade to communicate with the worker and handle errors correctly. * Show contact icon when attachment is a vCard file * Add ContactFacadeTest * Changes after review * Moved vCard parsing logic to ContactImporter * Create ContactImporter class * [android] Fix readDataFile to read on I/O thread * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Fix importing contacts from Device book on Android * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Changes after review * Implement device contacts import Close #6467 Co-authored-by: mup <mup@tutao.de> Co-authored-by: ivk <ivk@tutao.de> * Get Dirty info from contact on Android This commit adds the isDirty property to a contact and return Dirty contacts to the web part of the app, allowing the app to deal with native updates. * Handle native contact Updates This commit adds a handler to deal with contacts that were added or edited through the native. If created, inserts the new contact into the server, otherwise, updates it. * Apply contact deletion from native side When user deletes a contact from the native side, the deletion is applied to the server * Adjust iOS types * [android] Two-way contact sync on Android * Reset Contact's dirty state during Contact update * Two-way contact sync on iOS * Fix nickname and deletedOnDevice * Fix preview list scroll issue * Don't show incorrect mail address info on legacy plans It is not true that legacy plans can have unlimited custom domains. Make it not display anything here to prevent confusion. Fixes #6540 * Add new fields to Contact This commit add new fields described in #6590 to the model and adapts the ContactEditor and ContactViewer to handle the new fields. * [android] Added new fields to Android Contact Import * Fix Xcode warning for TaggedSqlValue * [ios] Add new contact fields to iOS * Add new fields to vCard This commit adds the following fields: - Middle Name - Name Suffix - Department (Inside ORG) - URL The field ROLE was changed to TITLE since that TITLE seems to be the expected name for this field. * Fix tests and add translations This commit fixes the vCard import/export tests and adds the missing translations for DE and DE_SIE. * Code cleanup * Code cleanup * Fix bugs from review * Reset selection in contact list view when deleting selected contents Call selectNone on the list model to clear the selection after deleting a selection of contacts. Fixes #6623 * Fix wrong label on new event button tooltip This should be newEvent_action; createEvent_label is used as a placeholder for when the event name is empty in the edit event dialog. Fixes #6626 * Lower the minimized mail editor overlay The overlay was position a bit too high due to the recent overlay changes. * Events are removed immediately when deleting single or changing rules Took out some code that was no longer useful. Long events are now always taken out when updated, the new event will automatically be filled in. close #6491 close #6444 Co-authored-by: ivk <ivk@tutao.de> * Fix label in global settings clipping on mobile * Makes version number copiable from about Dialog This commit makes the Version Number, License and Company Name able to be copied fix #6605 * Fix SearchBar returning no results even with not enabled index The users were able to trigger an empty search result even without accepting to enable the search index. Now, even if the user tries to bypass the dialog, the SearchBar will not return any result fix #2689 * Fix Android unwanted auto login This commit flags an intent that has already been handled by the app as handled, avoiding that when the user opens the app an intent re-deliver causes auto login. fix #6322 * Fix client-side captcha verification; fix SignupFormTest Fix Captcha matching hours 25-29 and allows it to match times that will never be correct (but can be checked locally). Add missing SignupFormTest to the test suite. Fixes #6316 * Align all day events in the calendar on desktop The ideal solution in my eyes is to rewrite the calendar header so that the header and body for the day are in one column flex. Using flex is better than constantly calculating the sizes of elements ourselves both in code simplicity and performance. Until then, this quick workaround seems to do the trick. * Allow switching the calendar for accepted events Co-authored-by: wec43 <wec@tutao.de> * Change default email domain when adding email address on legacy plan fix #6667 * Tell user they cannot add an alias before add alias dialog * [ci, ios] Separate staging app for iOS - Introduce new schemes in iOS app for debug, staging and prod - Add new appId - Add jobs to get provisioning profiles/certificates for staging app - Introduce new Fastlane lanes - Add Jenkins steps to build/upload staging app Close #6591 * [android] Two-way contact sync on Android * Fix an initial underscore being generated for Kotlin enum cases Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Add an onboarding wizard prototype This adds a guide that is displayed during the first run after installing the app. This also includes it's first page, the welcome page. This will be expanded upon in further commits. The icon design still needs to be finalised, so I have inserted a placeholder for now. * Make the onboarding wizard show only on first run This adds a property called `isSetupComplete` to `DeviceConfig` used to determine whether the onboarding wizard has been displayed before. The property is set to true after the wizard is completed or skipped causing the wizard only to display once per install. * Add notifications page to the Android version of the onboarding wizard Includes the android implementation. Co-authored-by: mup <mup@tutao.de> * Fix `licc` generating incorrect code for enums * Stop asking for notification permissions at launch Co-authored-by: ivk <ivk@tutao.de> * Add the theme page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Create a wrapper for onboarding wizard pages Co-authored-by: ivk <ivk@tutao.de> * Add the contacts page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Add the app lock page to the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Enable back buttons in the onboarding wizard * Implement the notifications page for iOS Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com> * Fix the next button overlapping the content in landscape view I am not happy about the magic '92%' value but to remove it we would need to calculate the remaining space from the breadcrumbs & dialog height. This may do for now. * Change the congratulations page header to 'Welcome to Tuta!' We decided to change it during a meeting. This way we welcome the user to the Tuta ecosystem instead of just the app. * Change `RadioSelector` styling This styles the `RadioSelector` into a 'radio button button' for the lack of a better term. This was decided in a meeting. * Remove skip button from onboarding wizard * Fix the app lock page of the onboarding wizard having too much padding * Change wizard breadcrumbs styling This changes the breadcrumbs in the wizard to make the style discussed during the meeting. * Remove the help text from the lock method options in the onboarding flow This is so the unlock method pages matches our design. * Improve the text in the onboarding wizard This tries to make the wizard less wordy & includes a couple small fixes. * Align buttons in the onboarding wizard * Clean up the notification permission check on visibility change code Co-authored-by: ivk <ivk@tutao.de> * Use a smaller dialog for the onboarding wizard Co-authored-by: ivk <ivk@tutao.de> * Fix Android build breaking due to Kotlin JVM version * Fix import errors * Stop asking for notification permissions at launch on iOS * Add the illustrations to the onboarding wizard This needs some optimization as the illustrations cause the CSS animations to lag. `Icons.ts` is not the best place to have the illustrations so we should create a new file. We could also look at sanitizing the SVGs once a way to keep the CSS classes in the SVG is found. * Disable the app lock page on the onboarding wizard if it is not needed * Move the onboarding wizard illustrations into a separate file The illustrations do not clutter up the icons file this way. * Apply redesign of the onboarding wizard This adds the next version of the illustrations and changes some layouts. * Optimise Onboarding Wizard Rendering This tries to speed up the wait between pressing 'next' and the next page of the onboarding wizard appearing. * Bring back the visualizer plugin We need it to diagnose chunk problems. It was removed because it was not compatible with our version of `rollup` at the time. Co-authored-by: ivk <ivk@tutao.de> * Load the onboarding wizard's illustrations externally As suggested by ivk, the illustrations are loaded in via an `img` tag to avoid bloating the chunks. I have manually optimised and inserted the illustrations again. This improves the performance of the wizard drastically. * Ignore the onboarding wizard's illustrations in screen readers --------- Co-authored-by: mup <mrex@tuta.io> Co-authored-by: paw <paw-hub@users.noreply.github.com> Co-authored-by: mup <mup@tutao.de> Co-authored-by: mac-github <mac-github@tutao.de> Co-authored-by: mup <34790144+murilopereirame@users.noreply.github.com> Co-authored-by: jat <jat@tutao.de> Co-authored-by: wrd <wrd@tutao.de> Co-authored-by: wec43 <wec@tutao.de> Co-authored-by: tutao <hello@tutao.de> Co-authored-by: paw-hub <104824185+paw-hub@users.noreply.github.com>
2024-03-13 10:53:51 +01:00
: null,
open ? m(Button, { type: ButtonType.Secondary, label: "open_action", click: () => this.thenClose(open) }) : null,
download ? m(Button, { type: ButtonType.Secondary, label: "download_action", click: () => this.thenClose(download) }) : null,
]),
]),
),
],
)
}
private thenClose(action: Thunk | null): void {
action?.()
this.onClose()
}
private async animatePanel(): Promise<void> {
const { targetRect, domPanel, domContent } = this
if (domPanel == null || domContent == null) return
const initialHeight = bubbleButtonHeight()
// there is a possibility that we get 0 here in some circumstances, but it's unclear when.
// might have something to do with the opacity: 0 hack above or because the original 24ms
// delay was not enough. https://github.com/tutao/tutanota/issues/5587
// 85 is a value that fits for a single line of attachment name, but looks weird for more while
// keeping the buttons accessible.
// if the reports continue, we can ask for logs.
const targetHeight = domContent.offsetHeight === 0 ? 85 : domContent.offsetHeight
if (domContent.offsetHeight === 0) {
console.log(
"got offsetHeight 0, panel contains content:",
domPanel.contains(domContent),
"content style:",
domContent.style,
"panel style:",
domPanel.style,
)
}
// for very short attachment bubbles, we need to set a min width so the buttons fit.
const targetWidth = Math.max(targetRect.width, 300)
domPanel.style.width = px(targetRect.width)
domPanel.style.height = px(initialHeight)
// add half the difference between .button height of 44px and 30px for pixel-perfect positioning
domPanel.style.top = px(targetRect.top)
//Verify if the attachment bubble is going to overflow the screen
//if yes, invert the side of the margin and discount the bubble width
if (targetRect.left + targetWidth > window.innerWidth) {
domPanel.style.right = px(24)
} else {
domPanel.style.left = px(targetRect.left)
}
const mutations = [opacity(0, 1, true), height(initialHeight, targetHeight)]
if (targetRect.width !== targetWidth) {
mutations.push(width(targetRect.width, targetWidth))
}
// space below the panel after it fully extends minus a bit.
const spaceBelow = window.innerHeight - getSafeAreaInsetBottom() - targetRect.top - targetHeight - initialHeight
if (spaceBelow < 0) {
mutations.push(transform(TransformEnum.TranslateY, 0, spaceBelow))
}
await animations.add(domPanel, mutations, {
easing: ease.out,
})
}
show() {
this.focusedBeforeShown = document.activeElement as HTMLElement
modal.displayUnique(this, true)
}
backgroundClick(e: MouseEvent): void {
modal.remove(this)
}
async hideAnimation(): Promise<void> {
if (this.domPanel == null) return
const startHeight = this.domPanel.offsetHeight
const startWidth = this.domPanel.offsetWidth
await animations.add(this.domPanel, [height(startHeight, 30), width(startWidth, this.targetWidth), opacity(1, 0, false)], {
easing: ease.out,
})
}
onClose(): void {
modal.remove(this)
this.closeDefer.resolve()
}
shortcuts(): Shortcut[] {
return this._shortcuts
}
popState(e: Event): boolean {
modal.remove(this)
return false
}
callingElement(): HTMLElement | null {
return this.focusedBeforeShown
}
}
/** try and execute stuff after the next rendering frame */
const deferToNextFrame = (fn: Thunk) => {
window.requestAnimationFrame(() => {
window.requestAnimationFrame(fn)
})
}