-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fixing calendar action in news creation #2096
Conversation
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.
onTap: () async { | ||
await ActerErrorDialog.show( | ||
context: context, | ||
error: e, | ||
stack: s, | ||
); | ||
}, |
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.
👏
static NewsReferencesType? fromStr(String typeStr) { | ||
return values.asNameMap()[_toCamelCase(typeStr)]; | ||
} | ||
} | ||
|
||
String _toCamelCase(String s) { | ||
final words = s | ||
.split('-') | ||
.map((w) => | ||
'${w.substring(0, 1).toUpperCase()}${w.substring(1).toLowerCase()}',) | ||
.toList(); | ||
words[0] = words[0].toLowerCase(); | ||
return words.join(); |
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.
Not quite understand this code.
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.
it rewrites strings from things-named-like-this
to thingsNamedLikeThis
While working on #2089 , I noticed that the way we construct the calendar-event-inline action is ... well, wrong. Instead of the typed
CalendarReference
we were using theLinkRef
with some weirdtitle
andid
properties as strings.This PR corrects that with fallback support for the types we have already sent/published. See the new one following by an old one:
calendar-events-proper-types.mp4
To the reviewer: