Skip to content

Commit eb33a3c

Browse files
committed
Clean up logging and Prettier fixes
1 parent 549d810 commit eb33a3c

File tree

3 files changed

+45
-33
lines changed

3 files changed

+45
-33
lines changed

app/columns.tsx

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ function OffsiteLink(href: string, linkText: any) {
5858
);
5959
}
6060

61-
6261
// This type is used to define the shape of our data.
6362
// NOTE: ctrPercent is undefined by default until set using getCTRPercent. It is
6463
// made optional to help determine what's displayed in the Metrics column.
@@ -131,9 +130,7 @@ export type RecipeOrBranchInfo = RecipeInfo | BranchInfo;
131130
* Opens the Limelight utility using window.postMessage, waits for a response,
132131
* and sends message JSON as a payload for editing.
133132
*/
134-
function postMessageToLimelight(
135-
editableJson: string
136-
) {
133+
function postMessageToLimelight(editableJson: string) {
137134
let win = window.open("https://mozilla.github.io/limelight/?postMessage");
138135

139136
window.addEventListener(
@@ -143,13 +140,16 @@ function postMessageToLimelight(
143140
if (event.origin !== "https://mozilla.github.io/limelight/") {
144141
return;
145142
}
146-
(win as WindowProxy | null)?.postMessage({
147-
type: "import",
148-
value: editableJson,
149-
}, "https://mozilla.github.io/limelight/")
143+
(win as WindowProxy | null)?.postMessage(
144+
{
145+
type: "import",
146+
value: editableJson,
147+
},
148+
"https://mozilla.github.io/limelight/",
149+
);
150150
},
151151
false,
152-
);
152+
);
153153
}
154154

155155
/**
@@ -244,31 +244,36 @@ export const fxmsMessageColumns: ColumnDef<FxMSMessageInfo>[] = [
244244
accessorKey: "segment",
245245
header: "",
246246
cell: (props: any) => {
247-
const supportedTypes = [
248-
"infobar",
249-
"spotlight",
250-
];
247+
const supportedTypes = ["infobar", "spotlight"];
251248
if (supportedTypes.includes(props.row.original.template)) {
252-
return <button onClick={() => postMessageToLimelight(props.row.original.editableJson)} className="underline text-primary visited:text-primary cursor-pointer hover:no-underline text-xs/[180%]">
253-
Edit a copy of this message
254-
<svg
255-
fill="none"
256-
viewBox="0 0 8 8"
257-
className="inline h-[1.1rem] w-[1.1rem] px-1"
258-
aria-hidden="true"
259-
>
260-
<path
261-
clipRule="evenodd"
262-
d="m1.71278 0h.57093c.31531 0 .57092.255837.57092.571429 0 .315591-.25561.571431-.57092.571431h-.57093c-.31531 0-.57093.25583-.57093.57143v4.57142c0 .3156.25562.57143.57093.57143h4.56741c.31531 0 .57093-.25583.57093-.57143v-.57142c0-.3156.25561-.57143.57092-.57143.31532 0 .57093.25583.57093.57143v.57142c0 .94678-.76684 1.71429-1.71278 1.71429h-4.56741c-.945943 0-1.71278-.76751-1.71278-1.71429v-4.57142c0-.946778.766837-1.71429 1.71278-1.71429zm5.71629 0c.23083.0002686.43879.13963.52697.353143.02881.069172.04375.143342.04396.218286v2.857141c0 .31559-.25561.57143-.57093.57143-.31531 0-.57092-.25584-.57092-.57143v-1.47771l-1.88006 1.88171c-.14335.14855-.35562.20812-.55523.15583-.19962-.0523-.35551-.20832-.40775-.40811-.05225-.19979.00727-.41225.15569-.55572l1.88006-1.88171h-1.47642c-.31531 0-.57093-.25584-.57093-.571431 0-.315592.25562-.571429.57093-.571429z"
263-
fill="#5e5e72"
264-
fillRule="evenodd"
265-
></path>
266-
</svg>
267-
</button>
249+
return (
250+
<button
251+
onClick={() =>
252+
postMessageToLimelight(props.row.original.editableJson)
253+
}
254+
className="underline text-primary visited:text-primary cursor-pointer hover:no-underline text-xs/[180%]"
255+
>
256+
Edit a copy of this message
257+
<svg
258+
fill="none"
259+
viewBox="0 0 8 8"
260+
className="inline h-[1.1rem] w-[1.1rem] px-1"
261+
aria-hidden="true"
262+
>
263+
<path
264+
clipRule="evenodd"
265+
d="m1.71278 0h.57093c.31531 0 .57092.255837.57092.571429 0 .315591-.25561.571431-.57092.571431h-.57093c-.31531 0-.57093.25583-.57093.57143v4.57142c0 .3156.25562.57143.57093.57143h4.56741c.31531 0 .57093-.25583.57093-.57143v-.57142c0-.3156.25561-.57143.57092-.57143.31532 0 .57093.25583.57093.57143v.57142c0 .94678-.76684 1.71429-1.71278 1.71429h-4.56741c-.945943 0-1.71278-.76751-1.71278-1.71429v-4.57142c0-.946778.766837-1.71429 1.71278-1.71429zm5.71629 0c.23083.0002686.43879.13963.52697.353143.02881.069172.04375.143342.04396.218286v2.857141c0 .31559-.25561.57143-.57093.57143-.31531 0-.57092-.25584-.57092-.57143v-1.47771l-1.88006 1.88171c-.14335.14855-.35562.20812-.55523.15583-.19962-.0523-.35551-.20832-.40775-.40811-.05225-.19979.00727-.41225.15569-.55572l1.88006-1.88171h-1.47642c-.31531 0-.57093-.25584-.57093-.571431 0-.315592.25562-.571429.57093-.571429z"
266+
fill="#5e5e72"
267+
fillRule="evenodd"
268+
></path>
269+
</svg>
270+
</button>
271+
);
268272
}
269273
return <></>;
270274
},
271-
}, {
275+
},
276+
{
272277
accessorKey: "metrics",
273278
header: () => (
274279
<div className="flex flex-row items-center">

components/ui/menubutton.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ import {
1212
navigationMenuTriggerStyle,
1313
navigationMenuItemStyle,
1414
} from "@/components/ui/navigation-menu";
15-
import { Menu, Hash, Book, AppWindow, Table, FileSearch, Lightbulb } from "lucide-react";
15+
import {
16+
Menu,
17+
Hash,
18+
Book,
19+
AppWindow,
20+
Table,
21+
FileSearch,
22+
Lightbulb,
23+
} from "lucide-react";
1624
import { cn } from "@/lib/utils";
1725

1826
const ListItem = React.forwardRef<

lib/messageUtils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,8 @@ export function getEditableJSON(message: any): string {
172172
if (!screen.id) {
173173
screen.id = message.content.id;
174174
}
175-
})
175+
});
176176
}
177-
178177
return message;
179178
}
180179

0 commit comments

Comments
 (0)