File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed
apps/desktop/src/components Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
+ import { projectRunCommitHooks } from ' $lib/config/config' ;
2
3
import { Project } from ' $lib/project/project' ;
3
4
import { ProjectsService } from ' $lib/project/projectsService' ;
4
5
import { getContext } from ' @gitbutler/shared/context' ;
5
6
import SectionCard from ' @gitbutler/ui/SectionCard.svelte' ;
6
7
import Spacer from ' @gitbutler/ui/Spacer.svelte' ;
7
8
import Textarea from ' @gitbutler/ui/Textarea.svelte' ;
8
9
import Textbox from ' @gitbutler/ui/Textbox.svelte' ;
10
+ import Toggle from ' @gitbutler/ui/Toggle.svelte' ;
9
11
10
12
const project = getContext (Project );
11
13
const projectsService = getContext (ProjectsService );
12
14
15
+ const runCommitHooks = $derived (projectRunCommitHooks (project .id ));
16
+
13
17
let title = $state (project ?.title );
14
18
let description = $state (project ?.description );
15
19
</script >
49
53
50
54
<Spacer />
51
55
56
+ <SectionCard labelFor =" runHooks" orientation =" row" >
57
+ {#snippet title ()}
58
+ Run commit hooks
59
+ {/ snippet }
60
+ {#snippet caption ()}
61
+ Enabling this will run any git pre and post commit hooks you have configured in your repository.
62
+ {/ snippet }
63
+ {#snippet actions ()}
64
+ <Toggle id ="runHooks" bind:checked ={$runCommitHooks } />
65
+ {/ snippet }
66
+ </SectionCard >
67
+
68
+ <Spacer />
69
+
52
70
<style >
53
71
.fields-wrapper {
54
72
display : flex ;
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import Section from ' $components/Section.svelte' ;
3
- import { projectRunCommitHooks } from ' $lib/config/config' ;
4
3
import { Project } from ' $lib/project/project' ;
5
4
import { ProjectsService } from ' $lib/project/projectsService' ;
6
5
import { getContext } from ' @gitbutler/shared/context' ;
14
13
let snaphotLinesThreshold = project ?.snapshot_lines_threshold || 20 ; // when undefined, the default is 20
15
14
let omitCertificateCheck = project ?.omit_certificate_check ;
16
15
17
- const runCommitHooks = projectRunCommitHooks (project .id );
18
-
19
16
async function setOmitCertificateCheck(value : boolean | undefined ) {
20
17
project .omit_certificate_check = !! value ;
21
18
await projectsService .updateProject (project );
48
45
{/ snippet }
49
46
</SectionCard >
50
47
51
- <SectionCard labelFor =" runHooks" orientation =" row" >
52
- {#snippet title ()}
53
- Run commit hooks
54
- {/ snippet }
55
- {#snippet caption ()}
56
- Enabling this will run any git pre and post commit hooks you have configured in your
57
- repository.
58
- {/ snippet }
59
- {#snippet actions ()}
60
- <Toggle id ="runHooks" bind:checked ={$runCommitHooks } />
61
- {/ snippet }
62
- </SectionCard >
63
-
64
48
<SectionCard orientation =" row" centerAlign >
65
49
{#snippet title ()}
66
50
Snapshot lines threshold
You can’t perform that action at this time.
0 commit comments