Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item model updates for edit & connect support #125

Merged
merged 1 commit into from Mar 15, 2020
Merged

Item model updates for edit & connect support #125

merged 1 commit into from Mar 15, 2020

Conversation

@TortoiseWrath
Copy link
Member

TortoiseWrath commented Mar 15, 2020

see commit msg for flul details

I am very tired and not thinking clearly so idk if any of this code is coherent or even usable but here you go. this might be our first rejected pull request :ultrafastparrot:

Yes I misspelled the branch name :exceptionallyfastparrot:

See #104

* 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
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 15, 2020

Format phone numbers

get humanReadableValue => phone; // @todo Format phone numbers
get type => MultaccItemType.Phone;
/// Dials number in the preferred app
launchApp() {


This comment was generated by todo based on a todo comment in 802c598 in #125.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 15, 2020

Allow adding phone number labels manually

// @todo Allow adding phone number labels manually
}
}
class PhoneConnector extends Connector {
PhoneConnector();


This comment was generated by todo based on a todo comment in 802c598 in #125.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 15, 2020

Detect user's phone number

// @todo Detect user's phone number
//
}
}


This comment was generated by todo based on a todo comment in 802c598 in #125.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 15, 2020

Detect Twitter user ID from username

// @todo Detect Twitter user ID from username
}
}
class TwitterConnector extends Connector {
TwitterConnector();


This comment was generated by todo based on a todo comment in 802c598 in #125.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 15, 2020

Connect to twitter

// @todo Connect to twitter
// return token
}
get(dynamic token) {
// Get value from twitter


This comment was generated by todo based on a todo comment in 802c598 in #125.
@TortoiseWrath TortoiseWrath added this to the sprint-2 milestone Mar 15, 2020
@mayank99 mayank99 merged commit f366de0 into master Mar 15, 2020
1 check passed
1 check passed
build
Details
@mayank99 mayank99 deleted the conncetors branch Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.