-
-
Couldn't load subscription status.
- Fork 8
Feature/automatic builds project options #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
judah-sotomayor
wants to merge
19
commits into
sillsdev:develop
Choose a base branch
from
judah-sotomayor:feature/automatic-builds-project-options
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
363f1e5
feat(intl): Add auto-publish setting descriptions.
judah-sotomayor e7d2643
feat(projects): Generalize PublicPrivateToggle.
judah-sotomayor 1ad6e4e
fix(projects): Use name in settings toggles.
judah-sotomayor 81a4443
feat(projects): Add ToggleForm component.
judah-sotomayor 3091729
fix: Replace PublicPrivateToggle with Toggle.
judah-sotomayor f364bb3
feat(intl): Add notifs for auto toggles.
judah-sotomayor d931921
feat(server): Add routes for auto toggles.
judah-sotomayor 784c517
feat(projects): Add toggles for auto rebuild/publish.
judah-sotomayor 0359e0c
fix(server): Correct name of field in toggleRebuild.
judah-sotomayor 2dc2c6b
fix(Toggle): Restore className property.
judah-sotomayor 7d3a635
fix: Correct use of Toggle with on/off icons.
judah-sotomayor 7050257
fix: Pass canEdit through ToggleForm.
judah-sotomayor 1a7ff7c
fix(ToggleForm): Do not use ActionData.
judah-sotomayor e51d770
fix(Toggle): Replace onchange with inputAttr again.
judah-sotomayor ef08326
fix: Add auto build/publish settings to project sse.
judah-sotomayor d5eddad
Format code with eslint.
judah-sotomayor 711391a
fix: Allow className to actually do something.
judah-sotomayor 912a8fd
Add new authentication to auto-rebuild/publish toggles.
judah-sotomayor 4c53d98
feat: Dim toggles when they are disabled.
judah-sotomayor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <script lang="ts"> | ||
| import type { HTMLInputAttributes } from 'svelte/elements'; | ||
| import IconContainer from '../IconContainer.svelte'; | ||
| import Icon from '@iconify/svelte'; | ||
| import InputWithMessage from './InputWithMessage.svelte'; | ||
| import type { ValueKey } from '$lib/locales.svelte'; | ||
|
|
||
| interface Props { | ||
| title?: ValueKey; | ||
| message?: ValueKey; | ||
| name?: string; | ||
| checked: boolean; | ||
| canEdit?: boolean; | ||
| onIcon?: string; | ||
| offIcon?: string; | ||
| className?: string; | ||
| inputAttr?: HTMLInputAttributes; | ||
| } | ||
|
|
||
| let { | ||
| title, | ||
| message, | ||
| name, | ||
| checked = $bindable(), | ||
| canEdit = true, | ||
| onIcon = '', | ||
| offIcon = '', | ||
| className, | ||
| inputAttr | ||
| }: Props = $props(); | ||
| </script> | ||
|
|
||
| <InputWithMessage {title} {message} className="{className} {canEdit ? '' : 'cursor-not-allowed'} "> | ||
| <label | ||
| class="toggle {checked ? 'border-accent' : ''} text-base-content | ||
| {canEdit ? '' : 'cursor-not-allowed opacity-50 pointer-events-none'}" | ||
| > | ||
| <input | ||
| {name} | ||
| type="checkbox" | ||
| disabled={!canEdit} | ||
| bind:checked | ||
| {...inputAttr} | ||
| class="checked:bg-accent checked:border-accent rounded-full" | ||
| /> | ||
| <Icon icon={onIcon} width={20} height={20} /> | ||
| <Icon icon={offIcon} width={20} height={20} color="white" /> | ||
| </label> | ||
| </InputWithMessage> | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| <!-- | ||
| @component | ||
| An abstraction over Toggle which makes it easier to submit simple POSTs using a toggle. | ||
| --> | ||
| <script lang="ts"> | ||
| import { enhance } from '$app/forms'; | ||
| import Toggle from '$lib/components/settings/Toggle.svelte'; | ||
| import type { ValueKey } from '$lib/locales.svelte'; | ||
| import { m } from '$lib/paraglide/messages'; | ||
| import { toast } from '$lib/utils'; | ||
| type Method = 'POST' | 'GET'; | ||
|
|
||
| interface Props { | ||
| name: string; | ||
| method: Method; | ||
| action: string; | ||
| formVar: boolean; | ||
| onmsg: string; | ||
| offmsg: string; | ||
| onIcon?: string; | ||
| offIcon?: string; | ||
| title: ValueKey; | ||
| message: ValueKey; | ||
| canEdit?: boolean; | ||
| } | ||
|
|
||
| let { | ||
| name, | ||
| method, | ||
| action, | ||
| formVar, | ||
| onmsg, | ||
| offmsg, | ||
| title, | ||
| message, | ||
| onIcon, | ||
| offIcon, | ||
| canEdit | ||
| }: Props = $props(); | ||
|
|
||
| let form: HTMLFormElement; | ||
| </script> | ||
|
|
||
| <form | ||
| bind:this={form} | ||
| {method} | ||
| {action} | ||
| use:enhance={() => | ||
| ({ update, result }) => { | ||
| if (result.type === 'success') { | ||
| const res = result.data as { ok: boolean }; | ||
| if (res?.ok) { | ||
| if (formVar) { | ||
| toast('success', onmsg); | ||
| } else { | ||
| toast('success', offmsg); | ||
| } | ||
| } else { | ||
| toast('error', m.errors_generic({ errorMessage: '' })); | ||
| formVar = !formVar; | ||
| } | ||
| } | ||
| update({ reset: false }); | ||
| }} | ||
| > | ||
| <Toggle | ||
| {title} | ||
| {message} | ||
| {name} | ||
| bind:checked={formVar} | ||
| inputAttr={{ | ||
| onchange: () => { | ||
| form.requestSubmit(); | ||
| } | ||
| }} | ||
| {onIcon} | ||
| {offIcon} | ||
| {canEdit} | ||
| /> | ||
| </form> |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.