Skip to content

Commit

Permalink
Merge branch 'main' into BC-4710-new-tldraw-manage
Browse files Browse the repository at this point in the history
  • Loading branch information
VikDavydiuk authored Oct 10, 2023
2 parents 5f682ea + 81cd33e commit 21223cb
Show file tree
Hide file tree
Showing 51 changed files with 1,576 additions and 1,191 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { FileRecordScanStatus, PreviewStatus } from "@/fileStorageApi/v3";
import {
FileRecordScanStatus,
PreviewStatus,
PreviewWidth,
} from "@/fileStorageApi/v3";
import NotifierModule from "@/store/notifier";
import { AnyContentElement } from "@/types/board/ContentElement";
import { convertDownloadToPreviewUrl } from "@/utils/fileHelper";
Expand All @@ -10,8 +14,8 @@ import { fileElementResponseFactory } from "@@/tests/test-utils/factory/fileElem
import { fileRecordResponseFactory } from "@@/tests/test-utils/factory/filerecordResponse.factory";
import { MountOptions, shallowMount } from "@vue/test-utils";
import Vue from "vue";
import FileContent from "./content/FileContent.vue";
import FileContentElement from "./FileContentElement.vue";
import FileContent from "./content/FileContent.vue";
import { FileProperties } from "./shared/types/file-properties";
import FileUpload from "./upload/FileUpload.vue";

Expand Down Expand Up @@ -131,7 +135,10 @@ describe("FileContentElement", () => {
name: fileRecordResponse.name,
isDownloadAllowed: true,
url: fileRecordResponse.url,
previewUrl: convertDownloadToPreviewUrl(fileRecordResponse.url),
previewUrl: convertDownloadToPreviewUrl(
fileRecordResponse.url,
PreviewWidth._500
),
size: fileRecordResponse.size,
previewStatus: fileRecordResponse.previewStatus,
element,
Expand Down Expand Up @@ -441,7 +448,10 @@ describe("FileContentElement", () => {
name: fileRecordResponse.name,
isDownloadAllowed: true,
url: fileRecordResponse.url,
previewUrl: convertDownloadToPreviewUrl(fileRecordResponse.url),
previewUrl: convertDownloadToPreviewUrl(
fileRecordResponse.url,
PreviewWidth._500
),
size: fileRecordResponse.size,
previewStatus: fileRecordResponse.previewStatus,
element,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</template>

<script lang="ts">
import { FileRecordParentType } from "@/fileStorageApi/v3";
import { FileRecordParentType, PreviewWidth } from "@/fileStorageApi/v3";
import { FileElementResponse } from "@/serverApi/v3";
import {
convertDownloadToPreviewUrl,
Expand Down Expand Up @@ -84,7 +84,7 @@ export default defineComponent({
}
const previewUrl = isPreviewPossible(fileRecord.value?.previewStatus)
? convertDownloadToPreviewUrl(fileRecord.value.url)
? convertDownloadToPreviewUrl(fileRecord.value.url, PreviewWidth._500)
: undefined;
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fileElementResponseFactory } from "@@/tests/test-utils";
import createComponentMocks from "@@/tests/test-utils/componentMocks";
import { shallowMount } from "@vue/test-utils";
import FileDescription from "./file-description/FileDescription.vue";
import FileDisplay from "./FileDisplay.vue";
import FileDescription from "./file-description/FileDescription.vue";
import ImageDisplay from "./image-display/ImageDisplay.vue";

describe("FileDisplay", () => {
Expand Down Expand Up @@ -48,6 +48,7 @@ describe("FileDisplay", () => {
const { wrapper, fileNameProp, previewUrlProp } = setup();

const props = wrapper.findComponent(ImageDisplay).attributes();

expect(props.name).toBe(fileNameProp);
expect(props.previewurl).toBe(previewUrlProp);
expect(props.iseditmode).toBe("true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div>
<ImageDisplay
v-if="fileProperties.previewUrl"
:url="fileProperties.url"
:preview-url="fileProperties.previewUrl"
:name="fileProperties.name"
:is-edit-mode="isEditMode"
Expand Down
Loading

0 comments on commit 21223cb

Please sign in to comment.