-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Refactor async command handling (#83)
- Rewrite the scheduler to avoid specific policies - Implements optimistic locking to make sure we don't lose data - Rewrite app and target cleanup to delete them as soon as everything is properly cleaned up
- Loading branch information
Showing
99 changed files
with
2,697 additions
and
2,056 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 11 additions & 5 deletions
16
...c/routes/(main)/jobs/cancel-button.svelte → ...utes/(main)/jobs/job-action-button.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
<script lang="ts"> | ||
import Button from '$components/button.svelte'; | ||
import Stack from '$components/stack.svelte'; | ||
import { submitter } from '$lib/form'; | ||
import service from '$lib/resources/jobs'; | ||
import Stack from '$components/stack.svelte'; | ||
import l from '$lib/localization'; | ||
export let id: string; | ||
export let page: number; | ||
export let page: number; // Page number, used to refresh the jobs list | ||
export let mode: 'dismiss' | 'retry'; | ||
const { submit, loading } = submitter( | ||
() => | ||
service.delete(id).then(() => | ||
service[mode](id).then(() => | ||
service.fetchAll(page, { | ||
cache: 'no-store' // Force the refresh of jobs list | ||
}) | ||
), | ||
{ | ||
confirmation: l.translate('jobs.cancel.confirm') | ||
confirmation: l.translate(`jobs.${mode}.confirm`) | ||
} | ||
); | ||
</script> | ||
|
||
<Stack direction="row" justify="flex-end"> | ||
<Button variant="danger" text="jobs.cancel" on:click={submit} loading={$loading} /> | ||
<Button | ||
variant={mode == 'dismiss' ? 'danger' : 'outlined'} | ||
text={`jobs.${mode}`} | ||
on:click={submit} | ||
loading={$loading} | ||
/> | ||
</Stack> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.