Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.2.5 #5

Merged
merged 21 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a86e769
feat: add iframe message listener
MichaelTaylor3D Aug 15, 2023
4b220a6
fix: clean up listener
MichaelTaylor3D Aug 15, 2023
c729618
Update to digicert hsm signing
cmmarslender Aug 15, 2023
29e8aed
Run the find in bash
cmmarslender Aug 15, 2023
0fb304a
Fix find command to just find the installer, not the other exes in su…
cmmarslender Aug 15, 2023
ab211dc
Try quoting file for signing
cmmarslender Aug 15, 2023
94286e2
Merge pull request #1104 from Chia-Network/update-windows-signing
TheLastCicada Aug 15, 2023
2b5e86e
Merge pull request #1103 from Chia-Network/feat/iframe-message
TheLastCicada Aug 15, 2023
1e80d44
feat: hide connect
MichaelTaylor3D Aug 16, 2023
0005fdf
Merge pull request #1 from Chia-Network/feat/hide-connect
MichaelTaylor3D Aug 16, 2023
0d890cd
feat: hide header when in iframe
MichaelTaylor3D Aug 16, 2023
606922d
Merge pull request #2 from Chia-Network/feat/hide-connect
MichaelTaylor3D Aug 16, 2023
64a4dd2
build: update package.json with name of fork
TheLastCicada Aug 16, 2023
ecb282b
ci: update name to core-registry-cadt
TheLastCicada Aug 16, 2023
35c3f20
ci: push releases to new apt repo
TheLastCicada Aug 16, 2023
319abae
docs: name change for this fork
TheLastCicada Aug 16, 2023
9f4b1ce
Merge branch 'develop' into core-registry-naming-updates
TheLastCicada Aug 16, 2023
5c31d3c
feat: namespace localstorage keys
MichaelTaylor3D Aug 17, 2023
f210cbb
Merge pull request #3 from Chia-Network/core-registry-naming-updates
TheLastCicada Aug 17, 2023
01bc882
chore: bump version 1.2.5
TheLastCicada Aug 17, 2023
661afe1
Merge pull request #4 from Chia-Network/bump-1.2.5
TheLastCicada Aug 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
check-version:
name: Check version increment
name: Tag and Create Changelog
runs-on: ubuntu-latest
steps:
- name: Clean workspace
Expand Down
78 changes: 52 additions & 26 deletions .github/workflows/build-installers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@ jobs:
npm install -g notarize-cli
notarize-cli \
--file="$DMG_FILE" \
--bundle-id net.chia.cadt-ui \
--bundle-id net.chia.core-registry-cadt-ui \
--username "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \
--password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}"

