Skip to content

Commit

Permalink
Merge pull request #817 from traPtitech/dependabot/npm_and_yarn/dashb…
Browse files Browse the repository at this point in the history
…oard/dev-deps-3660fec8b3

⬆️ Bump the dev-deps group in /dashboard with 6 updates
  • Loading branch information
motoki317 authored Dec 8, 2023
2 parents fe372a2 + ffc8cbe commit f6bc6b2
Show file tree
Hide file tree
Showing 15 changed files with 177 additions and 158 deletions.
2 changes: 1 addition & 1 deletion dashboard/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"noUnusedImports": "error"
},
"style": {
"noNonNullAssertion": "warn"
"noNonNullAssertion": "warn"
}
}
},
Expand Down
12 changes: 6 additions & 6 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
},
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "1.3.3",
"@biomejs/biome": "1.4.1",
"@macaron-css/core": "1.2.0",
"@macaron-css/solid": "1.4.1",
"@macaron-css/vite": "1.4.3",
"@tanstack/virtual-core": "3.0.1",
"@types/node": "20.9.4",
"rollup-plugin-visualizer": "5.9.3",
"typescript": "5.3.2",
"@types/node": "20.10.4",
"rollup-plugin-visualizer": "5.10.0",
"typescript": "5.3.3",
"unplugin-fonts": "1.1.1",
"vite": "5.0.2",
"vite": "5.0.6",
"vite-plugin-compression": "0.5.1",
"vite-plugin-solid": "2.7.2",
"vite-plugin-solid": "2.8.0",
"vite-plugin-solid-svg": "0.7.0"
},
"dependencies": {
Expand Down
12 changes: 3 additions & 9 deletions dashboard/src/components/UI/RadioIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,10 @@ export interface Props {

export const RadioIcon: Component<Props> = (props) => {
return (
<Container checked={props.selected} disabled={props.disabled}>
<Container checked={props.selected} disabled={props.disabled} role="img">
<Show when={props.selected}>
<svg
width="20"
height="20"
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="presentation"
>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<title>Radio Icon</title>
<circle cx="10" cy="10" r="4" fill="currentColor" />
</svg>
</Show>
Expand Down
14 changes: 6 additions & 8 deletions dashboard/src/components/templates/OwnerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ const AddOwners: Component<{
const filteredUsers = createMemo(() => {
if (searchUserQuery() === '') {
return props.nonOwners
} else {
return fuse()
.search(searchUserQuery())
.map((result) => result.item)
}
return fuse()
.search(searchUserQuery())
.map((result) => result.item)
})

return (
Expand Down Expand Up @@ -188,11 +187,10 @@ const OwnerList: Component<{
const filteredOwners = createMemo(() => {
if (searchUserQuery() === '') {
return props.owners
} else {
return fuse()
.search(searchUserQuery())
.map((result) => result.item)
}
return fuse()
.search(searchUserQuery())
.map((result) => result.item)
})

const nonOwners = createMemo(() => props.users.filter((u) => !props.owners.some((o) => o.id === u.id)))
Expand Down
11 changes: 5 additions & 6 deletions dashboard/src/components/templates/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export type SingleSelectProps<T extends string | number> = SelectProps<T> & {
setValue?: (v: T) => void
}

export const SingleSelect = <T extends string | number,>(props: SingleSelectProps<T>): JSX.Element => {
export const SingleSelect = <T extends string | number>(props: SingleSelectProps<T>): JSX.Element => {
const [rootProps, selectProps] = splitProps(
props,
['name', 'placeholder', 'options', 'required', 'disabled', 'readOnly'],
Expand Down Expand Up @@ -228,7 +228,7 @@ export type MultiSelectProps<T extends string | number> = SelectProps<T> & {
setValue?: (v: T[]) => void
}

export const MultiSelect = <T extends string | number,>(props: MultiSelectProps<T>): JSX.Element => {
export const MultiSelect = <T extends string | number>(props: MultiSelectProps<T>): JSX.Element => {
const [rootProps, selectProps] = splitProps(
props,
['name', 'placeholder', 'options', 'required', 'disabled', 'readOnly'],
Expand Down Expand Up @@ -349,7 +349,7 @@ export type ComboBoxProps<T extends string | number> = SelectProps<T> & {
setValue?: (v: T) => void
}

export const ComboBox = <T extends string | number,>(props: SingleSelectProps<T>): JSX.Element => {
export const ComboBox = <T extends string | number>(props: SingleSelectProps<T>): JSX.Element => {
const [rootProps, selectProps] = splitProps(
props,
['name', 'placeholder', 'options', 'required', 'disabled', 'readOnly'],
Expand All @@ -362,10 +362,9 @@ export const ComboBox = <T extends string | number,>(props: SingleSelectProps<T>
if (find) {
props.setValue?.(find.value)
return find
} else {
props.setValue?.(prev.value)
return prev
}
props.setValue?.(prev.value)
return prev
},
{ label: props.value?.toString() ?? '', value: props.value ?? ('' as T) },
)
Expand Down
3 changes: 1 addition & 2 deletions dashboard/src/libs/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ export const deploymentState = (app: Application): ApplicationState => {
case Application_ContainerState.UNKNOWN:
return ApplicationState.Error
}
} else {
return ApplicationState.Serving
}
return ApplicationState.Serving
}

const errorCommit = '0'.repeat(40)
Expand Down
3 changes: 1 addition & 2 deletions dashboard/src/libs/branchesSuggestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ export const useBranchesSuggestion = (repoID: () => string, current: () => strin
const normal = branches?.filter((b) => !b.includes('/'))
const long = branches?.filter((b) => b.includes('/'))
return [normal, long]
} else {
return [[], []]
}
return [[], []]
})
const branchesFuse = createMemo(() => {
const [normal, long] = branches()
Expand Down
23 changes: 11 additions & 12 deletions dashboard/src/libs/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ const copyTextToClipboard = async (text: string): Promise<void> => {
if (navigator.clipboard) {
// Use Clipboard API when available
return navigator.clipboard.writeText(text)
} else {
const textArea = document.createElement('textarea')
textArea.value = text
}
const textArea = document.createElement('textarea')
textArea.value = text

// Avoid scrolling
textArea.style.position = 'fixed'
textArea.style.top = '0'
// Avoid scrolling
textArea.style.position = 'fixed'
textArea.style.top = '0'

document.body.appendChild(textArea)
textArea.focus()
textArea.select()
document.execCommand('copy')
document.body.removeChild(textArea)
}
document.body.appendChild(textArea)
textArea.focus()
textArea.select()
document.execCommand('copy')
document.body.removeChild(textArea)
}

export const writeToClipboard = (text: string): Promise<void> =>
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/libs/localStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createStore } from 'solid-js/store'

// https://www.solidjs.com/examples/todos

export const createLocalSignal = <T,>(name: string, init: T): ReturnType<typeof createSignal<T>> => {
export const createLocalSignal = <T>(name: string, init: T): ReturnType<typeof createSignal<T>> => {
const localState = localStorage.getItem(name)
const [state, setState] = createSignal<T>(localState ? JSON.parse(localState) : init)
createEffect(() => localStorage.setItem(name, JSON.stringify(state())))
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/libs/random.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const randIntN = (max: number): number => Math.floor(Math.random() * max)
export const pickRandom = <T,>(arr: T[]): T => arr[randIntN(arr.length)]
export const pickRandom = <T>(arr: T[]): T => arr[randIntN(arr.length)]
2 changes: 1 addition & 1 deletion dashboard/src/libs/unique.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const unique = <T,>(arr: T[]): T[] => Array.from(new Set(arr))
export const unique = <T>(arr: T[]): T[] => Array.from(new Set(arr))
3 changes: 1 addition & 2 deletions dashboard/src/pages/apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ const compareRepoWithApp =
if (a.apps.length > 0 && b.apps.length > 0) {
if (sort === 'asc') {
return newestAppDate(a.apps) - newestAppDate(b.apps)
} else {
return newestAppDate(b.apps) - newestAppDate(a.apps)
}
return newestAppDate(b.apps) - newestAppDate(a.apps)
}
// Bring up repositories with 1 or more apps at top
if ((a.apps.length > 0 && b.apps.length === 0) || (a.apps.length === 0 && b.apps.length > 0)) {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/pages/apps/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ const formStep = {
general: 1,
website: 2,
} as const
type FormStep = typeof formStep[keyof typeof formStep]
type FormStep = (typeof formStep)[keyof typeof formStep]

export default () => {
const [searchParams, setParam] = useSearchParams()
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/pages/repos/[id]/settings/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ const DeleteRepository: Component<{
content: !props.hasPermission
? 'リポジトリを削除するにはオーナーになる必要があります'
: !canDeleteRepository()
? 'リポジトリ内にアプリケーションが存在するため削除できません'
: undefined,
? 'リポジトリ内にアプリケーションが存在するため削除できません'
: undefined,
},
}}
>
Expand Down
Loading

0 comments on commit f6bc6b2

Please sign in to comment.