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:
CatsJuice
2025-05-20 02:31:26 +00:00
parent 6abd4bf427
commit acce1fbd99
4 changed files with 26 additions and 3 deletions

View File

@@ -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$);

View File

@@ -8,6 +8,7 @@ import type { WorkspaceService } from '../../workspace';
export interface CalendarSubscriptionConfig {
color: string;
name?: string;
showEvents?: boolean;
showAllDayEvents?: boolean;
}