- name: Upload Mac Installer
uses: actions/upload-artifact@v3
with:
name: cadt-ui-mac-installer
name: core-registry-cadt-ui-mac-installer
path: ${{ github.workspace }}/dist/*.dmg


build_windows:
name: Build Windows Installer
runs-on: windows-2019
Expand All @@ -92,17 +93,31 @@ jobs:
npm install

- name: Build electron app
env:
CSC_LINK: ${{ secrets.WIN_CODE_SIGN_CERT }}
CSC_KEY_PASSWORD: ${{ secrets.WIN_CODE_SIGN_PASSWORD }}
run: npm run electron:package:win

# Windows Code Signing
- name: Get installer name for signing
shell: bash
run: |
FILE=$(find dist -type f -maxdepth 1 -name '*.exe')
echo "Installer file is $FILE"
echo "INSTALLER_FILE=$FILE" >> "$GITHUB_ENV"

- name: Sign windows artifacts
uses: chia-network/actions/digicert/windows-sign@main
with:
sm_api_key: ${{ secrets.SM_API_KEY }}
sm_client_cert_file_b64: ${{ secrets.SM_CLIENT_CERT_FILE_B64 }}
sm_client_cert_password: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
sm_code_signing_cert_sha1_hash: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
file: "${{ github.workspace }}/${{ env.INSTALLER_FILE }}"

- name: Upload Windows Installer
uses: actions/upload-artifact@v3
with:
name: cadt-ui-windows-installer
path: ${{ github.workspace }}/dist/*.exe

name: core-registry-cadt-ui-windows-installer
path: "${{ github.workspace }}/${{ env.INSTALLER_FILE }}"
build_linux:
name: Build Linux Installer
runs-on: ubuntu-latest
Expand Down Expand Up @@ -135,7 +150,7 @@ jobs:
- name: Upload Linux Installer
uses: actions/upload-artifact@v3
with:
name: cadt-ui-linux-installer
name: core-registry-cadt-ui-linux-installer
path: ${{ github.workspace }}/dist/*.deb

build_web:
Expand All @@ -160,13 +175,13 @@ jobs:
npm run build

- name: Create .tar.gz of the web build
run: tar -cvzf cadt-ui-web-build.tar.gz build
run: tar -cvzf core-registry-cadt-ui-web-build.tar.gz build

- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: cadt-ui-web-build
path: cadt-ui-web-build.tar.gz
name: core-registry-cadt-ui-web-build
path: core-registry-cadt-ui-web-build.tar.gz

release:
runs-on: ubuntu-latest
Expand All @@ -180,33 +195,33 @@ jobs:
- name: Download Windows artifacts
uses: actions/download-artifact@v3
with:
name: cadt-ui-windows-installer
path: cadt-ui-windows-installer
name: core-registry-cadt-ui-windows-installer
path: core-registry-cadt-ui-windows-installer

- name: Download MacOS artifacts
uses: actions/download-artifact@v3
with:
name: cadt-ui-mac-installer
path: cadt-ui-mac-installer
name: core-registry-cadt-ui-mac-installer
path: core-registry-cadt-ui-mac-installer

- name: Download Linux artifacts
uses: actions/download-artifact@v3
with:
name: cadt-ui-linux-installer
path: cadt-ui-linux-installer
name: core-registry-cadt-ui-linux-installer
path: core-registry-cadt-ui-linux-installer

- name: Download Web artifact
uses: actions/download-artifact@v3
with:
name: cadt-ui-web-build
path: cadt-ui-web-build
name: core-registry-cadt-ui-web-build
path: core-registry-cadt-ui-web-build

- name: Get Filenames
run: |
DMG_FILE=$(find ${{ github.workspace }}/cadt-ui-mac-installer/ -type f -name '*.dmg')
DEB_FILE=$(find ${{ github.workspace }}/cadt-ui-linux-installer/ -type f -name '*.deb')
EXE_FILE=$(find ${{ github.workspace }}/cadt-ui-windows-installer/ -type f -name '*.exe')
WEB_FILE=$(find ${{ github.workspace }}/cadt-ui-web-build/ -type f -name '*.tar.gz')
DMG_FILE=$(find ${{ github.workspace }}/core-registry-cadt-ui-mac-installer/ -type f -name '*.dmg')
DEB_FILE=$(find ${{ github.workspace }}/core-registry-cadt-ui-linux-installer/ -type f -name '*.deb')
EXE_FILE=$(find ${{ github.workspace }}/core-registry-cadt-ui-windows-installer/ -type f -name '*.exe')
WEB_FILE=$(find ${{ github.workspace }}/core-registry-cadt-ui-web-build/ -type f -name '*.tar.gz')

echo "DMG_FILE=$DMG_FILE" >>$GITHUB_ENV
echo "DEB_FILE=$DEB_FILE" >>$GITHUB_ENV
Expand All @@ -222,7 +237,18 @@ jobs:
${{ env.EXE_FILE }}
${{ env.WEB_FILE }}

- name: Get tag name
id: tag-name
run: |
echo "TAGNAME=$(echo $GITHUB_REF | cut -d / -f 3)" >>$GITHUB_OUTPUT

- name: Get repo name
id: repo-name
run: |
echo "REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 2)" >>$GITHUB_OUTPUT

- name: Trigger apt repo update
run: |
curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"cadt_repo":"cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/cadt/${{ github.sha }}/start
curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"cadt_repo":"cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/cadt/${{ github.sha }}/success/deploy
curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"climate_tokenization_repo":"${{ steps.repo-name.outputs.REPO_NAME }}","application_name":"core-registry-cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}","add_debian_version":"true","arm64":"false"}' ${{ secrets.GLUE_API_URL }}/api/v1/climate-tokenization/${{ github.sha }}/start
curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"climate_tokenization_repo":"${{ steps.repo-name.outputs.REPO_NAME }}","application_name":"core-registry-cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}","add_debian_version":"true","arm64":"false"}' ${{ secrets.GLUE_API_URL }}/api/v1/climate-tokenization/${{ github.sha }}/success/deploy

67 changes: 0 additions & 67 deletions .github/workflows/deploy-s3.yml

This file was deleted.

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Climate Action Data Trust User Interface
# Core Registry Climate Action Data Trust User Interface

This repository provides a graphical user interface (UI) for the [Climate Action Data Trust (CADT)](https://github.com/Chia-Network/cadt) application. CADT interfaces with the Chia Blockchain software and provides and API for entering and retrieving carbon data. This UI is a javascript application that connects to the CADT API for a convenient way to access the data.
This project is a fork of the [Climate Action Data Trust UI](https://github.com/Chia-Network/cadt-ui) and provides enhancements and compatability improvements for the Core Registry suite of tools. This repository provides a graphical user interface (UI) for the [Core Registry Climate Action Data Trust (CADT)](https://github.com/Chia-Network/core-registry-cadt) application. CADT interfaces with the Chia Blockchain software and provides and API for entering and retrieving carbon data. This UI is a javascript application that connects to the Core Registry CADT API for a convenient way to access the data.

*Note that this application was previously called the Climate Warehouse UI and that name may be used interchangeably in documentation and throughout this application.*

Expand All @@ -11,11 +11,11 @@ The UI application can be hosted as a web application and accessed via the brows

### Desktop Applications

The [releases](https://github.com/Chia-Network/cadt-ui/releases) page provides desktop applications packaged for Windows, Mac, and Debian-based Linux distributions.
The [releases](https://github.com/Chia-Network/core-registry-cadt-ui/releases) page provides desktop applications packaged for Windows, Mac, and Debian-based Linux distributions.

#### Ubuntu Desktop via Apt

For Ubuntu-based Linux desktops the CADT UI is available for install with `apt`.
For Ubuntu-based Linux desktops the Core Registry CADT UI is available for install with `apt`.

1. Start by updating apt and allowing repository download over HTTPS:

Expand Down Expand Up @@ -46,15 +46,15 @@ sudo apt-get install cadt-ui

### Web Application

The Climate Warehouse UI can be hosted as a web application, either for internal use, or made available to the public. When operating as a web application, the user's browser must be able to connect to the [CADT API](https://github.com/Chia-Network/cadt). This means the API must be available on the public internet if the UI is public. The `READ_ONLY` option on the API should be set when running a public observer node.
The Core Registry CADT UI can be hosted as a web application, either for internal use, or made available to the public. When operating as a web application, the user's browser must be able to connect to the [Core Registry CADT API](https://github.com/Chia-Network/core-registry-cadt). This means the API must be available on the public internet if the UI is public. The `READ_ONLY` option on the API should be set when running a public observer node.

To host the UI on the web, use the [web-build.tar.gz file from the releases page](https://github.com/Chia-Network/cadt-ui/releases). One of the simplest solutions is to uncompress these files into a [public S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteAccessPermissionsReqd.html). These files could also be served by any webserver, such as Nginx or Apache.
To host the UI on the web, use the [web-build.tar.gz file from the releases page](https://github.com/Chia-Network/core-registry-cadt-ui/releases). One of the simplest solutions is to uncompress these files into a [public S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteAccessPermissionsReqd.html). These files could also be served by any webserver, such as Nginx or Apache.

### From Source

```
npm install -g react-scripts
git clone [email protected]:Chia-Network/cadt-ui.git
git clone [email protected]:Chia-Network/core-registry-cadt-ui.git
cd climate-warehouse-ui
nvm install 18.16.0
nvm use 18.16.0
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cadt-ui",
"version": "1.2.4",
"name": "core-registry-cadt-ui",
"version": "1.2.5",
"private": true,
"author": "Chia Network Inc. <[email protected]>",
"homepage": "./",
Expand Down Expand Up @@ -102,7 +102,7 @@
},
"build": {
"appId": "org.worldbank.climate-action-data-trust",
"productName": "cadt-ui",
"productName": "core-registry-cadt-ui",
"files": [
"build/**/*",
"node_modules/**/*"
Expand All @@ -127,9 +127,9 @@
},
"linux": {
"target": "deb",
"description": "Climate Action Data Trust user interface desktop application. Allows point-and-click interface for the CADT API application.",
"description": "Core Registry Climate Action Data Trust user interface desktop application. Allows point-and-click interface for the Core Registry CADT API application.",
"maintainer": "Chia Network Inc <[email protected]>",
"vendor": "https://climateactiondata.org/",
"vendor": "https://www.chia.net/",
"publish": null,
"icon": "src/assets/img/CADT_Icon.png",
"desktop": {
Expand Down
33 changes: 33 additions & 0 deletions src/components/blocks/MyAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,39 @@ const MyAccount = ({ openModal = false, onClose, isHeader = true }) => {
}
}, []);

useEffect(() => {
// Function to handle the message event
const handleMessage = event => {
if (event.origin !== window.location.origin) {
return;
}
console.log('Received message:', event.data);
if (
event?.data?.serverAddress &&
validateUrl(event?.data?.serverAddress)
) {
dispatch(
signIn({
apiKey: event?.data?.apiKey,
serverAddress: event?.data?.serverAddress,
}),
);
setServerAddress(null);
setApiKey(null);
setIsLogInModalOpen(false);
}
};

// Add the event listener
window.addEventListener('message', handleMessage, false);

// Return a function that will be called when the component unmounts
return () => {
// Remove the event listener
window.removeEventListener('message', handleMessage, false);
};
}, []);

return (
<StyledMyAccountContainer>
{isHeader && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const InnerContainer = styled('div')`
const Dashboard = withTheme(({ children }) => {
return (
<Main>
<Header />
{window.self === window.top && <Header />}
<InnerContainer>
<ErrorBoundary>
<LeftNav />
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Header = () => {
</Body>
)}
</HomeOrgUidContainer>
<MyAccount />
{window.self === window.top && <MyAccount />}
<LocaleSwitcher />
</StyledLocalContainer>
</Headline>
Expand Down
2 changes: 1 addition & 1 deletion src/navigation/AppNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const AppNavigator = () => {
return (
<AppContainer>
{showProgressOverlay && <IndeterminateProgressOverlay />}
{!connectionCheck ? (
{!connectionCheck && window.self === window.top ? (
<MyAccount
openModal={true}
onClose={() => dispatch(getOrganizationData())}
Expand Down
Loading
Loading