Skip to content
Branch: master
Commits on Mar 15, 2020
  1. Add isInputtable to MultaccItemTypeInfo

    TortoiseWrath committed Mar 15, 2020
  2. Item model updates for edit & connect support

    TortoiseWrath committed Mar 15, 2020
    * Increase minimum Dart version to 2.6 so we can use extension
    * Add extension to MultaccItemType
        * Move default icons for each type here
    	* Move display names for each type here
    	    * Use enum alias as display name by default
        * Add isConnectable
    	* Add createItem() to create an empty item we can update later
    * Add Connector class for return value of MultaccItemType.connector
        * Call connect() to sign into platform
    	    * Returns a token or something
    		* Store pair of item key and token in Hive to keep track of
              connections and update (replace) items when values change
                * Persists connections where applicable
    		    * Should not store this token in the item itself because the
                  token should not be sent to multacc backend
    			* Do not allow user to directly modify value of "connected"
                  items and instead only refresh or delete
    	* Call get() to get the info from this platform using the token
    	    * Returns a MultaccItem containing the relevant info
    * Add default constructors to each MultaccItem implementation so we can
      create empty ones for manual input
    * Add setters for value to each MultaccItem implementation so we can set
      their value with manual input
        * These will be "smart" where applicable; for example, Twitter value
          setter should detect ID from username
    * Use Dart getters and setters where recommended by Effective Dart
    * Use type inference where method return type is inherited
    * Add icon getter to MultaccItem as well as MultaccItemType
        * This is the one that should be called for displaying
          preexisting items
    	* This way, items where icon should depend on some aspect of their
          value can be implemented
    	    * Potential examples: home vs mobile vs fax, home vs work vs
              school address
