-
Notifications
You must be signed in to change notification settings - Fork 87
TF-3603: Integrate Cozy features #3604
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
base: feature/cozy-integration
Are you sure you want to change the base?
TF-3603: Integrate Cozy features #3604
Conversation
This PR has been deployed to https://linagora.github.io/tmail-flutter/3604. |
|
JSBoolean() => flag.toDart, | ||
JSString() => flag.toDart == 'true', | ||
_ => false, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib/main/utils/cozy_contact.dart
Outdated
part 'cozy_contact.g.dart'; | ||
|
||
@JsonSerializable(createToJson: false) | ||
class CozyContact with EquatableMixin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For your information, 'io.cozy.contacts' definition is here https://github.com/cozy/cozy-doctypes/blob/master/docs/io.cozy.contacts.md (but maybe you already found it?).
But looks good, no need to add other fields for the moment 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we do the serialization on our side so it's all good.
Looks great! 🎉 🎉 |
4d4c578
to
112f446
Compare
core/lib/presentation/views/quick_search/type_ahead_field_quick_search.dart
Show resolved
Hide resolved
lib/main.dart
Outdated
// Get contacts example | ||
cozyConfig.getCozyContacts().then((contacts) { | ||
print('Contacts: $contacts'); | ||
}); | ||
|
||
// Get flag example | ||
cozyConfig.getCozyFeatureFlag('cozy.search.enabled').then((flag) { | ||
final isEnabled = flag == true || flag == 'true'; | ||
print('Search enabled: $isEnabled'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/main/utils/cozy_contact.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/main/utils/cozy_config.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move all things relate to cozy to another flutter module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/main/utils/cozy_config_web.dart
Outdated
Future<List<CozyContact>> getCozyContacts() async { | ||
try { | ||
final contacts = await promiseToFuture(getContactsJs()); | ||
return (contacts as JSArray<JSObject>) | ||
.toDart | ||
.map((contact) => CozyContact.fromJson(jsonDecode(stringify(contact)))) | ||
.toList(); | ||
} catch (e) { | ||
print('Error getting cozy contacts: $e'); | ||
return []; | ||
} | ||
} | ||
|
||
Future<dynamic> getCozyFeatureFlag(String flagName) async { | ||
try { | ||
final flag = await promiseToFuture(getFlagJs(flagName)); | ||
return switch (flag) { | ||
JSBoolean() => flag.toDart, | ||
JSString() => flag.toDart, | ||
JSNumber() => flag.toDartDouble, | ||
JSObject() => stringify(flag), | ||
_ => null, | ||
}; | ||
} catch (e) { | ||
print('Error getting cozy feature flag: $e'); | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
TF-3603 [TEMP] expose Cozy integration result to console.log
9e960af
to
d1d5a10
Compare
|
Done here cozy/cozy-twakechat#10 and cozy/cozy-twakemail#11. Locally it should work by just pulling master and |
cozy/.metadata
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
cozy/pubspec.yaml
Outdated
@@ -0,0 +1,24 @@ | |||
name: cozy | |||
description: "A new Flutter project." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cozy integration module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
cozy/web/favicon.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should choose another type of module to avoid a lot of things for app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
web
folder resources and code will not be included in android
or ios
build.
Issue
Related PRs
Demo
Screen.Recording.2025-04-24.at.09.40.01.mov