diff --git a/source/backend/api/Pims.Api.csproj b/source/backend/api/Pims.Api.csproj
index f0c352f936..76be24f480 100644
--- a/source/backend/api/Pims.Api.csproj
+++ b/source/backend/api/Pims.Api.csproj
@@ -2,9 +2,9 @@
0ef6255f-9ea0-49ec-8c65-c172304b4926
- 3.0.0-41.15
- 3.0.0-41.15
- 3.0.0.41
+ 3.0.1-41.15
+ 3.0.1-41.15
+ 3.0.1.41
true
16BC0468-78F6-4C91-87DA-7403C919E646
diff --git a/source/backend/api/Repositories/Mayan/MayanDocumentRepository.cs b/source/backend/api/Repositories/Mayan/MayanDocumentRepository.cs
index 7fbd56df99..1bb8d05b47 100644
--- a/source/backend/api/Repositories/Mayan/MayanDocumentRepository.cs
+++ b/source/backend/api/Repositories/Mayan/MayanDocumentRepository.cs
@@ -1,4 +1,6 @@
using System;
+using System.Collections;
+using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
@@ -173,6 +175,8 @@ public async Task> DownloadFileAsync(long documentI
HttpResponseMessage response = await client.GetAsync(endpoint).ConfigureAwait(true);
byte[] payload = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(true);
_logger.LogTrace("Response: {response}", response);
+ response.Content.Headers.TryGetValues("Content-Length", out IEnumerable contentLengthHeaders);
+ int contentLength = contentLengthHeaders?.FirstOrDefault() != null ? int.Parse(contentLengthHeaders.FirstOrDefault()) : payload.Length;
switch (response.StatusCode)
{
case HttpStatusCode.OK:
@@ -183,7 +187,7 @@ public async Task> DownloadFileAsync(long documentI
retVal.Payload = new FileDownload()
{
FilePayload = payload,
- Size = int.Parse(response.Content.Headers.GetValues("Content-Length").FirstOrDefault()),
+ Size = contentLength,
Mimetype = response.Content.Headers.GetValues("Content-Type").FirstOrDefault(),
FileName = fileName,
};
diff --git a/source/frontend/package.json b/source/frontend/package.json
index 1ac679ee61..f4da05f7d9 100644
--- a/source/frontend/package.json
+++ b/source/frontend/package.json
@@ -1,6 +1,6 @@
{
"name": "frontend",
- "version": "3.0.0-41.15",
+ "version": "3.0.1-41.15",
"private": true,
"dependencies": {
"@bcgov/bc-sans": "1.0.1",
diff --git a/source/frontend/src/features/properties/map/activity/detail/ActivityForm.test.tsx b/source/frontend/src/features/properties/map/activity/detail/ActivityForm.test.tsx
index edbdef4bab..c60d687ab4 100644
--- a/source/frontend/src/features/properties/map/activity/detail/ActivityForm.test.tsx
+++ b/source/frontend/src/features/properties/map/activity/detail/ActivityForm.test.tsx
@@ -49,7 +49,12 @@ describe('ActivityForm test', () => {
{
...renderOptions,
store: storeState,
- claims: renderOptions?.claims ?? [Claims.ACTIVITY_EDIT, Claims.PROPERTY_EDIT],
+ claims: renderOptions?.claims ?? [
+ Claims.ACTIVITY_EDIT,
+ Claims.PROPERTY_EDIT,
+ Claims.DOCUMENT_VIEW,
+ Claims.NOTE_VIEW,
+ ],
},
);
diff --git a/source/frontend/src/features/properties/map/activity/detail/ActivityView.test.tsx b/source/frontend/src/features/properties/map/activity/detail/ActivityView.test.tsx
index 36897715c1..5dc1550a30 100644
--- a/source/frontend/src/features/properties/map/activity/detail/ActivityView.test.tsx
+++ b/source/frontend/src/features/properties/map/activity/detail/ActivityView.test.tsx
@@ -21,7 +21,7 @@ const onEditRelatedProperties = jest.fn();
jest.mock('@react-keycloak/web');
describe('ActivityView test', () => {
- const setup = (renderOptions?: RenderOptions & IActivityViewProps) => {
+ const setup = (renderOptions?: RenderOptions & Partial) => {
// render component under test
const component = render(
@@ -65,19 +65,19 @@ describe('ActivityView test', () => {
});
it('sections are expanded by default', async () => {
- const { getByTitle } = setup();
+ const { getByTitle } = setup({ claims: [Claims.DOCUMENT_VIEW, Claims.NOTE_VIEW] });
expect(getByTitle('collapse-documents')).toBeInTheDocument();
expect(getByTitle('collapse-notes')).toBeInTheDocument();
expect(getByTitle('collapse-description')).toBeInTheDocument();
});
it('documents are displayed', async () => {
- const { getByText } = setup();
+ const { getByText } = setup({ claims: [Claims.DOCUMENT_VIEW] });
expect(getByText('Document type')).toBeVisible();
});
it('notes are displayed', async () => {
- const { getByText } = setup();
+ const { getByText } = setup({ claims: [Claims.NOTE_VIEW] });
expect(getByText('Note')).toBeVisible();
});
});
diff --git a/source/frontend/src/features/properties/map/activity/detail/ActivityView.tsx b/source/frontend/src/features/properties/map/activity/detail/ActivityView.tsx
index f9a77d0804..77c6bb84f4 100644
--- a/source/frontend/src/features/properties/map/activity/detail/ActivityView.tsx
+++ b/source/frontend/src/features/properties/map/activity/detail/ActivityView.tsx
@@ -1,8 +1,10 @@
+import { Claims } from 'constants/claims';
import { DocumentRelationshipType } from 'constants/documentRelationshipType';
import { NoteTypes } from 'constants/noteTypes';
import DocumentListContainer from 'features/documents/list/DocumentListContainer';
import { Section } from 'features/mapSideBar/tabs/Section';
import { NoteListView } from 'features/notes/list/NoteListView';
+import useKeycloakWrapper from 'hooks/useKeycloakWrapper';
import * as React from 'react';
import styled from 'styled-components';
@@ -27,6 +29,7 @@ export const ActivityView: React.FunctionComponent = ({
onEditRelatedProperties,
children,
}) => {
+ const { hasClaim } = useKeycloakWrapper();
return (
<>
@@ -39,11 +42,15 @@ export const ActivityView: React.FunctionComponent = ({
{children}
-
-
+ {hasClaim(Claims.DOCUMENT_VIEW) && (
+
+ )}
+ {hasClaim(Claims.NOTE_VIEW) && (
+
+ )}
>
);
diff --git a/source/frontend/src/features/properties/map/activity/detail/__snapshots__/ActivityView.test.tsx.snap b/source/frontend/src/features/properties/map/activity/detail/__snapshots__/ActivityView.test.tsx.snap
index c6bc966fac..34ca2b7d82 100644
--- a/source/frontend/src/features/properties/map/activity/detail/__snapshots__/ActivityView.test.tsx.snap
+++ b/source/frontend/src/features/properties/map/activity/detail/__snapshots__/ActivityView.test.tsx.snap
@@ -270,35 +270,6 @@ exports[`ActivityView test Renders as expected 1`] = `
margin-right: 0;
}
-.c7 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
- flex-direction: column;
- -webkit-align-items: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
- justify-content: center;
- margin-left: 0.5rem;
-}
-
-.c9 {
- width: 1.6rem;
- height: 1.6rem;
-}
-
-.c8 {
- width: 1.6rem;
- height: 1.6rem;
-}
-
.c4 {
float: right;
cursor: pointer;
@@ -317,44 +288,6 @@ exports[`ActivityView test Renders as expected 1`] = `
text-align: left;
}
-.c11 {
- width: 100%;
- -webkit-box-flex: 1;
- -webkit-flex-grow: 1;
- -ms-flex-positive: 1;
- flex-grow: 1;
- overflow-y: auto;
-}
-
-.c5 {
- border-radius: 0.5rem 0.5rem 0rem 0rem;
-}
-
-.c6 {
- border-left: 0.2rem solid white;
-}
-
-.c10 {
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- -webkit-flex-direction: column;
- -ms-flex-direction: column;
- flex-direction: column;
- -webkit-box-flex: 1;
- -webkit-flex-grow: 1;
- -ms-flex-positive: 1;
- flex-grow: 1;
- width: 100%;
- gap: 2.5rem;
- padding: 0;
-}
-
-.c12 {
- width: 100%;
-}
-
.c0 {
margin-bottom: 1.5rem;
}
@@ -453,739 +386,6 @@ exports[`ActivityView test Renders as expected 1`] = `
-
-
-
-
-
`;