gitbutler/gitbutler-ui/src/lib/config/config.ts

66 lines
2.1 KiB
TypeScript
Raw Normal View History

import { persisted, type Persisted } from '$lib/persisted/persisted';
export function projectHttpsWarningBannerDismissed(projectId: string): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectHttpsWarningBannerDismissed_';
return persisted(false, key + projectId);
}
export function projectMergeUpstreamWarningDismissed(projectId: string): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectMergeUpstreamWarningDismissed_';
return persisted(false, key + projectId);
}
export function projectCommitGenerationExtraConcise(projectId: string): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectCommitGenerationExtraConcise_';
return persisted(false, key + projectId);
}
export function projectCommitGenerationUseEmojis(projectId: string): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectCommitGenerationUseEmojis_';
return persisted(false, key + projectId);
}
export enum ListPRsFilter {
2024-02-27 02:24:07 +03:00
All = 'ALL',
ExcludeBots = 'EXCLUDE_BOTS',
OnlyYours = 'ONLY_YOURS'
}
export function projectPullRequestListingFilter(projectId: string): Persisted<string> {
2024-02-27 02:24:07 +03:00
const key = 'projectPullRequestListingFilter_';
return persisted(ListPRsFilter.All, key + projectId);
}
export function projectAiGenEnabled(projectId: string): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectAiGenEnabled_';
return persisted(false, key + projectId);
}
export function projectAiGenAutoBranchNamingEnabled(projectId: string): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectAiGenAutoBranchNamingEnabled_';
return persisted(false, key + projectId);
}
export function projectRunCommitHooks(projectId: string): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectRunCommitHooks_';
return persisted(false, key + projectId);
}
export function projectLaneCollapsed(projectId: string, laneId: string): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectLaneCollapsed_';
return persisted(false, key + projectId + '_' + laneId);
}
export function navCollapsed(): Persisted<boolean> {
2024-02-27 02:24:07 +03:00
const key = 'projectNavCollapsed_';
return persisted(false, key);
}
export function projectCurrentCommitMessage(
2024-02-27 02:24:07 +03:00
projectId: string,
branchId: string
): Persisted<string> {
2024-02-27 02:24:07 +03:00
const key = 'projectCurrentCommitMessage_';
return persisted('', key + projectId + '_' + branchId);
}