feat(social): keep scheduling calendar + add Content calendar button in dashboard

- revert showCalendar to true (calendar stays available in the white-label page)
- add a 'Content calendar' button (opens the Upload-Post page in a new tab) so users
  can consult/manage scheduled posts from the dashboard
This commit is contained in:
juancarlos.cavero 2026-07-16 19:26:49 +02:00
parent 8ce4d3c5d9
commit 0373c8571b
2 changed files with 20 additions and 4 deletions

View file

@ -80,7 +80,7 @@ async def get_connect_url(username: str) -> str:
"redirectUrl": f"{settings.frontend_url}/#/account?connected=1", "redirectUrl": f"{settings.frontend_url}/#/account?connected=1",
"redirectButtonText": "Back to OpenShorts", "redirectButtonText": "Back to OpenShorts",
"platforms": CONNECT_PLATFORMS, "platforms": CONNECT_PLATFORMS,
"showCalendar": False, # hide the scheduling calendar in the connect page "showCalendar": True, # keep the scheduling calendar available in the page
} }
async with httpx.AsyncClient(timeout=20) as client: async with httpx.AsyncClient(timeout=20) as client:
resp = await client.post( resp = await client.post(

View file

@ -360,6 +360,17 @@ function App() {
} }
}; };
// Open the Upload-Post white-label page (which includes the scheduling calendar)
// in a new tab, for consulting/managing scheduled posts from the dashboard.
const handleOpenCalendar = async () => {
try {
const { access_url } = await apiJson('/api/social/connect', { method: 'POST' });
if (access_url) window.open(access_url, '_blank', 'noopener');
} catch (e) {
alert('Could not open the calendar. Please try again.');
}
};
const handleProcess = async (data) => { const handleProcess = async (data) => {
// Hosted: must be signed in AND on an active plan/trial. Self-host: BYOK keys. // Hosted: must be signed in AND on an active plan/trial. Self-host: BYOK keys.
if (billingEnabled) { if (billingEnabled) {
@ -696,9 +707,14 @@ function App() {
fully managed — no API keys required. AI Shorts & dubbing use your own fal.ai / ElevenLabs fully managed — no API keys required. AI Shorts & dubbing use your own fal.ai / ElevenLabs
keys (below). Connect your social accounts to publish directly. keys (below). Connect your social accounts to publish directly.
</p> </p>
<button onClick={handleConnectSocials} className="btn-primary py-2 px-4 text-sm flex items-center gap-2"> <div className="flex flex-wrap gap-2">
<Share2 size={16} /> Connect social accounts <button onClick={handleConnectSocials} className="btn-primary py-2 px-4 text-sm flex items-center gap-2">
</button> <Share2 size={16} /> Connect social accounts
</button>
<button onClick={handleOpenCalendar} className="py-2 px-4 text-sm flex items-center gap-2 bg-white/5 hover:bg-white/10 border border-white/10 rounded-lg transition-colors">
<Calendar size={16} /> Content calendar
</button>
</div>
</div> </div>
) : billingEnabled ? ( ) : billingEnabled ? (
<div className="glass-panel p-6 mb-2 border-primary/30 ring-1 ring-primary/20"> <div className="glass-panel p-6 mb-2 border-primary/30 ring-1 ring-primary/20">