fix(intelligence): contain friday ops rows on mobile and credit side op hosts
This commit is contained in:
parent
de3db4bd09
commit
b64f4b26f4
2 changed files with 12 additions and 3 deletions
|
|
@ -78,6 +78,10 @@ export default async function FridayCalendarPage() {
|
||||||
.map((m) => {
|
.map((m) => {
|
||||||
const map = m.classification.map;
|
const map = m.classification.map;
|
||||||
const createdBy = m.createdBy;
|
const createdBy = m.createdBy;
|
||||||
|
const creator =
|
||||||
|
typeof createdBy === "object" && createdBy !== null
|
||||||
|
? (createdBy as { displayName?: string | null; username?: string | null })
|
||||||
|
: null;
|
||||||
return {
|
return {
|
||||||
id: m.id,
|
id: m.id,
|
||||||
name: m.name,
|
name: m.name,
|
||||||
|
|
@ -86,6 +90,10 @@ export default async function FridayCalendarPage() {
|
||||||
startDateTime: m.classification.startDateTime,
|
startDateTime: m.classification.startDateTime,
|
||||||
operationType: m.operationType,
|
operationType: m.operationType,
|
||||||
mapName: typeof map === "object" && map !== null ? map.name : null,
|
mapName: typeof map === "object" && map !== null ? map.name : null,
|
||||||
|
hostName:
|
||||||
|
creator != null
|
||||||
|
? (creator.displayName ?? creator.username ?? null)
|
||||||
|
: null,
|
||||||
isOwn:
|
isOwn:
|
||||||
user != null &&
|
user != null &&
|
||||||
(typeof createdBy === "object" ? createdBy?.id : createdBy) === user.id,
|
(typeof createdBy === "object" ? createdBy?.id : createdBy) === user.id,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ export interface FridayCalendarMission {
|
||||||
startDateTime: string;
|
startDateTime: string;
|
||||||
operationType: string;
|
operationType: string;
|
||||||
mapName: string | null;
|
mapName: string | null;
|
||||||
|
hostName: string | null;
|
||||||
isOwn: boolean;
|
isOwn: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,7 +123,7 @@ export function FridayCalendar({
|
||||||
{fridayTaken ? "Taken" : "Schedule"}
|
{fridayTaken ? "Taken" : "Schedule"}
|
||||||
</Button>
|
</Button>
|
||||||
</ItemHeader>
|
</ItemHeader>
|
||||||
<ItemContent>
|
<ItemContent className="min-w-0">
|
||||||
{entry.missions.length === 0 ? (
|
{entry.missions.length === 0 ? (
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Nothing scheduled yet. Claim this Friday.
|
Nothing scheduled yet. Claim this Friday.
|
||||||
|
|
@ -133,7 +134,7 @@ export function FridayCalendar({
|
||||||
<Link
|
<Link
|
||||||
key={m.id}
|
key={m.id}
|
||||||
href={`/intelligence/missions/${m.id}`}
|
href={`/intelligence/missions/${m.id}`}
|
||||||
className="group flex items-center gap-3 rounded-md p-1.5 transition-colors hover:bg-muted/50"
|
className="group flex min-w-0 flex-1 items-center gap-3 rounded-md p-1.5 transition-colors hover:bg-muted/50"
|
||||||
>
|
>
|
||||||
<span className="w-14 shrink-0 font-mono text-xs text-muted-foreground">
|
<span className="w-14 shrink-0 font-mono text-xs text-muted-foreground">
|
||||||
{formatTime(m.startDateTime)}
|
{formatTime(m.startDateTime)}
|
||||||
|
|
@ -145,7 +146,7 @@ export function FridayCalendar({
|
||||||
<span className="truncate font-mono text-[10px] text-muted-foreground">
|
<span className="truncate font-mono text-[10px] text-muted-foreground">
|
||||||
{m.codeName}
|
{m.codeName}
|
||||||
{m.mapName ? ` · ${m.mapName}` : ""}
|
{m.mapName ? ` · ${m.mapName}` : ""}
|
||||||
{m.isOwn ? " · yours" : ""}
|
{m.isOwn ? " · yours" : m.hostName ? ` · hosted by ${m.hostName}` : ""}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue