-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,460 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script setup lang="ts"> | ||
import { type EditorIncompleteUpload } from '@/lib/editor' | ||
interface Props { | ||
editorIncompleteUpload: EditorIncompleteUpload | ||
} | ||
interface Emits { | ||
(e: 'update:editorIncompleteUpload', ei: EditorIncompleteUpload): void | ||
} | ||
const props = defineProps<Props>() | ||
const emit = defineEmits<Emits>() | ||
const model = computed({ | ||
get: () => props.editorIncompleteUpload, | ||
set: (editorIncompleteUpload: EditorIncompleteUpload) => { emit('update:editorIncompleteUpload', editorIncompleteUpload) }, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<FormEditorField | ||
help-text="The name of this uploaded source file." | ||
:editor-field="model.name" | ||
> | ||
<PVInputText | ||
v-model="model.name.currentValue" | ||
/> | ||
</FormEditorField> | ||
<FormEditorField | ||
help-text="The description of this upload - helpful for record keeping, not used for anything." | ||
:editor-field="model.description" | ||
> | ||
<PVTextarea | ||
v-model="model.description.currentValue" | ||
auto-resize | ||
/> | ||
</FormEditorField> | ||
<FormEditorField | ||
help-text="When enabled, this upload can be accessed by administrators to help with debugging. Only turn this on if you're comfortable with system administrators accessing this data." | ||
:editor-field="model.adminDebugEnabled" | ||
> | ||
<ExplicitInputSwitch | ||
v-model:value="model.adminDebugEnabled.currentValue" | ||
on-label="Administrator Debugging Access Enabled" | ||
off-label="No Administrator Access Enabled" | ||
/> | ||
</FormEditorField> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script setup lang="ts"> | ||
import { type EditorPortfolio } from '@/lib/editor' | ||
interface Props { | ||
editorPortfolio: EditorPortfolio | ||
} | ||
interface Emits { | ||
(e: 'update:editorPortfolio', ei: EditorPortfolio): void | ||
} | ||
const props = defineProps<Props>() | ||
const emit = defineEmits<Emits>() | ||
const model = computed({ | ||
get: () => props.editorPortfolio, | ||
set: (editorPortfolio: EditorPortfolio) => { emit('update:editorPortfolio', editorPortfolio) }, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<FormEditorField | ||
help-text="The name of this portfolio." | ||
:editor-field="model.name" | ||
> | ||
<PVInputText | ||
v-model="model.name.currentValue" | ||
/> | ||
</FormEditorField> | ||
<FormEditorField | ||
help-text="The description of this portfolio - helpful for record keeping, not used for anything." | ||
:editor-field="model.description" | ||
> | ||
<PVTextarea | ||
v-model="model.description.currentValue" | ||
auto-resize | ||
/> | ||
</FormEditorField> | ||
<FormEditorField | ||
help-text="When enabled, this portfolio can be accessed by administrators to help with debugging. Only turn this on if you're comfortable with system administrators accessing this data." | ||
:editor-field="model.adminDebugEnabled" | ||
> | ||
<ExplicitInputSwitch | ||
v-model:value="model.adminDebugEnabled.currentValue" | ||
on-label="Administrator Debugging Access Enabled" | ||
off-label="No Administrator Access Enabled" | ||
/> | ||
</FormEditorField> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { type IncompleteUpload } from '@/openapi/generated/pacta' | ||
import { Validation, type EditorFieldsFor, type EditorComputedValues } from './common' | ||
import { getEditorComputedValues } from './utils' | ||
|
||
export type EditorIncompleteUpload = EditorFieldsFor<IncompleteUpload> | ||
|
||
const createEditorIncompleteUpload = (incompleteUpload: IncompleteUpload): EditorIncompleteUpload => { | ||
return { | ||
id: { | ||
name: 'id', | ||
label: 'ID', | ||
originalValue: incompleteUpload.id, | ||
currentValue: incompleteUpload.id, | ||
}, | ||
name: { | ||
name: 'name', | ||
label: 'Name', | ||
validation: [Validation.NotEmpty], | ||
originalValue: incompleteUpload.name, | ||
currentValue: incompleteUpload.name, | ||
}, | ||
description: { | ||
name: 'description', | ||
label: 'Description', | ||
originalValue: incompleteUpload.description, | ||
currentValue: incompleteUpload.description, | ||
}, | ||
adminDebugEnabled: { | ||
name: 'adminDebugEnabled', | ||
label: 'Admin Debugging Enabled', | ||
originalValue: incompleteUpload.adminDebugEnabled, | ||
currentValue: incompleteUpload.adminDebugEnabled, | ||
}, | ||
holdingsDate: { | ||
name: 'holdingsDate', | ||
label: 'Holdings Date', | ||
originalValue: incompleteUpload.holdingsDate, | ||
currentValue: incompleteUpload.holdingsDate, | ||
}, | ||
createdAt: { | ||
name: 'createdAt', | ||
label: 'Created At', | ||
originalValue: incompleteUpload.createdAt, | ||
currentValue: incompleteUpload.createdAt, | ||
}, | ||
ranAt: { | ||
name: 'ranAt', | ||
label: 'Ran At', | ||
originalValue: incompleteUpload.ranAt, | ||
currentValue: incompleteUpload.ranAt, | ||
}, | ||
completedAt: { | ||
name: 'completedAt', | ||
label: 'Completed At', | ||
originalValue: incompleteUpload.completedAt, | ||
currentValue: incompleteUpload.completedAt, | ||
}, | ||
failureMessage: { | ||
name: 'failureMessage', | ||
label: 'Failure Message', | ||
originalValue: incompleteUpload.failureMessage, | ||
currentValue: incompleteUpload.failureMessage, | ||
}, | ||
failureCode: { | ||
name: 'failureCode', | ||
label: 'Failure Code', | ||
originalValue: incompleteUpload.failureCode, | ||
currentValue: incompleteUpload.failureCode, | ||
}, | ||
} | ||
} | ||
|
||
export const incompleteUploadEditor = (i: IncompleteUpload): EditorComputedValues<IncompleteUpload> => { | ||
return getEditorComputedValues(`lib/editor/incompleteUpload[${i.id}]`, i, createEditorIncompleteUpload) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { type Portfolio } from '@/openapi/generated/pacta' | ||
import { Validation, type EditorFieldsFor, type EditorComputedValues } from './common' | ||
import { getEditorComputedValues } from './utils' | ||
|
||
export type EditorPortfolio = EditorFieldsFor<Portfolio> | ||
|
||
const createEditorPortfolio = (portfolio: Portfolio): EditorPortfolio => { | ||
return { | ||
id: { | ||
name: 'id', | ||
label: 'ID', | ||
originalValue: portfolio.id, | ||
currentValue: portfolio.id, | ||
}, | ||
name: { | ||
name: 'name', | ||
label: 'Name', | ||
validation: [Validation.NotEmpty], | ||
originalValue: portfolio.name, | ||
currentValue: portfolio.name, | ||
}, | ||
description: { | ||
name: 'description', | ||
label: 'Description', | ||
originalValue: portfolio.description, | ||
currentValue: portfolio.description, | ||
}, | ||
adminDebugEnabled: { | ||
name: 'adminDebugEnabled', | ||
label: 'Admin Debugging Enabled', | ||
originalValue: portfolio.adminDebugEnabled, | ||
currentValue: portfolio.adminDebugEnabled, | ||
}, | ||
holdingsDate: { | ||
name: 'holdingsDate', | ||
label: 'Holdings Date', | ||
originalValue: portfolio.holdingsDate, | ||
currentValue: portfolio.holdingsDate, | ||
}, | ||
createdAt: { | ||
name: 'createdAt', | ||
label: 'Created At', | ||
originalValue: portfolio.createdAt, | ||
currentValue: portfolio.createdAt, | ||
}, | ||
numberOfRows: { | ||
name: 'numberOfRows', | ||
label: 'Number of Rows', | ||
originalValue: portfolio.numberOfRows, | ||
currentValue: portfolio.numberOfRows, | ||
}, | ||
} | ||
} | ||
|
||
export const portfolioEditor = (i: Portfolio): EditorComputedValues<Portfolio> => { | ||
return getEditorComputedValues(`lib/editor/portfolio[${i.id}]`, i, createEditorPortfolio) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const formatFileSize = (bytes: number): string => { | ||
if (bytes === 0) return 'Empty' | ||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'] | ||
|
||
const k = 1024 | ||
const i = Math.floor(Math.log(bytes) / Math.log(k)) | ||
|
||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
frontend/openapi/generated/pacta/models/CompletePortfolioUploadReq.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* generated using openapi-typescript-codegen -- do no edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
|
||
import type { CompletePortfolioUploadReqItem } from './CompletePortfolioUploadReqItem'; | ||
|
||
export type CompletePortfolioUploadReq = { | ||
/** | ||
* The incomplete uploads that have been successfully uploaded to storage and are ready for parsing. | ||
*/ | ||
items: Array<CompletePortfolioUploadReqItem>; | ||
}; | ||
|
12 changes: 12 additions & 0 deletions
12
frontend/openapi/generated/pacta/models/CompletePortfolioUploadReqItem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* generated using openapi-typescript-codegen -- do no edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
|
||
export type CompletePortfolioUploadReqItem = { | ||
/** | ||
* The unique identifier for the uploaded asset | ||
*/ | ||
incomplete_upload_id: string; | ||
}; | ||
|
6 changes: 6 additions & 0 deletions
6
frontend/openapi/generated/pacta/models/CompletePortfolioUploadResp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* generated using openapi-typescript-codegen -- do no edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
|
||
export type CompletePortfolioUploadResp = Record<string, any>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* generated using openapi-typescript-codegen -- do no edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
|
||
export type HoldingsDate = { | ||
/** | ||
* The time at which the holdings are represented at | ||
*/ | ||
time: string; | ||
}; | ||
|
Oops, something went wrong.