Commits on Mar 12, 2020
  1. Merge pull request #124 from multacc/sponsorship

    TortoiseWrath committed Mar 12, 2020
    Create FUNDING.yml
  2. Register Hive adapters

    TortoiseWrath committed Mar 12, 2020
    Forgot to do this in #72. Need to register the adapters when
    initializing hive. Failure to do so makes it no worky
  3. Store additional MultaccContact fields in database

    TortoiseWrath committed Mar 12, 2020
    Closes #70.
    In this commit, only display name, avatar, and birthday are stored
    alongside MultaccItems. Additional fields should be added as they
    become necessary.
    The following changes were made to facilitate this:
    * Add Hive adapters for MultaccContact and MultaccItem
    * Modify MultaccItem.fromDB to take only the JSON value as a parameter
        * Modify dummy contacts json to include key
    * Create an empty default constructor for MultaccContact
    * Name the existing MultaccContact(Contact) constructor as fromContact
    * Remove the existing addContact method from the database interface and
      rename addMultaccContact to addContact
    * Add names to the dummy contacts
    * DatabaseInterface.getContact now returns null if the contact does
      not exist (previously it returned an empty list of items)
    Other changes while I'm here:
    * Add constants in item.dart for '_t' and '_id' magic keys
    * Add toString to MultaccItem, which calls jsonEncode on it
    * Add DatabaseInterface.getAllContacts
    * Rename hive box from 'box' to 'contacts'
    * Contacts box can now only contain contacts
    * Move Hive box info from main.dart into DatabaseInterface
        * Makes adding additional boxes easier
        * Closes #67
    * Rename DatabaseInterface instance in main from dbi to db
    This uses a generated Hive adapter for MultaccContact. In order to
    generate the adapter, we have to apply annotations to the fields we want
    to store, which  means MultaccContact has to override the fields from
    Contact we want to store. Overriding fields is generally frowned upon,
    so if this is a concern the adapter can be replaced with a manually
    written one in the future.
    We cannot generate a Hive adapter for MultaccItem because it has several
    implementations with their own fields that have to be stored. We *could*
    generate adapters for each MultaccItem implementation, but then we would
    need code when storing the items to detect their type and code when
    reading them from the database to handle each type differently. For the
    same reason, the adapter I have written continues to use our existing
    JSON serialization for MultaccItem.
    I created a file, type_ids.dart, which contains constants for the type
    IDs for Hive adapters. This is because these must be globally unique,
    and keeping track of them in a single file will be easier than having
    them each in the file with the adapter.
    As MultaccItem.fromDB no longer takes parameters other than a single
    json-formatted string, it is conceivable to make it the fromJson method.
    This would necessitate renaming the existing fromJson method to fromMap,
    paralleling toMap; this is the method that would be separately implemen-
    ted for each item type.
  4. Add item ID to MultaccItem json (#66)

    TortoiseWrath committed Mar 12, 2020
    This ID will be used in the backend to track changes to items as part of
    the following functionality.
  5. Merge pull request #65 from multacc/wut

    TortoiseWrath committed Mar 12, 2020
    Remove unused import of nonexistent package
  6. Remove unused import of nonexistent package

    TortoiseWrath committed Mar 12, 2020
  7. Merge pull request #61 from multacc/fix-build

    TortoiseWrath committed Mar 12, 2020
    Fix failing build from #56
  8. Remove unwanted adapters

    TortoiseWrath committed Mar 12, 2020
  9. Forgot to change types

    TortoiseWrath committed Mar 12, 2020
Commits on Mar 10, 2020
  1. Use enum value name instead of index in json

    TortoiseWrath committed Mar 10, 2020
    * Instead of toJson(), each MultaccItem implementation shall now
      implement toMap(). toJson() will be inherited from a new default
      implementation in the base class, which calls toMap() then adds the
      item type to the resulting map.
      This prevents each implementation from having to add
        '_t': EnumToString.parse(getType())
      in its toJson() method
    * The key 'type' has been replaced with '_t' in MultaccItem
      serialization to make the resulting json slightly smaller and allow us
      to use the name 'type' for implementation-specific data such as
      phone number type.
    * Instead of the enum index, the EnumToString class is now used when
      serializing MultaccItems. This will allow the type enum to be modified
      in the future without breaking existing data.
    * PhoneItem and EmailItem added to switch statement in
      MultaccItem.fromDB() so they can now be deserialized with this factory
    New dependency: enum_to_string, which makes serialization and especially
    deserialization of enums easier.
    This change will render any old database values for items useless!!
    Luckily, to my knowledge we don't have any of those.
    Compare the old format:
      {'type': 7, 'email': ''}
    to the new:
      {'email': '', '_t': 'Email'}
  2. Merge pull request #48 from multacc/type-in-json

    TortoiseWrath committed Mar 10, 2020
    Add MultaccItem type to JSON representation
  3. Add MultaccItem type to JSON representation

    TortoiseWrath committed Mar 10, 2020
    Since MultaccItem's value is now a JSON object instead of a plain
    string (and our local database is NoSQL for some reason), it makes more
    sense to include the item type within this object rather than as a
    separate database column.
Commits on Mar 7, 2020
  1. Merge pull request #41 from multacc/destroying

    TortoiseWrath committed Mar 7, 2020
    Remove isSelected from MultaccContact
  2. Testing todo bot

    TortoiseWrath committed Mar 7, 2020
  3. Attempt to fix todo bot

    TortoiseWrath committed Mar 7, 2020
    Maybe this has to be indented with four spaces instead of a tab
  4. Convert email and phone to MultaccItem

    TortoiseWrath committed Mar 7, 2020
    Closes #27.
    * MultaccContact now copies identifier to clientKey (see #14)
    * Adds Phone and Email types to the MultaccItemType enum
    * Adds EmailItem and PhoneItem classes
        * fromItem constructors convert Item objects from contacts_service
          to these MultaccItem implementations
    * Populates multaccItems with PhoneItem and EmailItem instances when
      constructing a MultaccContact from a Contact
    * Adds TODOs to do the same for addresses, SIP, and IM
    * Increase Dart version to 2.3.0 to enable spread operator
    * Whitespace changes in twitter.dart thanks to Android Studio
  5. Merge pull request #31 from multacc/move-isSelected

    TortoiseWrath committed Mar 7, 2020
    Remove isSelected from MultaccContact
Commits on Mar 6, 2020
  1. Add factory to create MultaccItem from database

    TortoiseWrath committed Mar 6, 2020
    This factory will be used to create MultaccItem instances from stored
    data. These are the MultaccItems that will be stored in each
    MultaccContact when they are loaded.
  2. Style updates

    TortoiseWrath committed Mar 6, 2020
    This commit removes extraneous @override annotations and adds some fat
    arrows to make the code less Java-flavored and more Dart-flavored.
Commits on Mar 5, 2020
  1. Update MultaccItem to use json serialization

    TortoiseWrath committed Mar 5, 2020
    Previously, the only data stored besides the database key in a
    MultaccItem was a `value` string. This commit modifies the MultaccItem
    base class to replace this string with a `fromJson` constructor and
    `toJson` method.
    The TwitterItem class provides an example implementation. The user ID
    and display name are stored in two instance variables in the TwitterItem
    class. The JSON stored in the database will look like:
    This way, implementations of MultaccItem can store arbitrary data as
    necessary for the given platform.
  2. Rename contact_types package to items

    TortoiseWrath committed Mar 5, 2020
    The name contact_types was misleading since the classes in this package
    are used to create different types of items, not contacts.
  3. Add .idea and .github

    TortoiseWrath committed Mar 5, 2020
    .idea contains Android Studio config files because Mayank wanted them
    .github contains config to tell todobot not to add his
    label to issues
Commits on Mar 3, 2020
  1. Create contact_types package

    TortoiseWrath committed Mar 3, 2020
    This commit creates a new package, contact_types. It contains:
    * item.dart
        * MultaccItem is the base multacc item class
        * MultaccItemType is an enum of item types
    * twitter.dart
        * TwitterItem is a class extending MultaccItem and demonstrating
          what the implementations of MultaccItem should look like.
    In the future there should be one class for each item type.
    The indices from MultaccItemType will be used to identify the item types
    (Snapchat, Instagram, etc.) in the database.
    This package should contain classes that extend MultaccItem for each
    item type. A MultaccContact will then contain a List of instances of
    these classes, which will also be persisted in databases as necessary.
    MultaccItem is an abstract class; all items should be instances of
    classes such as TwitterItem that extend MultaccItem.
  2. Add database keys & Multacc items to contact model

    TortoiseWrath committed Mar 3, 2020
    This commit:
    * Renames ContactModel to MultaccContact
    * Adds serverKey and clientKey strings to MultaccContact
        - The serverKey should correspond to a key on the server-side
          graph database.
        - The clientKey should correspond to a key on the client-side
          SQL database.
    * Creates the MultaccItem class within contact_model.dart
    * Adds a List<MultaccItem> to MultaccContact
You can’t perform that action at this time.