diff --git a/.github/workflows/gradle-deploy-develop.yml b/.github/workflows/gradle-deploy-develop.yml index 6dd02156f8..2a17c12cbf 100644 --- a/.github/workflows/gradle-deploy-develop.yml +++ b/.github/workflows/gradle-deploy-develop.yml @@ -7,7 +7,7 @@ env: PROJECT_ID: ${{ secrets.RUN_PROJECT }} RUN_REGION: us-central1 SERVICE_NAME: checkins-develop - TARGET_URL: https://checkins-develop-tuvcfzotpq-uc.a.run.app + TARGET_URL: https://checkins-develop-832140020593.us-central1.run.app jobs: test: runs-on: ubuntu-latest diff --git a/server/build.gradle b/server/build.gradle index 8c70f18a6f..634e67ba74 100755 --- a/server/build.gradle +++ b/server/build.gradle @@ -7,7 +7,7 @@ plugins { id "jacoco" } -version "0.8.10" +version "0.8.11" group "com.objectcomputing.checkins" repositories { diff --git a/server/src/main/resources/META-INF/native-image/com.objectcomputing/checkins/reflect-config.json b/server/src/main/resources/META-INF/native-image/com.objectcomputing/checkins/reflect-config.json index c7ac5c8c37..b366e7e3dd 100644 --- a/server/src/main/resources/META-INF/native-image/com.objectcomputing/checkins/reflect-config.json +++ b/server/src/main/resources/META-INF/native-image/com.objectcomputing/checkins/reflect-config.json @@ -51,5 +51,200 @@ ] } ] + }, + { + "name": "org.flywaydb.core.api.migration.baseline.BaselineMigrationConfigurationExtension", + "condition": { + "typeReachable": "org.flywaydb.core.api.configuration.ClassicConfiguration" + }, + "allDeclaredFields": true + }, + { + "name": "org.flywaydb.core.api.migration.baseline.BaselineMigrationConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "getBaselineMigrationPrefix", + "parameterTypes": [ + ] + }, + { + "name": "setBaselineMigrationPrefix", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "org.flywaydb.core.extensibility.ConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + } + }, + { + "name": "org.flywaydb.core.extensibility.Plugin", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + } + }, + { + "name": "org.flywaydb.core.internal.command.clean.CleanModeConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "getClean", + "parameterTypes": [ + ] + }, + { + "name": "setClean", + "parameterTypes": [ + "org.flywaydb.core.internal.command.clean.CleanModel" + ] + } + ] + }, + { + "name": "org.flywaydb.core.internal.command.clean.CleanModel", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "org.flywaydb.core.internal.command.clean.SchemaModel", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "org.flywaydb.core.internal.configuration.extensions.DeployScriptFilenameConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "getScriptFilename", + "parameterTypes": [ + ] + }, + { + "name": "setScriptFilename", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "org.flywaydb.core.internal.configuration.extensions.PrepareScriptFilenameConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "getScriptFilename", + "parameterTypes": [ + ] + }, + { + "name": "setScriptFilename", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "org.flywaydb.core.internal.proprietaryStubs.LicensingConfigurationExtensionStub", + "condition": { + "typeReachable": "org.flywaydb.core.api.configuration.ClassicConfiguration" + }, + "allDeclaredFields": true + }, + { + "name": "org.flywaydb.core.internal.proprietaryStubs.PATTokenConfigurationExtensionStub", + "condition": { + "typeReachable": "org.flywaydb.core.api.configuration.ClassicConfiguration" + }, + "allDeclaredFields": true + }, + { + "name": "org.flywaydb.core.internal.publishing.PublishingConfigurationExtension", + "condition": { + "typeReachable": "org.flywaydb.core.api.configuration.ClassicConfiguration" + }, + "allDeclaredFields": true + }, + { + "name": "org.flywaydb.core.internal.publishing.PublishingConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "isPublishResult", + "parameterTypes": [ + ] + }, + { + "name": "setPublishResult", + "parameterTypes": [ + "boolean" + ] + } + ] } ] \ No newline at end of file diff --git a/server/src/main/resources/db/dev/R__Load_testing_data.sql b/server/src/main/resources/db/dev/R__Load_testing_data.sql index 4693bf5fd1..8c0ada2f68 100644 --- a/server/src/main/resources/db/dev/R__Load_testing_data.sql +++ b/server/src/main/resources/db/dev/R__Load_testing_data.sql @@ -1699,9 +1699,19 @@ VALUES ('d27b679c-3aa8-4c4d-b08e-4eda63cea23f', '105f2968-a182-45a3-892c-eeff76383fe0', '06c03df3-85fe-4fc3-979e-9f1f6ba74a03', '5', '2022-08-01'); INSERT INTO kudos -(id, message, senderid, teamid, datecreated, dateapproved) +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) VALUES -('39dfd281-d0af-4016-848b-8156dfef2b92', PGP_SYM_ENCRYPT('Kudos to Revolver Ocelot!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2022-10-01', '2022-10-02'); +('39dfd281-d0af-4016-848b-8156dfef2b93', PGP_SYM_ENCRYPT('Kudos to Revolver Ocelot!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2023-12-01', '2023-12-02', true); + +INSERT INTO kudos_recipient +(id, kudosid, memberid) +VALUES +('ebc023e1-b577-4b02-a2fb-fc9472a8474b', '39dfd281-d0af-4016-848b-8156dfef2b93', '105f2968-a182-45a3-892c-eeff76383fe0'); + +INSERT INTO kudos +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) +VALUES +('39dfd281-d0af-4016-848b-8156dfef2b92', PGP_SYM_ENCRYPT('Kudos to Revolver Ocelot!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2022-10-01', null, true); INSERT INTO kudos_recipient (id, kudosid, memberid) @@ -1709,9 +1719,9 @@ VALUES ('ebc023e1-b577-4b02-a2fb-fc9472a8474a', '39dfd281-d0af-4016-848b-8156dfef2b92', '105f2968-a182-45a3-892c-eeff76383fe0'); INSERT INTO kudos -(id, message, senderid, teamid, datecreated, dateapproved) +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) VALUES -('fbcde196-7703-4f80-ac5e-5ac60b28555e', PGP_SYM_ENCRYPT('Kudos to Huey and Awesome!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2022-10-01', null); +('fbcde196-7703-4f80-ac5e-5ac60b28555e', PGP_SYM_ENCRYPT('Kudos to Huey and Awesome!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-10-21', '2024-10-21', true); INSERT INTO kudos_recipient (id, kudosid, memberid) @@ -1724,9 +1734,9 @@ VALUES ('bf37c244-f478-42b2-9077-dd4cb052bbb1', 'fbcde196-7703-4f80-ac5e-5ac60b28555e', '67dc3a3b-5bfa-4759-997a-fb6bac98dcf3'); INSERT INTO kudos -(id, message, senderid, teamid, datecreated, dateapproved) +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) VALUES -('df2766f0-efab-4925-859e-d993e2e38eaa', PGP_SYM_ENCRYPT('Kudos to the Checkins Experts team!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', 'a8733740-cf4c-4c16-a8cf-4f928c409acc', '2022-09-28', '2022-09-29'); +('df2766f0-efab-4925-859e-d993e2e38eaa', PGP_SYM_ENCRYPT('Kudos to the Checkins Experts team!', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', 'a8733740-cf4c-4c16-a8cf-4f928c409acc', '2024-09-28', '2024-09-29', true); INSERT INTO kudos_recipient (id, kudosid, memberid) @@ -1744,9 +1754,9 @@ VALUES ('0ca86d55-cffb-4b84-883c-c4c2e41eff73', 'df2766f0-efab-4925-859e-d993e2e38eaa', '67dc3a3b-5bfa-4759-997a-fb6bac98dcf3'); INSERT INTO kudos -(id, message, senderid, teamid, datecreated, dateapproved) +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) VALUES -('17e19f16-d731-4242-a74a-43493a556f08', PGP_SYM_ENCRYPT('Kudos to Michael Kimberlin!', '${aeskey}'), 'a90be358-aa3d-49c8-945a-879a93646e45', null, '2022-08-15', '2022-08-25'); +('17e19f16-d731-4242-a74a-43493a556f08', PGP_SYM_ENCRYPT('Kudos to Mischievous Kangaroo!', '${aeskey}'), 'a90be358-aa3d-49c8-945a-879a93646e45', null, '2024-11-01', null, true); INSERT INTO kudos_recipient (id, kudosid, memberid) @@ -1754,9 +1764,9 @@ VALUES ('038485ee-8cac-416b-9da6-d838ee345d0e', '17e19f16-d731-4242-a74a-43493a556f08', 'e4b2fe52-1915-4544-83c5-21b8f871f6db'); INSERT INTO kudos -(id, message, senderid, teamid, datecreated, dateapproved) +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) VALUES -('6612b8a0-1d45-4155-b0fb-e0b2d9eaafcb', PGP_SYM_ENCRYPT('Wanted to give some kudos to Mischievous Kangaroo and Revolver Ocelot for their recent help on the project. Thank you very much!', '${aeskey}'), '1b4f99da-ef70-4a76-9b37-8bb783b749ad', null, '2022-10-05', null); +('6612b8a0-1d45-4155-b0fb-e0b2d9eaafcb', PGP_SYM_ENCRYPT('Wanted to give some kudos to Mischievous Kangaroo and Revolver Ocelot for their recent help on the project. Thank you very much!', '${aeskey}'), '1b4f99da-ef70-4a76-9b37-8bb783b749ad', null, '2024-10-29', '2024-10-29', true); INSERT INTO kudos_recipient (id, kudosid, memberid) @@ -1769,9 +1779,9 @@ VALUES ('01f639d5-b7b3-47a2-b165-d7a20d01fec2', '6612b8a0-1d45-4155-b0fb-e0b2d9eaafcb', '105f2968-a182-45a3-892c-eeff76383fe0'); INSERT INTO kudos -(id, message, senderid, teamid, datecreated, dateapproved) +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) VALUES -('9cdce399-4c02-41ed-a63f-35beb6ecb622', PGP_SYM_ENCRYPT('A huge thank you to the Javascript Gurus team for offering their advice on the tech stack for the new project. Kudos to you all!', '${aeskey}'), '8d75c07e-6adc-437a-8659-7dd953ce6600', 'e8f052a8-40b5-4fb4-9bab-8b16ed36adc7', '2022-10-10', '2022-10-11'); +('9cdce399-4c02-41ed-a63f-35beb6ecb622', PGP_SYM_ENCRYPT('A huge thank you to the Javascript Gurus team for offering their advice on the tech stack for the new project. Kudos to you all!', '${aeskey}'), '8d75c07e-6adc-437a-8659-7dd953ce6600', 'e8f052a8-40b5-4fb4-9bab-8b16ed36adc7', '2022-10-10', '2022-10-11', true); INSERT INTO kudos_recipient (id, kudosid, memberid) @@ -1789,9 +1799,9 @@ VALUES ('f792056b-22ce-4e3d-a442-0fdc3cb35e7b', '9cdce399-4c02-41ed-a63f-35beb6ecb622', '105f2968-a182-45a3-892c-eeff76383fe0'); INSERT INTO kudos -(id, message, senderid, teamid, datecreated, dateapproved) +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) VALUES -('39dfd284-d0bf-4017-848c-8156dfef2b93', PGP_SYM_ENCRYPT('Kudos are tasty.', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-09-04', '2022-09-04'); +('39dfd284-d0bf-4017-848c-8156dfef2b93', PGP_SYM_ENCRYPT('Kudos are tasty.', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-11-10', '2024-11-10', true); INSERT INTO kudos_recipient (id, kudosid, memberid) @@ -1799,9 +1809,9 @@ VALUES ('ebc023e2-b578-4b03-a2fc-fc9472a8474b', '39dfd284-d0bf-4017-848c-8156dfef2b93', 'c7406157-a38f-4d48-aaed-04018d846727'); INSERT INTO kudos -(id, message, senderid, teamid, datecreated, dateapproved) +(id, message, senderid, teamid, datecreated, dateapproved, publiclyvisible) VALUES -('39dfd284-d0bf-4017-848c-8156dfef2b94', PGP_SYM_ENCRYPT('Kudos are covered in chocolate.', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-09-04', '2022-09-04'); +('39dfd284-d0bf-4017-848c-8156dfef2b94', PGP_SYM_ENCRYPT('Kudos are covered in chocolate.', '${aeskey}'), 'e4b2fe52-1915-4544-83c5-21b8f871f6db', null, '2024-09-04', '2022-09-04', true); INSERT INTO kudos_recipient (id, kudosid, memberid) diff --git a/server/src/test/java/com/objectcomputing/checkins/services/fixture/FeedbackRequestFixture.java b/server/src/test/java/com/objectcomputing/checkins/services/fixture/FeedbackRequestFixture.java index 201a67023e..bda6a1134b 100644 --- a/server/src/test/java/com/objectcomputing/checkins/services/fixture/FeedbackRequestFixture.java +++ b/server/src/test/java/com/objectcomputing/checkins/services/fixture/FeedbackRequestFixture.java @@ -4,6 +4,8 @@ import com.objectcomputing.checkins.services.memberprofile.MemberProfile; import com.objectcomputing.checkins.services.reviews.ReviewPeriod; import jnr.constants.platform.Local; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.time.LocalDate; @@ -18,6 +20,8 @@ public interface FeedbackRequestFixture extends RepositoryFixture, FeedbackTemplateFixture { + static final Logger LOG = LoggerFactory.getLogger(FeedbackRequestFixture.class); + /** * Creates a sample feedback request * @param creator The {@link MemberProfile} of the creator of the feedback request @@ -59,6 +63,8 @@ default FeedbackRequest saveSampleFeedbackRequest(MemberProfile creator, MemberP } default LocalDate getRandomLocalDateTime(LocalDateTime start, LocalDateTime end) { + if(start.isEqual(end)) return end.toLocalDate(); + LocalDate startDate = start.toLocalDate(); long daysBetween = ChronoUnit.DAYS.between(startDate, end.toLocalDate()); Random random = new Random(); @@ -81,6 +87,8 @@ default FeedbackRequest saveSampleFeedbackRequest(MemberProfile creator, MemberP default FeedbackRequest saveSampleFeedbackRequest(MemberProfile creator, MemberProfile requestee, MemberProfile recipient, UUID templateId, ReviewPeriod reviewPeriod, String status) { LocalDate submitDate = getRandomLocalDateTime(reviewPeriod.getPeriodStartDate(), reviewPeriod.getCloseDate()); + LOG.info("Period start date: {} Generated Submit Date: {}", reviewPeriod.getPeriodStartDate(), submitDate.atStartOfDay()); + if(submitDate.atStartOfDay().isAfter(LocalDateTime.now())) submitDate = LocalDateTime.now().toLocalDate(); LocalDate sendDate = getRandomLocalDateTime(reviewPeriod.getPeriodStartDate(), submitDate.atStartOfDay()); return getFeedbackRequestRepository().save(new FeedbackRequest(creator.getId(), requestee.getId(), recipient.getId(), templateId, sendDate, null, status, submitDate, reviewPeriod.getId())); } diff --git a/server/src/test/java/com/objectcomputing/checkins/services/fixture/ReviewPeriodFixture.java b/server/src/test/java/com/objectcomputing/checkins/services/fixture/ReviewPeriodFixture.java index cd2cf0eded..af3e3863d0 100644 --- a/server/src/test/java/com/objectcomputing/checkins/services/fixture/ReviewPeriodFixture.java +++ b/server/src/test/java/com/objectcomputing/checkins/services/fixture/ReviewPeriodFixture.java @@ -3,6 +3,7 @@ import com.objectcomputing.checkins.services.reviews.ReviewPeriod; import com.objectcomputing.checkins.services.reviews.ReviewStatus; +import java.time.temporal.TemporalUnit; import java.util.UUID; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; @@ -10,12 +11,11 @@ public interface ReviewPeriodFixture extends RepositoryFixture { default ReviewPeriod createADefaultReviewPeriod() { - LocalDateTime launchDate = LocalDateTime.now().plusMinutes(1) - .truncatedTo(ChronoUnit.MILLIS); - LocalDateTime selfReviewCloseDate = launchDate.plusDays(1); - LocalDateTime closeDate = selfReviewCloseDate.plusDays(1); - LocalDateTime startDate = launchDate.minusDays(30); - LocalDateTime endDate = closeDate.minusDays(1); + LocalDateTime launchDate = LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.DAYS); + LocalDateTime selfReviewCloseDate = launchDate.plusDays(2); + LocalDateTime closeDate = selfReviewCloseDate.plusDays(2); + LocalDateTime startDate = launchDate.minusDays(31); + LocalDateTime endDate = launchDate.minusDays(1); return getReviewPeriodRepository().save( new ReviewPeriod("Period of Time", ReviewStatus.OPEN, null, null, launchDate, selfReviewCloseDate, closeDate, @@ -27,12 +27,11 @@ default ReviewPeriod createADefaultReviewPeriod(ReviewStatus reviewStatus) { } default ReviewPeriod createADefaultReviewPeriod(ReviewStatus reviewStatus, UUID templateId) { - LocalDateTime launchDate = LocalDateTime.now().plusMinutes(1) - .truncatedTo(ChronoUnit.MILLIS); - LocalDateTime selfReviewCloseDate = launchDate.plusDays(1); - LocalDateTime closeDate = selfReviewCloseDate.plusDays(1); - LocalDateTime startDate = launchDate.minusDays(30); - LocalDateTime endDate = closeDate.minusDays(1); + LocalDateTime launchDate = LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.DAYS); + LocalDateTime selfReviewCloseDate = launchDate.plusDays(2); + LocalDateTime closeDate = selfReviewCloseDate.plusDays(2); + LocalDateTime startDate = launchDate.minusDays(31); + LocalDateTime endDate = launchDate.minusDays(1); return getReviewPeriodRepository().save( new ReviewPeriod("Period of Time", reviewStatus, templateId, null, launchDate, selfReviewCloseDate, closeDate, @@ -43,12 +42,12 @@ default ReviewPeriod createADefaultReviewPeriod( LocalDateTime launchDate, ReviewStatus reviewStatus, UUID templateId, UUID selfReviewTemplateId) { - launchDate = launchDate.truncatedTo(ChronoUnit.MILLIS); + launchDate = launchDate.truncatedTo(ChronoUnit.DAYS); LocalDateTime selfReviewCloseDate = launchDate.plusDays(4); - LocalDateTime closeDate = selfReviewCloseDate.plusDays(1); - LocalDateTime startDate = launchDate.minusDays(30); - LocalDateTime endDate = closeDate.minusDays(1); + LocalDateTime closeDate = selfReviewCloseDate.plusDays(2); + LocalDateTime startDate = launchDate.minusDays(31); + LocalDateTime endDate = launchDate.minusDays(1); return getReviewPeriodRepository().save( new ReviewPeriod("Specific Launch Date", reviewStatus, templateId, selfReviewTemplateId, @@ -57,12 +56,11 @@ default ReviewPeriod createADefaultReviewPeriod( } default ReviewPeriod createASecondaryReviewPeriod() { - LocalDateTime launchDate = LocalDateTime.now().plusMinutes(1) - .truncatedTo(ChronoUnit.MILLIS); - LocalDateTime selfReviewCloseDate = launchDate.plusDays(1); - LocalDateTime closeDate = selfReviewCloseDate.plusDays(1); - LocalDateTime startDate = launchDate.minusDays(30); - LocalDateTime endDate = closeDate.minusDays(1); + LocalDateTime launchDate = LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.DAYS); + LocalDateTime selfReviewCloseDate = launchDate.plusDays(2); + LocalDateTime closeDate = selfReviewCloseDate.plusDays(2); + LocalDateTime startDate = launchDate.minusDays(31); + LocalDateTime endDate = launchDate.minusDays(1); return getReviewPeriodRepository().save( new ReviewPeriod("Period of Play", ReviewStatus.OPEN, null, null, launchDate, selfReviewCloseDate, closeDate, @@ -70,19 +68,15 @@ default ReviewPeriod createASecondaryReviewPeriod() { } default ReviewPeriod createAClosedReviewPeriod() { - LocalDateTime launchDate = LocalDateTime.now().plusMinutes(1) - .truncatedTo(ChronoUnit.MILLIS); - LocalDateTime selfReviewCloseDate = launchDate.plusDays(1); - LocalDateTime closeDate = selfReviewCloseDate.plusDays(1); - LocalDateTime startDate = launchDate.minusDays(30); - LocalDateTime endDate = closeDate.minusDays(1); + LocalDateTime launchDate = LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.DAYS); + LocalDateTime startDate = launchDate.minusDays(31); + LocalDateTime endDate = launchDate.minusDays(1); return createAClosedReviewPeriod(startDate, endDate); } default ReviewPeriod createAClosedReviewPeriod( LocalDateTime periodStart, LocalDateTime periodEnd) { - LocalDateTime launchDate = periodEnd.plusMinutes(1) - .truncatedTo(ChronoUnit.MILLIS).plusDays(1); + LocalDateTime launchDate = periodEnd.plusDays(1).truncatedTo(ChronoUnit.DAYS); LocalDateTime selfReviewCloseDate = launchDate.plusDays(3); LocalDateTime closeDate = selfReviewCloseDate.plusDays(7); return getReviewPeriodRepository().save( diff --git a/server/src/test/java/com/objectcomputing/checkins/services/reviews/ReviewPeriodControllerTest.java b/server/src/test/java/com/objectcomputing/checkins/services/reviews/ReviewPeriodControllerTest.java index 4ce4768577..261501737c 100644 --- a/server/src/test/java/com/objectcomputing/checkins/services/reviews/ReviewPeriodControllerTest.java +++ b/server/src/test/java/com/objectcomputing/checkins/services/reviews/ReviewPeriodControllerTest.java @@ -833,7 +833,7 @@ void testSelfReviewThreeDaysEmail() { // launch date, the self-review closes 4 days after the launch date. // So, to get the three day email, we just need to add 1 day to the // launch date. - LocalDateTime launchDate = LocalDateTime.now().plusMinutes(1); + LocalDateTime launchDate = LocalDateTime.now().truncatedTo(ChronoUnit.DAYS); checkSelfReviewEmail(launchDate, launchDate.plusDays(1), " closes in three days!"); } @@ -844,7 +844,7 @@ void testSelfReviewOneDayEmail() { // launch date, the self-review closes 4 days after the launch date. // So, to get the one day email, we just need to add 3 days to the // launch date. - LocalDateTime launchDate = LocalDateTime.now().plusMinutes(1); + LocalDateTime launchDate = LocalDateTime.now().truncatedTo(ChronoUnit.DAYS); checkSelfReviewEmail(launchDate, launchDate.plusDays(3), " closes in one day!"); } diff --git a/server/src/test/resources/META-INF/native-image/com.objectcomputing/checkins-test/reflect-config.json b/server/src/test/resources/META-INF/native-image/com.objectcomputing/checkins-test/reflect-config.json index fadf978ec5..e50773f532 100644 --- a/server/src/test/resources/META-INF/native-image/com.objectcomputing/checkins-test/reflect-config.json +++ b/server/src/test/resources/META-INF/native-image/com.objectcomputing/checkins-test/reflect-config.json @@ -8,7 +8,6 @@ { "name": "", "parameterTypes": [ - ] }, { @@ -18,5 +17,200 @@ ] } ] + }, + { + "name": "org.flywaydb.core.api.migration.baseline.BaselineMigrationConfigurationExtension", + "condition": { + "typeReachable": "org.flywaydb.core.api.configuration.ClassicConfiguration" + }, + "allDeclaredFields": true + }, + { + "name": "org.flywaydb.core.api.migration.baseline.BaselineMigrationConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "getBaselineMigrationPrefix", + "parameterTypes": [ + ] + }, + { + "name": "setBaselineMigrationPrefix", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "org.flywaydb.core.extensibility.ConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + } + }, + { + "name": "org.flywaydb.core.extensibility.Plugin", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + } + }, + { + "name": "org.flywaydb.core.internal.command.clean.CleanModeConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "getClean", + "parameterTypes": [ + ] + }, + { + "name": "setClean", + "parameterTypes": [ + "org.flywaydb.core.internal.command.clean.CleanModel" + ] + } + ] + }, + { + "name": "org.flywaydb.core.internal.command.clean.CleanModel", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "org.flywaydb.core.internal.command.clean.SchemaModel", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true + }, + { + "name": "org.flywaydb.core.internal.configuration.extensions.DeployScriptFilenameConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "getScriptFilename", + "parameterTypes": [ + ] + }, + { + "name": "setScriptFilename", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "org.flywaydb.core.internal.configuration.extensions.PrepareScriptFilenameConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "getScriptFilename", + "parameterTypes": [ + ] + }, + { + "name": "setScriptFilename", + "parameterTypes": [ + "java.lang.String" + ] + } + ] + }, + { + "name": "org.flywaydb.core.internal.proprietaryStubs.LicensingConfigurationExtensionStub", + "condition": { + "typeReachable": "org.flywaydb.core.api.configuration.ClassicConfiguration" + }, + "allDeclaredFields": true + }, + { + "name": "org.flywaydb.core.internal.proprietaryStubs.PATTokenConfigurationExtensionStub", + "condition": { + "typeReachable": "org.flywaydb.core.api.configuration.ClassicConfiguration" + }, + "allDeclaredFields": true + }, + { + "name": "org.flywaydb.core.internal.publishing.PublishingConfigurationExtension", + "condition": { + "typeReachable": "org.flywaydb.core.api.configuration.ClassicConfiguration" + }, + "allDeclaredFields": true + }, + { + "name": "org.flywaydb.core.internal.publishing.PublishingConfigurationExtension", + "queryAllDeclaredMethods": true, + "condition": { + "typeReachable": "org.flywaydb.core.extensibility.ConfigurationExtension" + }, + "allDeclaredFields": true, + "queryAllDeclaredConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [ + ] + }, + { + "name": "isPublishResult", + "parameterTypes": [ + ] + }, + { + "name": "setPublishResult", + "parameterTypes": [ + "boolean" + ] + } + ] } ] \ No newline at end of file diff --git a/web-ui/package.json b/web-ui/package.json index db08625fcc..32ee428d5e 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -1,6 +1,6 @@ { "name": "web-ui", - "version": "0.8.10", + "version": "0.8.11", "private": true, "type": "module", "dependencies": { diff --git a/web-ui/src/components/action_item/ActionItemsPanel.test.jsx b/web-ui/src/components/action_item/ActionItemsPanel.test.jsx index 5476f74548..5f00dcf947 100644 --- a/web-ui/src/components/action_item/ActionItemsPanel.test.jsx +++ b/web-ui/src/components/action_item/ActionItemsPanel.test.jsx @@ -71,7 +71,7 @@ const server = setupServer( ) ); -beforeAll(() => server.listen()); +beforeAll(() => server.listen({ onUnhandledRequest(request, print) {} })); afterEach(() => server.resetHandlers()); afterAll(() => server.close()); diff --git a/web-ui/src/components/agenda/Agenda.jsx b/web-ui/src/components/agenda/Agenda.jsx index e005b9bf02..82bdd2e1ef 100644 --- a/web-ui/src/components/agenda/Agenda.jsx +++ b/web-ui/src/components/agenda/Agenda.jsx @@ -43,7 +43,7 @@ const AgendaItems = () => { const currentUserId = memberProfile?.id; const currentCheckin = selectCheckin(state, checkinId); - const [agendaItems, setAgendaItems] = useState(); + const [agendaItems, setAgendaItems] = useState([]); const [description, setDescription] = useState(''); const [isLoading, setIsLoading] = useState(false); diff --git a/web-ui/src/components/celebrations/MyAnniversary.test.jsx b/web-ui/src/components/celebrations/MyAnniversary.test.jsx index ae44737e12..bfbea022fb 100644 --- a/web-ui/src/components/celebrations/MyAnniversary.test.jsx +++ b/web-ui/src/components/celebrations/MyAnniversary.test.jsx @@ -3,7 +3,7 @@ import MyAnniversary from './MyAnniversary'; import { AppContextProvider } from '../../context/AppContext'; import { BrowserRouter } from 'react-router-dom'; -const hideMyAnniversary = false; +const hideMyAnniversary = () => {}; const myAnniversary = { name: 'Suman Maroju', anniversary: '12/29/2012', diff --git a/web-ui/src/components/certifications/EarnedCertificationsTable.jsx b/web-ui/src/components/certifications/EarnedCertificationsTable.jsx index a13b67e8ad..814a62ec85 100644 --- a/web-ui/src/components/certifications/EarnedCertificationsTable.jsx +++ b/web-ui/src/components/certifications/EarnedCertificationsTable.jsx @@ -94,7 +94,7 @@ const EarnedCertificationsTable = ({ }); if (res.error) return; - const certs = res.payload.data; + const certs = res.payload.data ?? []; setCertifications(certs.sort((c1, c2) => c1.name.localeCompare(c2.name))); const certMap = certs.reduce((map, cert) => { @@ -114,7 +114,7 @@ const EarnedCertificationsTable = ({ }); if (res.error) return; - let earned = res.payload.data; + let earned = res.payload.data ?? []; if (onlyMe) { earned = earned.filter(cert => cert.memberId === currentUser.id); } @@ -512,7 +512,7 @@ const EarnedCertificationsTable = ({ }); if (res.error) return; - const newEarned = res.payload.data; + const newEarned = res.payload.data ?? []; setEarnedCertifications(earned => { if (id) { const index = earned.findIndex(c => c.id === id); diff --git a/web-ui/src/components/checkin/documents/CheckinDocs.jsx b/web-ui/src/components/checkin/documents/CheckinDocs.jsx index 5ef08d7b86..353e0db5c6 100644 --- a/web-ui/src/components/checkin/documents/CheckinDocs.jsx +++ b/web-ui/src/components/checkin/documents/CheckinDocs.jsx @@ -56,7 +56,7 @@ const UploadDocs = () => { }); } } catch (e) { - console.log(e); + console.error("getCheckinFiles: " + e); } } if (csrf) { @@ -98,7 +98,7 @@ const UploadDocs = () => { setFiles([...files, data]); } catch (e) { setFileColors(fileColors => ({ ...fileColors, [file.name]: 'red' })); - console.log({ e }); + console.error("addFiles: " + e); } finally { setLoading(false); } diff --git a/web-ui/src/components/contribution_hours/ProgressBar.test.jsx b/web-ui/src/components/contribution_hours/ProgressBar.test.jsx index 4efa37168e..a82438336a 100644 --- a/web-ui/src/components/contribution_hours/ProgressBar.test.jsx +++ b/web-ui/src/components/contribution_hours/ProgressBar.test.jsx @@ -3,9 +3,13 @@ import ProgressBar from './ProgressBar'; import renderer from 'react-test-renderer'; it('has billable hours', () => { - snapshot(); + snapshot(); }); it('has no billable hours', () => { - snapshot(); + snapshot(); }); diff --git a/web-ui/src/components/contribution_hours/__snapshots__/ProgressBar.test.jsx.snap b/web-ui/src/components/contribution_hours/__snapshots__/ProgressBar.test.jsx.snap index f9b1f0e150..50270e810a 100644 --- a/web-ui/src/components/contribution_hours/__snapshots__/ProgressBar.test.jsx.snap +++ b/web-ui/src/components/contribution_hours/__snapshots__/ProgressBar.test.jsx.snap @@ -14,13 +14,20 @@ exports[`has billable hours 1`] = ` + + @@ -30,9 +37,10 @@ exports[`has billable hours 1`] = ` style="display: block;" > Billable Hours: + 1200 - Contribution Hours: - 925 + 1500 - Target Hours: 1850 - PTO Hours: @@ -66,13 +74,13 @@ exports[`has no billable hours 1`] = ` @@ -82,9 +90,10 @@ exports[`has no billable hours 1`] = ` style="display: block;" > Billable Hours: + 0 - Contribution Hours: - 925 + 1500 - Target Hours: 1850 - PTO Hours: diff --git a/web-ui/src/components/edit_skills/EditSkillsCard.test.jsx b/web-ui/src/components/edit_skills/EditSkillsCard.test.jsx index a5c7f197bf..94ae952868 100644 --- a/web-ui/src/components/edit_skills/EditSkillsCard.test.jsx +++ b/web-ui/src/components/edit_skills/EditSkillsCard.test.jsx @@ -72,7 +72,7 @@ const server = setupServer( }) ); -beforeAll(() => server.listen()); +beforeAll(() => server.listen({ onUnhandledRequest(request, print) {} })); afterEach(() => server.resetHandlers()); afterAll(() => server.close()); diff --git a/web-ui/src/components/feedback_request_card/FeedbackRequestCard.jsx b/web-ui/src/components/feedback_request_card/FeedbackRequestCard.jsx index ae439d4ef8..7bc992bba1 100644 --- a/web-ui/src/components/feedback_request_card/FeedbackRequestCard.jsx +++ b/web-ui/src/components/feedback_request_card/FeedbackRequestCard.jsx @@ -106,9 +106,6 @@ const FeedbackRequestCard = ({ requestDate => { let oldestDate = new Date(); switch (dateRange) { - case DateRange.THREE_MONTHS: - oldestDate.setMonth(oldestDate.getMonth() - 3); - break; case DateRange.SIX_MONTHS: oldestDate.setMonth(oldestDate.getMonth() - 6); break; @@ -117,6 +114,7 @@ const FeedbackRequestCard = ({ break; case DateRange.ALL_TIME: return true; + case DateRange.THREE_MONTHS: default: oldestDate.setMonth(oldestDate.getMonth() - 3); } @@ -181,10 +179,6 @@ const FeedbackRequestCard = ({ let sortMethod; switch (sortType) { - case SortOption.SENT_DATE: - sortMethod = (a, b) => - new Date(a.sendDate) > new Date(b.sendDate) ? -1 : 1; - break; case SortOption.SUBMISSION_DATE: sortMethod = (a, b) => !a.submitDate || new Date(a.submitDate) > new Date(b.submitDate) @@ -205,6 +199,7 @@ const FeedbackRequestCard = ({ ? -1 : 1; break; + case SortOption.SENT_DATE: default: sortMethod = (a, b) => new Date(a.sendDate) > new Date(b.sendDate) ? -1 : 1; diff --git a/web-ui/src/components/feedback_request_card/FeedbackRequestCard.test.jsx b/web-ui/src/components/feedback_request_card/FeedbackRequestCard.test.jsx index 1d78434b16..89b6087bc3 100644 --- a/web-ui/src/components/feedback_request_card/FeedbackRequestCard.test.jsx +++ b/web-ui/src/components/feedback_request_card/FeedbackRequestCard.test.jsx @@ -8,6 +8,8 @@ it('renders correctly', () => { { snapshot( - + ) : ( - + {isReviewing ? 'Reviewing' : 'Submitting'} Feedback on{' '} {requesteeName} -{/* {!isReviewing && ( */} -{/*
*/} -{/* */} -{/* info-icon */} -{/* */} -{/* */} -{/* Tip of the day: */} -{/* {tip} */} -{/* */} -{/*
*/} -{/* )} */} {!isReviewing && ( Notice! diff --git a/web-ui/src/components/feedback_submit_question/FeedbackSubmitQuestion.test.jsx b/web-ui/src/components/feedback_submit_question/FeedbackSubmitQuestion.test.jsx index c46d8e72be..fc8df5643b 100644 --- a/web-ui/src/components/feedback_submit_question/FeedbackSubmitQuestion.test.jsx +++ b/web-ui/src/components/feedback_submit_question/FeedbackSubmitQuestion.test.jsx @@ -10,7 +10,7 @@ it('renders the feedback submit question as text', () => { id: '1', question: 'How is the project going so far?', questionNumber: 1, - questionType: 'TEXT' + inputType: 'TEXT' }} readOnly={false} answer={{ @@ -34,7 +34,7 @@ it('renders the feedback submit question as radio buttons', () => { id: '1', question: 'Do you think the project is going well so far?', questionNumber: 1, - questionType: 'RADIO' + inputType: 'RADIO' }} readOnly={false} answer={{ @@ -58,7 +58,7 @@ it('renders the feedback submit question as a slider', () => { id: '1', question: 'Do you think the project is going well so far?', questionNumber: 1, - questionType: 'SLIDER' + inputType: 'SLIDER' }} readOnly={false} answer={{ diff --git a/web-ui/src/components/feedback_submit_question/__snapshots__/FeedbackSubmitQuestion.test.jsx.snap b/web-ui/src/components/feedback_submit_question/__snapshots__/FeedbackSubmitQuestion.test.jsx.snap index 19fa4ce493..64a5a0343e 100644 --- a/web-ui/src/components/feedback_submit_question/__snapshots__/FeedbackSubmitQuestion.test.jsx.snap +++ b/web-ui/src/components/feedback_submit_question/__snapshots__/FeedbackSubmitQuestion.test.jsx.snap @@ -11,6 +11,101 @@ exports[`renders the feedback submit question as a slider 1`] = ` > Do you think the project is going well so far?

+