Skip to content

Commit

Permalink
Add tooltip explaining entrypoint disable state
Browse files Browse the repository at this point in the history
  • Loading branch information
dotNomad committed Dec 21, 2024
1 parent fd50eeb commit 23230eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const listStyle = computed((): "emphasized" | "default" | "deemphasized" => {
const tooltip = computed((): string => {
return isIncluded.value
? includedFileTooltip(props.file)
? includedFileTooltip(props.file, isEntrypoint.value)
: excludedFileTooltip(props.file);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ import { ContentRecordFile, FileMatchSource } from "../../../../../../src/api";

export function includedFileTooltip(
file: Pick<ContentRecordFile, "rel" | "reason">,
isEntrypoint: boolean = false,
) {
let tooltip = `${file.rel} will be included in the next deployment.`;
if (file.reason) {
tooltip += `\nThe configuration file ${file.reason?.fileName} is including it with the pattern '${file.reason?.pattern}'`;
}
if (isEntrypoint) {
tooltip += `\n${file.rel} is the entrypoint. Entrypoints must be included in the configuration 'files' list.`;
}
return tooltip;
}

Expand Down

0 comments on commit 23230eb

Please sign in to comment.