feat: slide panels, task calendar, team management, project editing, collapsible sections
- Add SlidePanel, TaskDetailPanel, PostDetailPanel, TeamPanel, TeamMemberPanel - Add ProjectEditPanel, CollapsibleSection, DatePresetPicker, TaskCalendarView - Update App, AuthContext, i18n (ar/en), PostProduction, ProjectDetail, Projects - Update Settings, Tasks, Team pages - Update InteractiveTimeline, MemberCard, ProjectCard, TaskCard components - Update server API utilities - Remove tracked server/node_modules (now properly gitignored)
This commit is contained in:
@@ -24,7 +24,7 @@ const normalize = (data) => {
|
||||
// Map assigned_name for display
|
||||
if (out.assignedName && !out.assignedToName) out.assignedToName = out.assignedName;
|
||||
// Parse JSON text fields from NocoDB (stored as LongText)
|
||||
for (const jsonField of ['platforms', 'brands', 'tags', 'publicationLinks', 'publication_links', 'goals']) {
|
||||
for (const jsonField of ['platforms', 'brands', 'tags', 'publicationLinks', 'publication_links', 'goals', 'modules']) {
|
||||
if (out[jsonField] && typeof out[jsonField] === 'string') {
|
||||
try { out[jsonField] = JSON.parse(out[jsonField]); } catch {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import {
|
||||
startOfDay, endOfDay, subDays,
|
||||
startOfWeek, endOfWeek, subWeeks,
|
||||
startOfMonth, endOfMonth, subMonths,
|
||||
startOfQuarter, endOfQuarter,
|
||||
startOfYear, endOfYear,
|
||||
format,
|
||||
} from 'date-fns'
|
||||
|
||||
const fmt = d => format(d, 'yyyy-MM-dd')
|
||||
|
||||
export const DATE_PRESETS = [
|
||||
{
|
||||
key: 'today',
|
||||
labelKey: 'dates.today',
|
||||
getRange: () => {
|
||||
const now = new Date()
|
||||
return { from: fmt(startOfDay(now)), to: fmt(endOfDay(now)) }
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'yesterday',
|
||||
labelKey: 'dates.yesterday',
|
||||
getRange: () => {
|
||||
const d = subDays(new Date(), 1)
|
||||
return { from: fmt(startOfDay(d)), to: fmt(endOfDay(d)) }
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'thisWeek',
|
||||
labelKey: 'dates.thisWeek',
|
||||
getRange: () => {
|
||||
const now = new Date()
|
||||
return { from: fmt(startOfWeek(now, { weekStartsOn: 0 })), to: fmt(endOfWeek(now, { weekStartsOn: 0 })) }
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'lastWeek',
|
||||
labelKey: 'dates.lastWeek',
|
||||
getRange: () => {
|
||||
const d = subWeeks(new Date(), 1)
|
||||
return { from: fmt(startOfWeek(d, { weekStartsOn: 0 })), to: fmt(endOfWeek(d, { weekStartsOn: 0 })) }
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'thisMonth',
|
||||
labelKey: 'dates.thisMonth',
|
||||
getRange: () => {
|
||||
const now = new Date()
|
||||
return { from: fmt(startOfMonth(now)), to: fmt(endOfMonth(now)) }
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'lastMonth',
|
||||
labelKey: 'dates.lastMonth',
|
||||
getRange: () => {
|
||||
const d = subMonths(new Date(), 1)
|
||||
return { from: fmt(startOfMonth(d)), to: fmt(endOfMonth(d)) }
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'thisQuarter',
|
||||
labelKey: 'dates.thisQuarter',
|
||||
getRange: () => {
|
||||
const now = new Date()
|
||||
return { from: fmt(startOfQuarter(now)), to: fmt(endOfQuarter(now)) }
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'thisYear',
|
||||
labelKey: 'dates.thisYear',
|
||||
getRange: () => {
|
||||
const now = new Date()
|
||||
return { from: fmt(startOfYear(now)), to: fmt(endOfYear(now)) }
|
||||
},
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user