Skip to content

Commit

Permalink
skip unnecessary build steps in frontend pom.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
querwurzel committed Nov 24, 2023
1 parent 79d9f69 commit bde981a
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.github.binpastes.paste.api.model.SearchView.SearchItemView;
import com.github.binpastes.paste.api.model.SingleView;
import com.github.binpastes.paste.domain.Paste;
import com.github.binpastes.paste.domain.PasteService;
import com.github.binpastes.paste.application.PasteService;
import jakarta.validation.ConstraintViolationException;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.github.binpastes.paste.domain;
package com.github.binpastes.paste.application;

import com.github.binpastes.paste.business.tracking.TrackingService;
import com.github.binpastes.paste.application.tracking.TrackingService;
import com.github.binpastes.paste.domain.Paste;
import com.github.binpastes.paste.domain.PasteRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.binpastes.paste.business.tracking;
package com.github.binpastes.paste.application.tracking;

import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.ActiveMQObjectClosedException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.binpastes.paste.business.tracking;
package com.github.binpastes.paste.application.tracking;

import org.apache.activemq.artemis.api.core.QueueConfiguration;
import org.apache.activemq.artemis.api.core.RoutingType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.binpastes.paste.business.tracking;
package com.github.binpastes.paste.application.tracking;

import com.github.binpastes.paste.domain.PasteRepository;
import jakarta.annotation.PostConstruct;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#logging.level.io.r2dbc=TRACE
#logging.level.org.apache.activemq.artemis.core.server=INFO
#logging.level.org.flywaydb.core.internal.license.VersionPrinter=INFO
logging.level.com.github.binpastes.paste.business.tracking=DEBUG
logging.level.com.github.binpastes.paste.application.tracking=DEBUG

spring.flyway.enabled=true
spring.flyway.driver-class-name=org.h2.Driver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.binpastes.paste.api;

import com.github.binpastes.paste.domain.PasteService;
import com.github.binpastes.paste.application.PasteService;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.binpastes.paste.api;

import com.github.binpastes.paste.business.tracking.MessagingClient;
import com.github.binpastes.paste.business.tracking.TrackingService;
import com.github.binpastes.paste.application.tracking.MessagingClient;
import com.github.binpastes.paste.application.tracking.TrackingService;
import com.github.binpastes.paste.domain.Paste;
import com.github.binpastes.paste.domain.Paste.PasteExposure;
import com.github.binpastes.paste.domain.PasteRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ void trackPasteViewCount() {
@DisplayName("track paste - updates lastViewed timestamp to most recent one")
void trackPasteLastViewed() {
var newPaste = Paste.newInstance(null, "someContent", null, false, PasteExposure.PUBLIC, null);
var now = LocalDateTime.now();
var yesterday = now.minusDays(1);
var today = LocalDateTime.now();
var yesterday = today.minusDays(1);

newPaste.trackView(now);
newPaste.trackView(today);
newPaste.trackView(yesterday);

assertThat(newPaste.getLastViewed()).isEqualTo(now);
assertThat(newPaste.getLastViewed()).isEqualTo(today);
assertThat(newPaste.getViews()).isEqualTo(2);
}

Expand Down
54 changes: 31 additions & 23 deletions frontend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,28 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>dist</directory>
</resource>
</resources>
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
</configuration>
</execution>
<execution>
<id>default-resources</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<id>default-testResources</id>
<phase>none</phase>
</execution>
</executions>
Expand All @@ -83,21 +90,22 @@
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>dist</directory>
</resource>
</resources>
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
</configuration>
<id>default-test</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>default</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/RecentPastes/RecentPastes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ const RecentPastes: () => JSX.Element = () => {

const [pastes, { mutate, refetch }] = createResource(ApiClient.findAll);

let refetchSchedule;

onMount(() => {
startSchedule();

AppContext.onPasteCreated((paste) => {
restartSchedule();

const newItem: PasteListView = {
id: paste.id,
title: paste.title,
Expand All @@ -23,9 +27,7 @@ const RecentPastes: () => JSX.Element = () => {
isEncrypted: paste.isEncrypted,
sizeInBytes: paste.sizeInBytes
};

restartSchedule();
mutate(prev => [newItem].concat(prev))
mutate(prev => prev.concat([newItem]));
});

AppContext.onPasteDeleted((paste) => {
Expand All @@ -36,8 +38,6 @@ const RecentPastes: () => JSX.Element = () => {

onCleanup(() => stopSchedule());

let refetchSchedule;

function manualRefetch() {
restartSchedule();
refetch();
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
</distributionManagement>

<scm>
<connection>scm:git:https://github.com/querwurzel/binpastes.git</connection>
<developerConnection>scm:git:https://github.com/querwurzel/binpastes.git</developerConnection>
<connection>scm:git:https://github.com/querwurzel/BinPastes.git</connection>
<developerConnection>scm:git:https://github.com/querwurzel/BinPastes.git</developerConnection>
<tag>HEAD</tag>
</scm>

Expand Down

0 comments on commit bde981a

Please sign in to comment.