mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
feat(core): allow editing calendar name (#12251)
close AF-2569 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added the ability to edit calendar subscription names directly within the interface using an inline editor. - **Style** - Improved the appearance of calendar subscription names by updating layout and alignment for better readability. - **Bug Fixes** - Ensured that custom calendar subscription names are displayed and updated correctly. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -32,7 +32,12 @@ export class CalendarSubscription extends Entity<{ url: string }> {
|
||||
this.store.watchSubscriptionCache(this.props.url),
|
||||
''
|
||||
);
|
||||
name$ = this.content$.selector(content => {
|
||||
name$ = LiveData.computed(get => {
|
||||
const config = get(this.config$);
|
||||
if (config?.name !== undefined) {
|
||||
return config.name;
|
||||
}
|
||||
const content = get(this.content$);
|
||||
if (!content) return '';
|
||||
try {
|
||||
const jCal = ICAL.parse(content ?? '');
|
||||
@@ -42,6 +47,7 @@ export class CalendarSubscription extends Entity<{ url: string }> {
|
||||
return '';
|
||||
}
|
||||
});
|
||||
|
||||
eventsByDateMap$ = LiveData.computed(get => {
|
||||
const content = get(this.content$);
|
||||
const config = get(this.config$);
|
||||
|
||||
@@ -8,6 +8,7 @@ import type { WorkspaceService } from '../../workspace';
|
||||
|
||||
export interface CalendarSubscriptionConfig {
|
||||
color: string;
|
||||
name?: string;
|
||||
showEvents?: boolean;
|
||||
showAllDayEvents?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user