Skip to content

Commit

Permalink
Merge pull request #1435 from ChainSafe/dev
Browse files Browse the repository at this point in the history
Release latest fixes and updates
  • Loading branch information
FSM1 authored Aug 12, 2021
2 parents fa99c60 + 7167faa commit b082dfc
Show file tree
Hide file tree
Showing 93 changed files with 1,325 additions and 2,080 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lingui-extract-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
ssh-key: ${{ secrets.LINGUI_GH_ACTION_COMMIT_KEY }}

- name: set user
run: |
git config --global user.name 'GitHub Actions'
Expand All @@ -32,6 +31,7 @@ jobs:
run: yarn install --immutable

- name: lingui-extract and commit
if: ${{ github.actor != 'weblate' }}
run: |
(cd packages/files-ui && yarn extract --clean)
git add packages/files-ui/src/locales/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lingui-extract-gaming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
ssh-key: ${{ secrets.LINGUI_GH_ACTION_COMMIT_KEY }}

- name: set user
run: |
git config --global user.name 'GitHub Actions'
Expand All @@ -31,7 +30,8 @@ jobs:
- name: install packages
run: yarn install --immutable

- name: lingui-extract
- name: lingui-extract and commit
if: ${{ github.actor != 'weblate' }}
run: |
(cd packages/gaming-ui && yarn extract --clean)
git add packages/gaming-ui/src/locales/*
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/lingui-extract-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
ssh-key: ${{ secrets.LINGUI_GH_ACTION_COMMIT_KEY }}

- name: set user
run: |
git config --global user.name 'GitHub Actions'
Expand All @@ -29,13 +28,10 @@ jobs:
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: install packages
env:
GITHUB_PACKAGES_AUTH_TOKEN: ${{ secrets.GH_PKG_AUTH_TOKEN }}
run: yarn install --immutable

- name: lingui-extract
env:
GITHUB_PACKAGES_AUTH_TOKEN: ${{ secrets.GH_PKG_AUTH_TOKEN }}
- name: lingui-extract and commit
if: ${{ github.actor != 'weblate' }}
run: |
(cd packages/storage-ui && yarn extract --clean)
git add packages/storage-ui/src/locales/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
cypress-run:
runs-on: ubuntu-latest
container: cypress/browsers:node14.16.0-chrome90-ff88
container: cypress/browsers:node14.17.0-chrome91-ff89
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion packages/common-components/src/Icons/svgs/eye-closed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/common-components/src/Icons/svgs/eye-open.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/common-components/src/TagsInput/TagsInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@chainsafe/common-theme"
import clsx from "clsx"
import AsyncSelect from "react-select/async"
import { Typography } from ".."
import { Typography } from "../Typography"
import { Styles, ValueType, ActionMeta, ActionTypes } from "react-select"

const useStyles = makeStyles(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { createStyles, ITheme, makeStyles } from "@chainsafe/common-theme"
import React, { ReactNode, useCallback, useMemo, useState } from "react"
import clsx from "clsx"
import { EyeClosedSvg } from "../Icons/icons/EyeClosed.icon"
import { EyeOpenSvg } from "../Icons/icons/EyeOpen.icon"

const useStyles = makeStyles(({ constants, overrides }: ITheme) =>
createStyles({
root: {
display: "inline-flex",
flexDirection: "row",
justifyContent: "flex-start",
alignItems: "center",
marginLeft: constants.generalUnit,
...overrides?.ToggleHiddenText?.root
},
icon: {
marginRight: constants.generalUnit,
cursor: "pointer",
...overrides?.ToggleHiddenText?.icon
}
})
)

interface IToggleHiddenText {
children: ReactNode
iconPosition?: "left" | "right"
hiddenLength?: number
className?: string
}

const ToggleHiddenText = ({ className, iconPosition = "left", hiddenLength = 6, children }: IToggleHiddenText) => {
const classes = useStyles()
const [hidden, setHidden] = useState(true)
const hiddenKey = useMemo(() => new Array(hiddenLength).fill("●"), [hiddenLength])

const EyeClosed = useCallback(() => <EyeClosedSvg
className={classes.icon}
onClick={() => setHidden(false)}
/>
, [classes.icon])

const EyeOpen = useCallback(() => <EyeOpenSvg
className={classes.icon}
onClick={() => setHidden(true)}
/>
, [classes.icon])

return (
<span className={clsx(classes.root, className)} >
{
hidden
? <>
{iconPosition === "left" && <EyeClosed />}
<span>{hiddenKey}</span>
{iconPosition === "right" && <EyeClosed />}
</>
: <>
{iconPosition === "left" && <EyeOpen />}
{children}
{iconPosition === "right" && <EyeOpen />}
</>
}
</span>
)
}

export default ToggleHiddenText
2 changes: 2 additions & 0 deletions packages/common-components/src/ToggleHiddenText/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as ToggleHiddenText } from "./ToggleHiddenText"
export * from "./ToggleHiddenText"
1 change: 1 addition & 0 deletions packages/common-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export * from "./Table"
export * from "./Tabs"
export * from "./TagsInput"
export * from "./Toaster"
export * from "./ToggleHiddenText"
export * from "./TextInput"
export * from "./TreeView"
export * from "./Typography"
Expand Down
4 changes: 4 additions & 0 deletions packages/common-theme/src/Overrides/ToggleHiddenText.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface IToggleHiddenText {
root?: Record<string, any>
icon?: Record<string, any>
}
2 changes: 2 additions & 0 deletions packages/common-theme/src/Overrides/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { ITextInputOverride } from "./TextInput"
import { IToasterOverride } from "./Toaster"
import { ITypographyOverride } from "./Typography"
import { ITagsInputOverride } from "./TagsInput"
import { IToggleHiddenText } from "./ToggleHiddenText"

export interface IComponentOverrides {
Avatar?: IAvatarOverride
Expand All @@ -50,6 +51,7 @@ export interface IComponentOverrides {
Tabs?: ITabsOverride
TextInput?: ITextInputOverride
Toaster?: IToasterOverride
ToggleHiddenText?: IToggleHiddenText
Typography?: ITypographyOverride
TagsInput?: ITagsInputOverride
}
3 changes: 2 additions & 1 deletion packages/files-ui/cypress.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"integrationFolder": "cypress/tests",
"video": false
"video": false,
"experimentalSessionSupport": true
}
1 change: 1 addition & 0 deletions packages/files-ui/cypress/fixtures/filesTestData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const folderName = "Testing"
11 changes: 0 additions & 11 deletions packages/files-ui/cypress/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
import { existsSync, readFileSync } from "fs"

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
Expand All @@ -21,16 +20,6 @@ export default (on: any) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config

on("task", {
readFileMaybe(filename: string) {
if (existsSync(filename)) {
return readFileSync(filename, "utf8")
}

return null
}
})

on("before:browser:launch", (browser: Cypress.Browser, launchOptions: Cypress.BrowserLaunchOptions) => {
if (browser.name === "chrome" && browser.isHeadless) {
// fullPage screenshot size is 1280x720 on non-retina screens
Expand Down
Loading

0 comments on commit b082dfc

Please sign in to comment.