Skip to content

Commit

Permalink
Merge branch 'main' into grady/more-analysis-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gbdubs committed Jan 20, 2024
2 parents 6315d2a + f21dbd5 commit 9390566
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 64 deletions.
8 changes: 4 additions & 4 deletions frontend/components/analysis/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,21 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
:value="editorObjects"
data-key="id"
size="small"
sort-field="editorValues.value.createdAt.originalValue"
sort-field="currentValue.value.createdAt"
:sort-order="-1"
>
<PVColumn selection-mode="multiple" />
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
:header="tt('Created At')"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
:header="tt('Name')"
/>
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/incompleteupload/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ const saveChanges = (id: string) => {
data-key="id"
class="w-full"
size="small"
sort-field="editorValues.value.createdAt.originalValue"
sort-field="currentValue.value.createdAt"
:sort-order="-1"
>
<PVColumn selection-mode="multiple" />
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
:header="tt('Name')"
/>
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
:header="tt('Created At')"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
Expand All @@ -115,7 +115,7 @@ const saveChanges = (id: string) => {
<div class="flex flex-column gap-2 w-fit">
<div class="flex gap-2 justify-content-between">
<span>Created At</span>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}</b>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}</b>
</div>
</div>
<!-- TODO(grady) add failure information here. -->
Expand Down
16 changes: 8 additions & 8 deletions frontend/components/portfolio/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
:value="editorObjects"
data-key="id"
size="small"
sort-field="editorValues.value.createdAt.originalValue"
sort-field="currentValue.value.createdAt"
:sort-order="-1"
>
<template #empty>
Expand All @@ -126,16 +126,16 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
</template>
<PVColumn selection-mode="multiple" />
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
:header="tt('Created At')"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
:header="tt('Name')"
/>
Expand All @@ -145,12 +145,12 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
<template #body="slotProps">
<div class="flex flex-column gap-2">
<div
v-if="slotProps.data.editorValues.value.groups.originalValue.length > 0"
v-if="slotProps.data.currentValue.value.groups.length > 0"
class="flex gap-1 align-items-center flex-wrap"
>
<span>{{ tt('Groups') }}:</span>
<LinkButton
v-for="membership in slotProps.data.editorValues.value.groups.originalValue"
v-for="membership in slotProps.data.currentValue.value.groups"
:key="membership.portfolioGroup.id"
class="p-button-outlined p-button-xs"
icon="pi pi-table"
Expand All @@ -159,12 +159,12 @@ const deleteSelected = () => Promise.all([selectedRows.value.map((row) => delete
/>
</div>
<div
v-if="slotProps.data.editorValues.value.initiatives.originalValue.length > 0"
v-if="slotProps.data.currentValue.value.initiatives.length > 0"
class="flex gap-1 align-items-center flex-wrap"
>
<span>{{ tt('Initiatives') }}:</span>
<LinkButton
v-for="membership in slotProps.data.editorValues.value.initiatives.originalValue"
v-for="membership in slotProps.data.currentValue.value.initiatives"
:key="membership.initiative.id"
class="p-button-xs"
:label="membership.initiative.name"
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/portfolio/group/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const saveChanges = (id: string) => {
)
}
const editorObjectToIds = (editorObject: EditorObject): string[] => {
return (editorObject.editorValues.value.members.originalValue ?? []).map((m: PortfolioGroupMembershipPortfolio) => m.portfolio.id)
return (editorObject.currentValue.value.members ?? []).map((m: PortfolioGroupMembershipPortfolio) => m.portfolio.id)
}
</script>

Expand Down Expand Up @@ -102,7 +102,7 @@ const editorObjectToIds = (editorObject: EditorObject): string[] => {
data-key="id"
class="w-full"
size="small"
sort-field="editorValues.value.createdAt.originalValue"
sort-field="currentValue.value.createdAt"
:sort-order="-1"
>
<template #empty>
Expand All @@ -112,17 +112,17 @@ const editorObjectToIds = (editorObject: EditorObject): string[] => {
</template>
<PVColumn selection-mode="multiple" />
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
:header="tt('Name')"
/>
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
:header="tt('Created At')"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
Expand Down
6 changes: 5 additions & 1 deletion frontend/components/standard/Nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ const menuStyles = computed(() => {
const menuItems = computed(() => {
const result: MenuItem[] = [
{
to: 'https://pacta.rmi.org',
external: true,
label: tt('About'),
},
{
to: localePath('/'),
label: tt('Home'),
},
]
if (isAdmin.value) {
result.push({
Expand Down
23 changes: 21 additions & 2 deletions frontend/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"Metadata": "Metadata",
"Number of Rows": "Number of Rows",
"Save Changes": "Save Changes",
"Refresh": "Refresh",
"Refresh": "Refresh"
},
"components/analysis/ListView": {
"Created At": "Created At",
Expand Down Expand Up @@ -239,7 +239,8 @@
},
"components/standard/Nav": {
"Admin": "Admin",
"Home": "Home",
"About": "About PACTA",
"Home": "Portfolio Analysis Tool",
"My Data": "My Data",
"Sign In": "Sign In",
"Sign Out": "Sign Out"
Expand Down Expand Up @@ -402,5 +403,23 @@
"Secondary Target ID": "Secondary Target ID",
"Secondary Target Owner": "Secondary Target Owner",
"Secondary Target Type": "Secondary Target Type"
},
"pages/index": {
"Heading": "PACTA for Investors",
"Subheading": "Measure the alignment of financial portfolios with climate scenarios",
"Description": "The Paris Agreement Capital Transition Assessment (PACTA) is an open-source and free of charge online software platform that enables users to measure the alignment of financial portfolios with climate scenarios as well as analyze specific companies.",
"Section1Heading": "How PACTA Works",
"Section1Paragraph1": "PACTA compares what needs to happen in climate-relevant sectors in order to minimize global temperature rises with financial institutions' exposure to companies in these sectors. It uses a dynamic, forward-looking approach, based on the 5-year production plans of companies in a financial institution's portfolio.",
"Section1Paragraph2": "The methodology measures alignment per sector or per technology, ensuring sector specific needs are included. For example, some sectors need to move more quickly than others; some need to reform (such as power generation); and others need to phase out (for instance, fossil fuels).",
"Section2Heading": "Portfolio Analysis Tool",
"Section2Paragraph1": "The PACTA tool to analyze listed equity and corporate bond portfolios was relaunched in March 2021 with a new interactive format. For the first time, investors can now analyze multiple portfolios simultaneously, save their results online, and receive interactive results on their alignment with the Paris climate goals.",
"Section2Paragraph2": "The tool is free to use, and requires a csv file including the ISIN, value and currency of the investment to run the analysis. For more information on how to format your portfolios for analysis, please see the Input User Guide.",
"Input User Guide": "Input User Guide",
"Section2Paragraph3": "All uploaded data and results are only visible to the user that uploaded them, and strict audit logs are maintained for your piece of mind. Portfolios can be deleted from the platform at any time by the user that uploaded them.",
"Sign In": "Sign In or Create an Account to Access the Tool",
"Get Started": "Get Started, Upload Portfolio(s)",
"Section4Heading": "About This Tool",
"Section4Paragraph1": "PACTA was originally developed by 2° Investing Initiative (2DII) with backing from UN Principles for Responsible Investment. In June 2022, 2DII transferred stewardship of PACTA to RMI, formerly Rocky Mountain Institute. In 2024, the PACTA for Investors tool was modernized by Silicon Ally, a software development non-profit. The code for this tool, as well as the analysis code for PACTA is open source.",
"Section4CTA": "Learn More About PACTA"
}
}
16 changes: 8 additions & 8 deletions frontend/pages/incomplete-uploads.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ const deleteAll = () => withLoading(
class="incomplete-upload-table"
>
<PVColumn
field="editorValues.value.createdAt.originalValue"
field="currentValue.value.createdAt"
header="Created At"
sortable
>
<template #body="slotProps">
{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}
{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}
</template>
</PVColumn>
<PVColumn
field="editorValues.value.name.originalValue"
field="currentValue.value.name"
sortable
header="Name"
/>
Expand All @@ -99,23 +99,23 @@ const deleteAll = () => withLoading(
<div class="flex flex-column gap-2 w-fit">
<div class="flex gap-2 justify-content-between">
<span>Created At</span>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.editorValues.value.createdAt.originalValue).value }}</b>
<b>{{ humanReadableTimeFromStandardString(slotProps.data.currentValue.value.createdAt).value }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>Ran At</span>
<b>{{ slotProps.data.editorValues.value.ranAt.originalValue ? humanReadableTimeFromStandardString(slotProps.data.editorValues.value.ranAt.originalValue).value : 'N/A' }}</b>
<b>{{ slotProps.data.currentValue.value.ranAt ? humanReadableTimeFromStandardString(slotProps.data.currentValue.value.ranAt).value : 'N/A' }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>Completed At</span>
<b>{{ slotProps.data.editorValues.value.completedAt.originalValue ? humanReadableTimeFromStandardString(slotProps.data.editorValues.value.completedAt.originalValue).value : 'N/A' }}</b>
<b>{{ slotProps.data.currentValue.value.completedAt ? humanReadableTimeFromStandardString(slotProps.data.currentValue.value.completedAt).value : 'N/A' }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>Failure Code</span>
<b>{{ slotProps.data.editorValues.value.failureCode.originalValue ?? 'N/A' }}</b>
<b>{{ slotProps.data.currentValue.value.failureCode ?? 'N/A' }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>Failure Message</span>
<b>{{ slotProps.data.editorValues.value.failureMessage.originalValue ?? 'N/A' }}</b>
<b>{{ slotProps.data.currentValue.value.failureMessage ?? 'N/A' }}</b>
</div>
<div class="flex gap-2 justify-content-between">
<span>ID</span>
Expand Down
Loading

0 comments on commit 9390566

Please sign in to comment.