diff --git a/backend/src/main/java/ca/bc/gov/backendstartapi/dto/FavouriteActivityCreateDto.java b/backend/src/main/java/ca/bc/gov/backendstartapi/dto/FavouriteActivityCreateDto.java index 9e51b4045..00df5d10f 100644 --- a/backend/src/main/java/ca/bc/gov/backendstartapi/dto/FavouriteActivityCreateDto.java +++ b/backend/src/main/java/ca/bc/gov/backendstartapi/dto/FavouriteActivityCreateDto.java @@ -10,4 +10,7 @@ * @param activity The activity or page name */ @Schema(description = "An object representing the request body when creating a favourite activity") -public record FavouriteActivityCreateDto(@NotNull String activity) {} +public record FavouriteActivityCreateDto( + @NotNull String activity, + @Schema(description = "Indicates whether this activity is from Consep", defaultValue = "false") + Boolean isConsep) {} diff --git a/backend/src/main/java/ca/bc/gov/backendstartapi/endpoint/FavouriteActivityEndpoint.java b/backend/src/main/java/ca/bc/gov/backendstartapi/endpoint/FavouriteActivityEndpoint.java index 438398786..3bc5cbd73 100644 --- a/backend/src/main/java/ca/bc/gov/backendstartapi/endpoint/FavouriteActivityEndpoint.java +++ b/backend/src/main/java/ca/bc/gov/backendstartapi/endpoint/FavouriteActivityEndpoint.java @@ -53,7 +53,7 @@ public class FavouriteActivityEndpoint { description = """ Creates a Favourite Activity to the logged user based on the activity - title or page name. + title or page name, with an optional isConsep flag. """) @ApiResponses( value = { diff --git a/backend/src/main/java/ca/bc/gov/backendstartapi/entity/FavouriteActivityEntity.java b/backend/src/main/java/ca/bc/gov/backendstartapi/entity/FavouriteActivityEntity.java index 9a8bd1bba..977bf1412 100644 --- a/backend/src/main/java/ca/bc/gov/backendstartapi/entity/FavouriteActivityEntity.java +++ b/backend/src/main/java/ca/bc/gov/backendstartapi/entity/FavouriteActivityEntity.java @@ -53,6 +53,12 @@ public class FavouriteActivityEntity { @Column(name = "update_timestamp") private LocalDateTime updateTimestamp; + @Column(name = "is_consep", nullable = false, columnDefinition = "BOOLEAN DEFAULT FALSE") + @Schema( + description = "Defines if the favourite activity is a CONSEP activity", + example = "false") + private Boolean isConsep = false; + public FavouriteActivityEntity() { this.highlighted = false; } diff --git a/backend/src/main/java/ca/bc/gov/backendstartapi/service/FavouriteActivityService.java b/backend/src/main/java/ca/bc/gov/backendstartapi/service/FavouriteActivityService.java index 489f13baf..56042d3d7 100644 --- a/backend/src/main/java/ca/bc/gov/backendstartapi/service/FavouriteActivityService.java +++ b/backend/src/main/java/ca/bc/gov/backendstartapi/service/FavouriteActivityService.java @@ -60,6 +60,8 @@ public FavouriteActivityEntity createUserActivity(FavouriteActivityCreateDto act activityEntity.setUserId(userId); activityEntity.setActivity(activityDto.activity()); + activityEntity.setIsConsep(activityDto.isConsep() != null ? activityDto.isConsep() : false); + FavouriteActivityEntity activityEntitySaved = favouriteActivityRepository.save(activityEntity); SparLog.info("Activity {} created for user {}", activityDto.activity(), userId); return activityEntitySaved; diff --git a/backend/src/main/resources/db/migration/V47__add_col_to_favourite_activity.sql b/backend/src/main/resources/db/migration/V47__add_col_to_favourite_activity.sql new file mode 100644 index 000000000..9a6b8cea7 --- /dev/null +++ b/backend/src/main/resources/db/migration/V47__add_col_to_favourite_activity.sql @@ -0,0 +1,4 @@ +ALTER TABLE + spar.favourite_activity +ADD + COLUMN is_consep BOOLEAN DEFAULT FALSE NOT NULL; diff --git a/backend/src/test/java/ca/bc/gov/backendstartapi/service/FavouriteActivityServiceTest.java b/backend/src/test/java/ca/bc/gov/backendstartapi/service/FavouriteActivityServiceTest.java index 8f1556c7e..93d50e081 100644 --- a/backend/src/test/java/ca/bc/gov/backendstartapi/service/FavouriteActivityServiceTest.java +++ b/backend/src/test/java/ca/bc/gov/backendstartapi/service/FavouriteActivityServiceTest.java @@ -49,7 +49,8 @@ void createUserActivityTest() { entity.setHighlighted(Boolean.FALSE); when(favouriteActivityRepository.save(any())).thenReturn(entity); - FavouriteActivityCreateDto createDto = new FavouriteActivityCreateDto("CREATE_A_CLASS_SEEDLOT"); + FavouriteActivityCreateDto createDto = + new FavouriteActivityCreateDto("CREATE_A_CLASS_SEEDLOT", false); FavouriteActivityEntity entitySaved = favouriteActivityService.createUserActivity(createDto); Assertions.assertNotNull(entitySaved); @@ -67,7 +68,7 @@ void createUserActivityExceptionTest() { entity.setHighlighted(Boolean.FALSE); when(favouriteActivityRepository.save(any())).thenReturn(entity); - FavouriteActivityCreateDto createDto = new FavouriteActivityCreateDto(null); + FavouriteActivityCreateDto createDto = new FavouriteActivityCreateDto(null, false); Exception notFoundExc = Assertions.assertThrows( @@ -81,7 +82,7 @@ void createUserActivityExceptionTest() { when(favouriteActivityRepository.findAllByUserId(any())).thenReturn(userFavList); FavouriteActivityCreateDto createAnotherDto = - new FavouriteActivityCreateDto("CREATE_A_CLASS_SEEDLOT"); + new FavouriteActivityCreateDto("CREATE_A_CLASS_SEEDLOT", false); Exception activityExists = Assertions.assertThrows( diff --git a/frontend/src/components/Card/FavouriteCard/index.tsx b/frontend/src/components/Card/FavouriteCard/index.tsx index bdb728907..cb74e1046 100644 --- a/frontend/src/components/Card/FavouriteCard/index.tsx +++ b/frontend/src/components/Card/FavouriteCard/index.tsx @@ -90,7 +90,7 @@ const FavouriteCard = ({ return ( navigate(favObject.link)} tabIndex={0} aria-label={`Go to ${favObject.header}`} diff --git a/frontend/src/components/Card/FavouriteCard/styles.scss b/frontend/src/components/Card/FavouriteCard/styles.scss index 9faf39824..0a79a3179 100644 --- a/frontend/src/components/Card/FavouriteCard/styles.scss +++ b/frontend/src/components/Card/FavouriteCard/styles.scss @@ -35,7 +35,6 @@ align-items: flex-start; padding: 1.25rem 1rem; margin: 0.5rem; - width: 14.625rem; height: 9.875rem; background: var(--#{vars.$bcgov-prefix}-layer-02); border: 1px solid var(--#{vars.$bcgov-prefix}-border-subtle-02); @@ -50,6 +49,14 @@ cursor: pointer; } +.fav-card-main-spar { + width: 14.625rem; +} + +.fav-card-main-consep { + width: 18.281rem; +} + .fav-card-content { display: inline-block; margin-top: auto; diff --git a/frontend/src/components/FavouriteActivities/index.tsx b/frontend/src/components/FavouriteActivities/index.tsx index 4354283c8..76f1dde13 100644 --- a/frontend/src/components/FavouriteActivities/index.tsx +++ b/frontend/src/components/FavouriteActivities/index.tsx @@ -18,7 +18,11 @@ import useWindowSize from '../../hooks/UseWindowSize'; import './styles.scss'; import { MEDIUM_SCREEN_WIDTH } from '../../shared-constants/shared-constants'; -const FavouriteActivities = () => { +interface FavouriteActivitiesProps { + isConsep: boolean; +} + +const FavouriteActivities = ({ isConsep }: FavouriteActivitiesProps) => { const windowSize = useWindowSize(); const favActQueryKey = ['favourite-activities']; @@ -32,9 +36,11 @@ const FavouriteActivities = () => { + {!isConsep && (

My favourite activities

@@ -48,7 +54,9 @@ const FavouriteActivities = () => {
- + )} + + { favActQuery.isLoading @@ -71,11 +79,14 @@ const FavouriteActivities = () => { description="You can favourite your most used activities by clicking on the heart icon inside each page" /> - ) : favActQuery.data.map((favObject) => ( - + ) : favActQuery.data.filter((fav) => fav.isConsep === isConsep).map((favObject) => ( + + + + )) ) } diff --git a/frontend/src/components/FavouriteActivities/styles.scss b/frontend/src/components/FavouriteActivities/styles.scss index 5cf1797a7..9564114aa 100644 --- a/frontend/src/components/FavouriteActivities/styles.scss +++ b/frontend/src/components/FavouriteActivities/styles.scss @@ -3,8 +3,6 @@ @use '@carbon/type'; .favourite-activities { - background-color: var(--#{vars.$bcgov-prefix}-layer-01); - .favourite-activities-title { h2 { @include type.type-style('heading-03'); @@ -59,3 +57,7 @@ .favourite-activities-padding{ padding: 2rem; } + +.favourite-activities-with-background { + background-color: var(--#{vars.$bcgov-prefix}-layer-01); +} \ No newline at end of file diff --git a/frontend/src/components/PageTitle/index.tsx b/frontend/src/components/PageTitle/index.tsx index 149407503..18acf711a 100644 --- a/frontend/src/components/PageTitle/index.tsx +++ b/frontend/src/components/PageTitle/index.tsx @@ -19,13 +19,15 @@ interface PageTitleProps { subtitle?: string | React.ReactNode; enableFavourite?: boolean; activity?: string; + isConsep?: boolean; } const PageTitle = ({ title, subtitle, enableFavourite, - activity + activity, + isConsep = false }: PageTitleProps) => { const favActQueryKey = ['favourite-activities']; const queryClient = useQueryClient(); @@ -38,18 +40,20 @@ const PageTitle = ({ const highlightFavAct = useMutation({ mutationFn: (actObj: FavActivityPostType) => postFavAct(actObj), onSuccess: () => { - queryClient.invalidateQueries({ queryKey: favActQueryKey }); + queryClient.invalidateQueries(favActQueryKey); } }); const removeFavAct = useMutation({ mutationFn: (id: number) => deleteFavAct(id), onSuccess: () => { - queryClient.invalidateQueries({ queryKey: favActQueryKey }); + queryClient.invalidateQueries(favActQueryKey); } }); - const thisFavAct = favActQuery?.data?.filter((act) => act.type === activity)[0]; + const thisFavAct = favActQuery?.data?.filter( + (act) => act.type === activity && act.isConsep === isConsep + )[0]; const isFavourited = thisFavAct !== undefined; diff --git a/frontend/src/config/FavouriteActivityMap.ts b/frontend/src/config/FavouriteActivityMap.ts index b84d88002..2a64df4a3 100644 --- a/frontend/src/config/FavouriteActivityMap.ts +++ b/frontend/src/config/FavouriteActivityMap.ts @@ -8,7 +8,8 @@ const FavouriteActivityMap: Record = { image: 'SoilMoistureField', header: 'Seedlots', link: ROUTES.SEEDLOTS, - highlighted: false + highlighted: false, + isConsep: false }, registerAClass: { id: -1, @@ -16,7 +17,8 @@ const FavouriteActivityMap: Record = { image: 'TaskAdd', header: 'Create A-class seedlot', link: ROUTES.SEEDLOTS_A_CLASS_CREATION, - highlighted: false + highlighted: false, + isConsep: false }, mySeedlots: { id: -1, @@ -24,7 +26,8 @@ const FavouriteActivityMap: Record = { image: 'TableSplit', header: 'My Seedlots', link: ROUTES.MY_SEEDLOTS, - highlighted: false + highlighted: false, + isConsep: false }, reviewSeedlots: { id: -1, @@ -32,7 +35,8 @@ const FavouriteActivityMap: Record = { image: 'TableSplit', header: 'Review Seedlots', link: ROUTES.TSC_SEEDLOTS_TABLE, - highlighted: false + highlighted: false, + isConsep: false }, unknown: { id: -1, @@ -40,7 +44,488 @@ const FavouriteActivityMap: Record = { image: 'Unknown', header: 'Unknown activity: ', link: '#', - highlighted: false + highlighted: false, + isConsep: false + }, + actualGerminationCount: { + id: -1, + type: 'actualGerminationCount', + image: 'TableSplit', + header: 'Actual Germination Count', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + calculateCropAverage: { + id: -1, + type: 'calculateCropAverage', + image: 'TableSplit', + header: 'Calculate Crop Average', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Administrative' + }, + cancelledRequestsReport: { + id: -1, + type: 'cancelledRequestsReport', + image: 'TableSplit', + header: 'Cancelled Requests Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + coneAndSeedProcessingReport: { + id: -1, + type: 'coneAndSeedProcessingReport', + image: 'TableSplit', + header: 'Cone and Seed Processing Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Processing' + }, + coneAndSeedShipmentReceipt: { + id: -1, + type: 'coneAndSeedShipmentReceipt', + image: 'TableSplit', + header: 'Cone and Seed Shipment Receipt', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + createGerminationTray: { + id: -1, + type: 'createGerminationTray', + image: 'TableSplit', + header: 'Create Germination Tray', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + cspRequest: { + id: -1, + type: 'cspRequest', + image: 'TableSplit', + header: 'CSP Request', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Processing' + }, + doNotStartList: { + id: -1, + type: 'doNotStartList', + image: 'TableSplit', + header: 'Do Not Start List', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + familyLot: { + id: -1, + type: 'familyLot', + image: 'TableSplit', + header: 'Family Lot', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + familyLotSummaryReport: { + id: -1, + type: 'familyLotSummaryReport', + image: 'TableSplit', + header: 'Family Lot Summary Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + germinationSpeciesAverage: { + id: -1, + type: 'germinationSpeciesAverage', + image: 'TableSplit', + header: 'Germination Species Average', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + germCountPredictions: { + id: -1, + type: 'germCountPredictions', + image: 'TableSplit', + header: 'Germ Count Predictions', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + identifyAvailableLongTermLocation: { + id: -1, + type: 'identifyAvailableLongTermLocation', + image: 'TableSplit', + header: 'Identify Available Long-Term Location', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + inHouseInventory: { + id: -1, + type: 'inHouseInventory', + image: 'TableSplit', + header: 'In-House Inventory', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + inventoryLocationReport: { + id: -1, + type: 'inventoryLocationReport', + image: 'TableSplit', + header: 'Inventory Location Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + kilnPrograms: { + id: -1, + type: 'kilnPrograms', + image: 'TableSplit', + header: 'Kiln Programs', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Administrative' + }, + maintainClientLocation: { + id: -1, + type: 'maintainClientLocation', + image: 'TableSplit', + header: 'Maintain Client Location', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Administrative' + }, + maintainGerminationTrayScreen: { + id: -1, + type: 'maintainGerminationTrayScreen', + image: 'TableSplit', + header: 'Maintain Germination Tray Screen', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + maintainLocalContacts: { + id: -1, + type: 'maintainLocalContacts', + image: 'TableSplit', + header: 'Maintain Local Contacts', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Administrative' + }, + maintainStandardActivities: { + id: -1, + type: 'maintainStandardActivities', + image: 'TableSplit', + header: 'Maintain Standard Activities', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Administrative' + }, + maintainStatHolidays: { + id: -1, + type: 'maintainStatHolidays', + image: 'TableSplit', + header: 'Maintain Stat Holidays', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + maintainWorkPlans: { + id: -1, + type: 'maintainWorkPlans', + image: 'TableSplit', + header: 'Maintain Work Plans', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Administrative' + }, + manualMoistureContent: { + id: -1, + type: 'manualMoistureContent', + image: 'TableSplit', + header: 'Manual Moisture Content', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + processingActivities: { + id: -1, + type: 'processingActivities', + image: 'TableSplit', + header: 'Processing Activities', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Processing' + }, + recordStockCountResults: { + id: -1, + type: 'recordStockCountResults', + image: 'TableSplit', + header: 'Record Stock Count Results', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + requestChangesReport: { + id: -1, + type: 'requestChangesReport', + image: 'TableSplit', + header: 'Request Changes Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + returnedSeed: { + id: -1, + type: 'returnedSeed', + image: 'TableSplit', + header: 'Returned Seed', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + reviewPendingRequest: { + id: -1, + type: 'reviewPendingRequest', + image: 'TableSplit', + header: 'Review Pending Request', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + scheduleOrReviseRequestItemActivity: { + id: -1, + type: 'scheduleOrReviseRequestItemActivity', + image: 'TableSplit', + header: 'Schedule or Revise Request Item Activity', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + seedAndFamilyLotReport: { + id: -1, + type: 'seedAndFamilyLotReport', + image: 'TableSplit', + header: 'Seed and Family Lot Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + seedSaleOrTransferActivitiesScreen: { + id: -1, + type: 'seedSaleOrTransferActivitiesScreen', + image: 'TableSplit', + header: 'Seed Sale or Transfer Activities Screen', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + seedlotCharacteristics: { + id: -1, + type: 'seedlotCharacteristics', + image: 'TableSplit', + header: 'Seedlot Characteristics', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + seedlotLocationHistoryReport: { + id: -1, + type: 'seedlotLocationHistoryReport', + image: 'TableSplit', + header: 'Seedlot Location History Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + seedlotObservationHistory: { + id: -1, + type: 'seedlotObservationHistory', + image: 'TableSplit', + header: 'Seedlot Observation History', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + seedlotOrRequestItemInventoryLocation: { + id: -1, + type: 'seedlotOrRequestItemInventoryLocation', + image: 'TableSplit', + header: 'Seedlot or Request Item Inventory Location', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + seedlotOwner: { + id: -1, + type: 'seedlotOwner', + image: 'TableSplit', + header: 'Seedlot Owner', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Seed and family lot' + }, + seedlotTestHistoryReport: { + id: -1, + type: 'seedlotTestHistoryReport', + image: 'TableSplit', + header: 'Seedlot Test History Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + stockCountStatusReport: { + id: -1, + type: 'stockCountStatusReport', + image: 'TableSplit', + header: 'Stock Count Status Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + testingActivitiesList: { + id: -1, + type: 'testingActivitiesList', + image: 'TableSplit', + header: 'Testing Activities List', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + testingActivitiesSummaryReport: { + id: -1, + type: 'testingActivitiesSummaryReport', + image: 'TableSplit', + header: 'Testing Activities Summary Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + testingRequestsReport: { + id: -1, + type: 'testingRequestsReport', + image: 'TableSplit', + header: 'Testing Requests Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + waybills: { + id: -1, + type: 'waybills', + image: 'TableSplit', + header: 'Waybills', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + withdrawalDate: { + id: -1, + type: 'withdrawalDate', + image: 'TableSplit', + header: 'Withdrawal Date', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Testing' + }, + withdrawalRequest: { + id: -1, + type: 'withdrawalRequest', + image: 'TableSplit', + header: 'Withdrawal Request', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + withdrawalRequestDetailsReport: { + id: -1, + type: 'withdrawalRequestDetailsReport', + image: 'TableSplit', + header: 'Withdrawal Request Details Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + withdrawalRequestReport: { + id: -1, + type: 'withdrawalRequestReport', + image: 'TableSplit', + header: 'Withdrawal Request Report', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + withdrawalResults: { + id: -1, + type: 'withdrawalResults', + image: 'TableSplit', + header: 'Withdrawal Results', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' + }, + withdrawalResultObservations: { + id: -1, + type: 'withdrawalResultObservations', + image: 'TableSplit', + header: 'Withdrawal Result Observations', + link: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + highlighted: false, + isConsep: true, + department: 'Withdrawal' } }; diff --git a/frontend/src/routes/constants.ts b/frontend/src/routes/constants.ts index 83f19bc3f..08f444332 100644 --- a/frontend/src/routes/constants.ts +++ b/frontend/src/routes/constants.ts @@ -14,7 +14,8 @@ const ROUTES = { TSC_SEEDLOTS_TABLE: '/seedlots/tsc-admin-seedlots', FOUR_OH_FOUR: '/404', FOUR_OH_THREE: '/403', - SERVICE_STATUS: '/service-status' + SERVICE_STATUS: '/service-status', + CONSEP_FAVOURITE_ACTIVITIES: '/consep/favourite-activities' }; export default ROUTES; diff --git a/frontend/src/routes/index.tsx b/frontend/src/routes/index.tsx index f8abd99ee..05f97756e 100644 --- a/frontend/src/routes/index.tsx +++ b/frontend/src/routes/index.tsx @@ -15,6 +15,7 @@ import SeedlotReview from '../views/Seedlot/SeedlotReview'; import SeedlotRegFormClassA from '../views/Seedlot/SeedlotRegFormClassA'; import ReviewSeedlots from '../views/Seedlot/ReviewSeedlots'; import FourOhThree from '../views/ErrorViews/FourOhThree'; +import FavouriteActivities from '../views/CONSEP/FavouriteActivity'; const BrowserRoutes: Array = [ // Ensures that root paths get redirected to @@ -97,6 +98,12 @@ const BrowserRoutes: Array = [ element: ( ) + }, + { + path: ROUTES.CONSEP_FAVOURITE_ACTIVITIES, + element: ( + + ) } ]; diff --git a/frontend/src/types/FavActivityTypes.ts b/frontend/src/types/FavActivityTypes.ts index 0b84ae10a..ae172842a 100644 --- a/frontend/src/types/FavActivityTypes.ts +++ b/frontend/src/types/FavActivityTypes.ts @@ -5,8 +5,11 @@ export type FavActivityType = { header: string; link: string; highlighted: boolean; + isConsep?: boolean; + department?: string; } export type FavActivityPostType = { activity: string; + isConsep?: boolean; } diff --git a/frontend/src/views/CONSEP/FavouriteActivity/index.tsx b/frontend/src/views/CONSEP/FavouriteActivity/index.tsx new file mode 100644 index 000000000..382a0a9d3 --- /dev/null +++ b/frontend/src/views/CONSEP/FavouriteActivity/index.tsx @@ -0,0 +1,33 @@ +import React from 'react'; + +import { + FlexGrid, + Row, + Column +} from '@carbon/react'; + +import PageTitle from '../../../components/PageTitle'; +import FavouriteActivities from '../../../components/FavouriteActivities'; + +import './styles.scss'; + +const FavouriteActivity = () => ( + + + + + + + + +
+ +
+
+
+
+); + +export default FavouriteActivity; diff --git a/frontend/src/views/CONSEP/FavouriteActivity/styles.scss b/frontend/src/views/CONSEP/FavouriteActivity/styles.scss new file mode 100644 index 000000000..3c6112b41 --- /dev/null +++ b/frontend/src/views/CONSEP/FavouriteActivity/styles.scss @@ -0,0 +1,32 @@ +@use '@bcgov-nr/nr-theme/design-tokens/variables.scss' as vars; +@use '@carbon/type'; + +.dashboard-page { + padding: 0 0 2.5rem 0; + + .dashboard-row { + margin-bottom: 2rem; + } + + div.title-section { + padding-left: 2.5rem; + padding-right: 2.5rem; + } + + .#{vars.$bcgov-prefix}--row { + margin-left: 0; + margin-right: 0; + } + + .#{vars.$bcgov-prefix}--col { + padding-left: 0; + padding-right: 0; + } +} + +p.fav-act-page-title-large { + @include type.type-style('heading-06'); + white-space: nowrap; + max-width: 12.5rem; + margin-left: 2.5rem; +} diff --git a/frontend/src/views/Dashboard/dashboard.tsx b/frontend/src/views/Dashboard/dashboard.tsx index 456e36f17..14136414b 100644 --- a/frontend/src/views/Dashboard/dashboard.tsx +++ b/frontend/src/views/Dashboard/dashboard.tsx @@ -23,7 +23,7 @@ const Dashboard = () => (
- +