Skip to content

Commit

Permalink
Merge branch 'ke/search-url-delay' of https://github.com/kitspace/kit…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitspace Auto-Merge Bot committed Sep 23, 2024
2 parents 31a2e9c + 2799f46 commit 6ebb940
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
4 changes: 3 additions & 1 deletion e2e/cypress/e2e/multiProject.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe('Multi project page', () => {
})
})

it('should render the details from multi project in kitspace.yaml', () => {
it.only('should render the details from multi project in kitspace.yaml', () => {
const user = getFakeUser()

// Migrate the multiproject repo
Expand All @@ -189,6 +189,8 @@ describe('Multi project page', () => {
// Search for the project
cy.get('[data-cy=search-field] > input').type(user.username)

cy.wait(1000)

// Click on a multiproject project card
cy.get('[data-cy=project-card]')
.first()
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/components/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ const SearchInput = () => {
}, [routerQuery])

const debouncedSubmit = useRef(debounce(value => updateContextQuery(value), 100))
const debouncedUpdateUrl = useRef(
debounce(value => {
const path = value ? `/search?q=${encodeURIComponent(value)}` : '/'
replace(path, undefined, { shallow: true })
}, 1000),
)

const handleChange = (value: string) => {
debouncedSubmit.current.cancel()
debouncedUpdateUrl.current.cancel()
setInputQuery(value)
debouncedSubmit.current(value)
const path = value ? `/search?q=${encodeURIComponent(value)}` : '/'
replace(path, undefined, { shallow: true })
debouncedUpdateUrl.current(value)
}

return (
Expand Down
2 changes: 2 additions & 0 deletions processor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ RUN addgroup --gid 1000 node && \
mkdir /data /gitea-data && \
chown -R node /data /gitea-data

RUN git config --global --add safe.directory '*'

USER node
CMD ["node", "dist/src/main.js"]
1 change: 1 addition & 0 deletions processor/src/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ async function sync(gitDir, checkoutDir) {
try {
await sh`git clone ${gitDir} ${checkoutDir}`
} catch (err) {
log.error(err)
if (err.stderr) {
return
}
Expand Down
6 changes: 4 additions & 2 deletions scripts/importBoardsTxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ async function generateGiteaAdminToken() {
)

if (!giteaAdminCommand.status.success) {
throw new Error('Failed to create gitea admin user')
console.error(giteaAdminCommand.output)
throw new Error("Failed to create gitea admin user")
}

const giteaAdminTokenCommand = await exec(
Expand All @@ -308,7 +309,8 @@ async function generateGiteaAdminToken() {
)

if (!giteaAdminTokenCommand.status.success) {
throw new Error('Failed to create gitea admin token')
console.error(giteaAdminTokenCommand.output)
throw new Error("Failed to create gitea admin token")
}

return giteaAdminTokenCommand.output.split('\n').at(-1)
Expand Down

0 comments on commit 6ebb940

Please sign in to comment.