feat(feeds): add optional sandboxed in-tab article preview
This commit is contained in:
1 parent
ea1ca432c5
commit
f4869c7c8b
10 files changed
+68
-5
No files matched your search
@@ -64,6 +64,7 @@ type TaskPreferences struct {
|
||||
Version int64 `json:"version"`
|
||||
ProjectUUID string `json:"project_uuid"`
|
||||
WikiPrefix string `json:"wiki_prefix"`
|
||||
RSSLinkMode string `json:"rss_link_mode"`
|
||||
AssigneeUUID string `json:"assignee_uuid"`
|
||||
DueDays *int `json:"due_days"`
|
||||
StartDays *int `json:"start_days"`
|
||||
@@ -80,7 +81,7 @@ type TaskPreferences struct {
|
||||
}
|
||||
|
||||
func (s *Store) TaskPreferences(ctx context.Context, domain, actor string) (TaskPreferences, error) {
|
||||
p := TaskPreferences{AssigneeUUID: actor, Complexity: 1, ReminderTime: "09:00", DigestTime: "09:00", Timezone: "UTC"}
|
||||
p := TaskPreferences{AssigneeUUID: actor, Complexity: 1, ReminderTime: "09:00", DigestTime: "09:00", Timezone: "UTC", RSSLinkMode: "tab"}
|
||||
if err := taskActor(ctx, s.DB, domain, actor, false); err != nil {
|
||||
return p, err
|
||||
}
|
||||
@@ -123,6 +124,12 @@ func (s *Store) SaveTaskPreferences(ctx context.Context, domain, actor string, p
|
||||
if _, err := ExpandWikiPrefix(p.WikiPrefix, "subject", now); err != nil {
|
||||
return p, ErrTaskInvalid
|
||||
}
|
||||
if p.RSSLinkMode == "" {
|
||||
p.RSSLinkMode = "tab"
|
||||
}
|
||||
if p.RSSLinkMode != "tab" && p.RSSLinkMode != "embedded" {
|
||||
return p, ErrTaskInvalid
|
||||
}
|
||||
// Older clients do not send this field. Preserve their default clock.
|
||||
if p.ReminderTime == "" {
|
||||
p.ReminderTime = "09:00"
|
||||
|
||||
Reference in new issue
Block a user