diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e21e9fb..0353c8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,20 +38,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - mvn deploy -DskipTests -Drevision=1.0.${{ github.run_number }} -Denv=mysql + mvn versions:set -DnewVersion=1.0.${{ github.run_number }} + mvn deploy -DskipTests -Denv=mysql - - uses: actions/delete-package-versions@v4 - with: - package-name: 'com.github.binpastes.app' - package-type: 'maven' - min-versions-to-keep: 10 - - uses: actions/delete-package-versions@v4 - with: - package-name: 'com.github.binpastes.frontend' - package-type: 'maven' - min-versions-to-keep: 10 - uses: actions/delete-package-versions@v4 with: package-name: 'com.github.binpastes.backend' package-type: 'maven' - min-versions-to-keep: 10 + min-versions-to-keep: 3 diff --git a/backend/pom.xml b/backend/pom.xml index f4a6dc1..62d39e4 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -7,7 +7,7 @@ com.github.binpastes app - ${revision} + 0.0.1-SNAPSHOT ../pom.xml @@ -17,7 +17,6 @@ com.github.binpastes frontend - ${revision} @@ -102,6 +101,13 @@ + + org.apache.maven.plugins + maven-deploy-plugin + + false + + diff --git a/frontend/pom.xml b/frontend/pom.xml index 3a53426..b197b1f 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -2,72 +2,96 @@ - 4.0.0 + 4.0.0 - - com.github.binpastes - app - ${revision} - ../pom.xml - + + com.github.binpastes + app + 0.0.1-SNAPSHOT + ../pom.xml + - frontend + frontend - - - - com.github.eirslett - frontend-maven-plugin - - v18.16.1 - - - - install node and npm - - install-node-and-npm - - - - pnpm install - - npx - - - pnpm install - - - - pnpm build - - npx - - - pnpm run build - - - - - - maven-resources-plugin - - - generate-resources - - resources - - - - - dist - - - ${project.build.outputDirectory}/static - - - - - - + + + + com.github.eirslett + frontend-maven-plugin + + v18.18.2 + + + + install node and npm + + install-node-and-npm + + + + pnpm install + + npx + + + pnpm install + + + + pnpm build + + npx + + + pnpm run build + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + default-test + none + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + default-compile + none + + + default-testCompile + none + + + + + maven-resources-plugin + + + generate-resources + + resources + + + + + dist + + + ${project.build.outputDirectory}/static + + + + + + diff --git a/frontend/src/components/CreatePaste/CreatePaste.tsx b/frontend/src/components/CreatePaste/CreatePaste.tsx index aa4bc71..d1d86af 100644 --- a/frontend/src/components/CreatePaste/CreatePaste.tsx +++ b/frontend/src/components/CreatePaste/CreatePaste.tsx @@ -29,7 +29,7 @@ const CreatePaste: Component = ({onCreatePaste, initialPaste}) exposure: null }); - const [lastPaste, setLastPaste] = createSignal(null); + const [lastPaste, setLastPaste] = createSignal(); let creationForm: HTMLFormElement @@ -46,6 +46,7 @@ const CreatePaste: Component = ({onCreatePaste, initialPaste}) } const resetStore = () => { + setLastPaste(null); setForm({ title: null, password: null, @@ -56,6 +57,8 @@ const CreatePaste: Component = ({onCreatePaste, initialPaste}) } const submitCreateForm = (e: Event) => { + e.preventDefault(); + const data: PasteCreateCmd = { title: form.title, content: form.content, @@ -70,12 +73,10 @@ const CreatePaste: Component = ({onCreatePaste, initialPaste}) onCreatePaste(data) .then(url => { - setLastPaste(url); resetCreateForm(); resetStore(); + setLastPaste(url); }) - - e.preventDefault(); } return ( @@ -85,7 +86,7 @@ const CreatePaste: Component = ({onCreatePaste, initialPaste}) Public diff --git a/frontend/src/components/ReadPaste/ReadPaste.tsx b/frontend/src/components/ReadPaste/ReadPaste.tsx index bd75f22..b912aaa 100644 --- a/frontend/src/components/ReadPaste/ReadPaste.tsx +++ b/frontend/src/components/ReadPaste/ReadPaste.tsx @@ -14,7 +14,7 @@ interface ReadPasteProps { const ReadPaste: Component = ({paste, onClonePaste, onDeletePaste}): JSX.Element => { - const [clearText, setClearText] = createSignal(null); + const [clearText, setClearText] = createSignal(); let keyInput: HTMLInputElement; let content: HTMLPreElement; diff --git a/frontend/src/components/RecentPastes/RecentPastes.tsx b/frontend/src/components/RecentPastes/RecentPastes.tsx index 2235cbb..b191b74 100644 --- a/frontend/src/components/RecentPastes/RecentPastes.tsx +++ b/frontend/src/components/RecentPastes/RecentPastes.tsx @@ -13,19 +13,19 @@ const RecentPastes: () => JSX.Element = () => { const appContext = AppContext; - let refreshTimer; + let refetchSchedule; - function refresh() { + function manualRefetch() { restartSchedule(); refetch(); } function startSchedule() { - refreshTimer = window.setInterval(refetch, 60_000); + refetchSchedule = window.setInterval(refetch, 60_000); } function stopSchedule() { - window.clearInterval(refreshTimer); + window.clearInterval(refetchSchedule); } function restartSchedule() { @@ -51,8 +51,8 @@ const RecentPastes: () => JSX.Element = () => { }); appContext.onPasteDeleted((paste) => { - mutate(prev => prev.filter(item => item.id !== paste.id)); restartSchedule(); + mutate(prev => prev.filter(item => item.id !== paste.id)); }); }) @@ -73,7 +73,7 @@ const RecentPastes: () => JSX.Element = () => {   - +
    diff --git a/frontend/src/components/RecentPastes/recentPastes.module.css b/frontend/src/components/RecentPastes/recentPastes.module.css index d3e7926..5a955e7 100644 --- a/frontend/src/components/RecentPastes/recentPastes.module.css +++ b/frontend/src/components/RecentPastes/recentPastes.module.css @@ -35,12 +35,12 @@ gap: 3px; } -.refresh { +.refetch { cursor: pointer; color: var(--color-link); } -.refresh:active { +.refetch:active { filter: brightness(var(--hover-brightness)); } diff --git a/frontend/src/components/SearchPastes/SearchPastes.tsx b/frontend/src/components/SearchPastes/SearchPastes.tsx index c77db08..7bd6f0c 100644 --- a/frontend/src/components/SearchPastes/SearchPastes.tsx +++ b/frontend/src/components/SearchPastes/SearchPastes.tsx @@ -4,7 +4,7 @@ import {PasteListView} from '../../api/model/PasteListView'; const SearchPastes: () => JSX.Element = () => { - const [search, setSearch] = createSignal(null); + const [search, setSearch] = createSignal(); const [results, { refetch }] = createResource(() => search(), () => searchTerm()); diff --git a/pom.xml b/pom.xml index fdddde7..9560f0c 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ com.github.binpastes app - ${revision} + 0.0.1-SNAPSHOT pom BinPastes @@ -31,7 +31,6 @@ UTF-8 - 1.0.0-SNAPSHOT 17 @@ -91,6 +90,13 @@ UTF-8 + + org.apache.maven.plugins + maven-deploy-plugin + + true + +