Skip to content

Commit

Permalink
Removed file related unnecessary exports.
Browse files Browse the repository at this point in the history
  • Loading branch information
adcoelho committed May 11, 2023
1 parent 6a0ff8c commit 53135ec
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
5 changes: 0 additions & 5 deletions x-pack/plugins/cases/common/api/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
CASE_METRICS_DETAILS_URL,
CASE_COMMENTS_URL,
CASE_USER_ACTIONS_URL,
CASE_COMMENT_DETAILS_URL,
CASE_PUSH_URL,
CASE_CONFIGURE_DETAILS_URL,
CASE_ALERTS_URL,
Expand All @@ -36,10 +35,6 @@ export const getCaseCommentsUrl = (id: string): string => {
return CASE_COMMENTS_URL.replace('{case_id}', id);
};

export const getCaseCommentDetailsUrl = (caseId: string, commentId: string): string => {
return CASE_COMMENT_DETAILS_URL.replace('{case_id}', caseId).replace('{comment_id}', commentId);
};

export const getCaseFindAttachmentsUrl = (caseId: string): string => {
return CASE_FIND_ATTACHMENTS_URL.replace('{case_id}', caseId);
};
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/common/constants/mime_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* These were retrieved from https://www.iana.org/assignments/media-types/media-types.xhtml#image
*/
export const imageMimeTypes = [
const imageMimeTypes = [
'image/aces',
'image/apng',
'image/avci',
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/cases/public/components/files/utils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import type { JsonValue } from '@kbn/utility-types';

import {
compressionMimeTypes,
imageMimeTypes,
IMAGE_MIME_TYPES,
pdfMimeTypes,
textMimeTypes,
} from '../../../common/constants/mime_types';
import { basicFileMock } from '../../containers/mock';
import { isImage, isValidFileExternalReferenceMetadata, parseMimeType } from './utils';

const imageMimeTypes = Array.from(IMAGE_MIME_TYPES);

describe('isImage', () => {
it.each(imageMimeTypes)('should return true for image mime type: %s', (mimeType) => {
expect(isImage({ mimeType })).toBeTruthy();
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/cases/public/components/files/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {

import {
compressionMimeTypes,
imageMimeTypes,
IMAGE_MIME_TYPES,
textMimeTypes,
pdfMimeTypes,
} from '../../../common/constants/mime_types';
Expand All @@ -26,7 +26,7 @@ export const parseMimeType = (mimeType: string | undefined) => {
return i18n.UNKNOWN_MIME_TYPE;
}

if (imageMimeTypes.includes(mimeType)) {
if (IMAGE_MIME_TYPES.has(mimeType)) {
return i18n.IMAGE_MIME_TYPE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ export const useDeleteFileAttachment = () => {
}
);
};

export type UseDeleteFileAttachment = ReturnType<typeof useDeleteFileAttachment>;
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getTotalFromFileList = (data: { files: FileJSON[]; total: number }): { tot
total: data.total,
});

export interface GetCaseFileStatsParams {
interface GetCaseFileStatsParams {
caseId: string;
}

Expand Down

0 comments on commit 53135ec

Please sign in to comment.