Skip to content

Commit

Permalink
Merge pull request #355 from HathorNetwork/master
Browse files Browse the repository at this point in the history
[0.21.0] Start release process
  • Loading branch information
tuliomir authored Dec 17, 2024
2 parents 0d6897b + 102e1ec commit 82fe043
Show file tree
Hide file tree
Showing 111 changed files with 8,970 additions and 1,472 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
node: true,
},
extends: ['airbnb-base', 'plugin:react/recommended', 'plugin:prettier/recommended'],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true,
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: deploy

on:
push:
branches: [master]
branches: [release]
tags: ['v*']

permissions:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
retention-days: 1

deploy-testnet-explorer:
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/release'
needs: dependencies
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
make deploy site=testnet
deploy-nano-testnet-explorer:
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/release'
needs: dependencies
runs-on: ubuntu-latest
steps:
Expand All @@ -105,7 +105,7 @@ jobs:
make deploy site=nano-testnet
deploy-ekvilibro-testnet-explorer:
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/release'
needs: dependencies
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: PR validation

on:
push:
branches: [master, dev]
branches: [master, release]
pull_request:
branches:
- dev
- release
- master

jobs:
Expand Down Expand Up @@ -35,3 +35,7 @@ jobs:
- name: Format
run: |
npm run format:check
- name: Linting
run: |
npm run lint
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Create a git tag and a new release on GitHub.
## Deploying
Deploys are automated using Github Actions.

To deploy to the `testnet` website, simply commit to the `master` branch.
The `testnet` website will be deployed on commits to the `release` branch.

To deploy to the `mainnet` website, create a release in Github using a tag in the format `v0.0.0`. You should use the same version that you updated in the files in the previous section.
To deploy to the `mainnet` website, create a release in Github using a tag in the format `v0.0.0` and pointing to the `release` branch. You should use the same version that you updated in the files in the previous section.
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.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hathor-admin",
"version": "0.20.6",
"version": "0.21.0",
"engines": {
"node": ">=20.0.0",
"npm": ">=10.0.0"
Expand Down Expand Up @@ -37,15 +37,15 @@
"viz.js": "2.1.2"
},
"scripts": {
"build-css": "sass src:src",
"build-css": "sass src/index.scss:src/index.css && sass src/newUi.scss:src/newUi.css",
"watch-css": "npm run build-css && sass --watch src:src",
"start-js": "react-scripts --openssl-legacy-provider start",
"start": "npm-run-all -p watch-css start-js",
"build-js": "react-scripts --openssl-legacy-provider build",
"build": "npm-run-all build-css build-js",
"test": "react-scripts test --env=jsdom",
"lint": "eslint 'src/**/*.js'",
"lint:fix": "eslint 'src/**/*.js' --fix",
"lint:fix": "eslint src/**/*.js --fix",
"format": "prettier --write 'src/**/*.js'",
"format:check": "prettier --check 'src/**/*.js'",
"eject": "react-scripts eject"
Expand Down
20 changes: 15 additions & 5 deletions scripts/check_version
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
#!/bin/bash

SRC_VERSION=`grep "const VERSION " ./src/constants.js | cut -d"'" -f2`
set -e # Exit on any command failure.
set -u # Exit on unset variables.

PACKAGE_VERSION=`grep '"version":' ./package.json | cut -d '"' -f4`
PACKAGE_LOCK_VERSION=`node -p "require('./package-lock.json').version"`
PACKAGE_LOCK_VERSION_2=`node -p "require('./package-lock.json').packages[''].version"`

# For debugging:
# echo x${SRC_VERSION}x
# echo x${PACKAGE_VERSION}x
# echo x${PACKAGE_LOCK_VERSION}x
# echo x${PACKAGE_LOCK_VERSION_2}x

EXITCODE=0

if [[ x${PACKAGE_VERSION}x != x${SRC_VERSION}x ]]; then
echo Version different in package.json and src/constants.js
if [[ x${PACKAGE_VERSION}x != x${PACKAGE_LOCK_VERSION}x ]]; then
echo Version different in package.json and package-lock.json
EXITCODE=-1
fi

if [[ x${PACKAGE_VERSION}x != x${PACKAGE_LOCK_VERSION_2}x ]]; then
echo Version different in package.json and the packages property in package-lock.json
EXITCODE=-1
fi

exit $EXITCODE
exit $EXITCODE
36 changes: 21 additions & 15 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import React, { useCallback, useEffect } from 'react';
import { Switch, BrowserRouter as Router, Route } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
import { axios as hathorLibAxios, config as hathorLibConfig } from '@hathor/wallet-lib';
import { useTheme, useNewUiEnabled, useNewUiLoad } from './hooks';
import GDPRConsent from './components/GDPRConsent';
import Loading from './components/Loading';
import Navigation from './components/Navigation';
import Footer from './components/Footer';
import PeerAdmin from './screens/PeerAdmin';
import DashboardTx from './screens/DashboardTx';
import TransactionDetail from './screens/TransactionDetail';
Expand All @@ -28,6 +30,7 @@ import TokenDetail from './screens/TokenDetail';
import Dag from './screens/Dag';
import Dashboard from './screens/Dashboard';
import VersionError from './screens/VersionError';
import ErrorMessage from './components/error/ErrorMessage';
import WebSocketHandler from './WebSocketHandler';
import NanoContractDetail from './screens/nano/NanoContractDetail';
import BlueprintDetail from './screens/nano/BlueprintDetail';
Expand All @@ -44,17 +47,24 @@ import createRequestInstance from './api/customAxiosInstance';

hathorLibConfig.setServerUrl(BASE_URL);

const NavigationRoute = ({ internalScreen: InternalScreen }) => (
<div>
<Navigation />
<InternalScreen />
</div>
);
const NavigationRoute = ({ internalScreen: InternalScreen }) => {
const newUiEnabled = useNewUiEnabled();

return (
<div>
<Navigation />
<InternalScreen />
{newUiEnabled ? <Footer /> : ''}
</div>
);
};

function Root() {
useTheme();
const dispatch = useDispatch();
const isVersionAllowed = useSelector(state => state.isVersionAllowed);
const apiLoadError = useSelector(state => state.apiLoadError);
const newUiLoading = useNewUiLoad();

const handleWebsocket = useCallback(
wsData => {
Expand Down Expand Up @@ -97,15 +107,7 @@ function Root() {
<Router>
<>
<Navigation />
{apiLoadError ? (
<div className="content-wrapper">
<h3 className="text-danger">
Error loading the explorer. Please reload the page to try again.
</h3>
</div>
) : (
<Loading />
)}
{apiLoadError ? <ErrorMessage /> : <Loading />}
</>
</Router>
);
Expand All @@ -115,6 +117,10 @@ function Root() {
return <VersionError />;
}

if (newUiLoading) {
return <Loading />;
}

return (
<>
<Router>
Expand Down
12 changes: 12 additions & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/

import store from '../store/index';
import themeUtils from '../utils/theme';

export const dashboardUpdate = data => ({ type: 'dashboard_update', payload: data });

export const isVersionAllowedUpdate = data => ({
Expand All @@ -15,3 +18,12 @@ export const isVersionAllowedUpdate = data => ({
export const apiLoadErrorUpdate = data => ({ type: 'api_load_error_update', payload: data });

export const updateServerInfo = data => ({ type: 'update_server_info', payload: data });

export const toggleTheme = () => {
const state = store.getState();
const currentTheme = state.theme === 'light' ? 'dark' : 'light';

themeUtils.applyTheme(currentTheme);

return { type: 'toggle_theme', payload: currentTheme };
};
Binary file added src/assets/fonts/Mona-Sans.woff2
Binary file not shown.
Binary file added src/assets/fonts/MonaSans-Black.woff2
Binary file not shown.
Binary file added src/assets/fonts/MonaSans-Bold.woff2
Binary file not shown.
Binary file added src/assets/fonts/MonaSansCondensed-Light.woff2
Binary file not shown.
Binary file added src/assets/fonts/SFPRODISPLAYREGULAR.OTF
Binary file not shown.
Binary file added src/assets/fonts/SFProText-Light.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions src/assets/images/alert-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/alert-warning-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/arrow-down-nav-dropdown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/chevron-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/chevron-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/copy-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/download-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/global.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/icon-info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/leading-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/leading-top-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/images/logo-sidebar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/images/moon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 82fe043

Please sign in to comment.