Fail lint check on error (#5398)
parent
e5ba861621
commit
47a663f5a9
|
@ -30,7 +30,10 @@ jobs:
|
|||
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
- name: Test Code Linting
|
||||
run: yarn lint
|
||||
|
||||
- name: Save Code Linting Reports
|
||||
run: yarn lint:report
|
||||
continue-on-error: true
|
||||
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
import Script from "next/script";
|
||||
|
||||
import { getEventTypeAppData } from "@calcom/app-store/utils";
|
||||
|
||||
import { trackingApps } from "./eventTypeAnalytics";
|
||||
|
||||
export type AppScript = {attrs?: Record<string, string>} & ({src: undefined, content?: string} | {src?: string, content:undefined})
|
||||
export type AppScript = { attrs?: Record<string, string> } & (
|
||||
| { src: undefined; content?: string }
|
||||
| { src?: string; content: undefined }
|
||||
);
|
||||
|
||||
export default function BookingPageTagManager({
|
||||
eventType,
|
||||
}: {
|
||||
eventType: Parameters<typeof getEventTypeAppData>[0];
|
||||
}) {
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
{Object.entries(trackingApps).map(([appId, scriptConfig]) => {
|
||||
|
@ -19,22 +21,32 @@ export default function BookingPageTagManager({
|
|||
if (!trackingId) {
|
||||
return null;
|
||||
}
|
||||
const parseValue = <T extends string|undefined, >(val: T ):T => val ? val.replace(/\{TRACKING_ID\}/g, trackingId) as T : val
|
||||
const parseValue = <T extends string | undefined>(val: T): T =>
|
||||
val ? (val.replace(/\{TRACKING_ID\}/g, trackingId) as T) : val;
|
||||
|
||||
return scriptConfig.scripts.map((script, index) => {
|
||||
const parsedAttributes: NonNullable<AppScript["attrs"]> = {};
|
||||
const attrs = script.attrs || {};
|
||||
Object.entries(attrs).forEach(([name, value]) => {
|
||||
if (typeof value === "string") {
|
||||
value = parseValue(value)
|
||||
value = parseValue(value);
|
||||
}
|
||||
parsedAttributes[name] = value;
|
||||
});
|
||||
|
||||
return <Script src={parseValue(script.src)} key={`${appId}-${index}`} {...{dangerouslySetInnerHTML:{
|
||||
__html: parseValue(script.content) || ""
|
||||
}, ...parsedAttributes}} defer />;
|
||||
})
|
||||
return (
|
||||
<Script
|
||||
src={parseValue(script.src)}
|
||||
id={`${appId}-${index}`}
|
||||
key={`${appId}-${index}`}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: parseValue(script.content) || "",
|
||||
}}
|
||||
{...parsedAttributes}
|
||||
defer
|
||||
/>
|
||||
);
|
||||
});
|
||||
})}
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -29,7 +29,7 @@ const InputOption: React.FC<OptionProps<any, boolean, GroupBase<any>>> = ({
|
|||
<components.Option
|
||||
className={classNames(
|
||||
className,
|
||||
"dark:bg-darkgray-100 text-[inherit] !flex !cursor-pointer !py-3",
|
||||
"dark:bg-darkgray-100 !flex !cursor-pointer !py-3 text-[inherit]",
|
||||
isFocused && "dark:!bg-darkgray-200 !bg-gray-100",
|
||||
isSelected && "dark:!bg-darkgray-300 !bg-neutral-900"
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue