forked from blockscout/frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from aurora-is-near/sync-17-06
Sync with origin
- Loading branch information
Showing
1,375 changed files
with
16,369 additions
and
11,105 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
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,116 @@ | ||
name: Copy issues labels to pull request | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_number: | ||
description: Pull request number | ||
required: true | ||
type: string | ||
issues: | ||
description: JSON encoded list of issue ids | ||
required: true | ||
type: string | ||
workflow_call: | ||
inputs: | ||
pr_number: | ||
description: Pull request number | ||
required: true | ||
type: string | ||
issues: | ||
description: JSON encoded list of issue ids | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
run: | ||
name: Run | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Find unique labels | ||
id: find_unique_labels | ||
uses: actions/github-script@v7 | ||
env: | ||
ISSUES: ${{ inputs.issues }} | ||
with: | ||
script: | | ||
const issues = JSON.parse(process.env.ISSUES); | ||
const WHITE_LISTED_LABELS = [ | ||
'client feature', | ||
'feature', | ||
'bug', | ||
'dependencies', | ||
'performance', | ||
'chore', | ||
'enhancement', | ||
'refactoring', | ||
'tech', | ||
'ENVs', | ||
] | ||
const labels = await Promise.all(issues.map(getIssueLabels)); | ||
const uniqueLabels = uniqueStringArray(labels.flat().filter((label) => WHITE_LISTED_LABELS.includes(label))); | ||
if (uniqueLabels.length === 0) { | ||
core.info('No labels found.\n'); | ||
return []; | ||
} | ||
core.info(`Found following labels: ${ uniqueLabels.join(', ') }.\n`); | ||
return uniqueLabels; | ||
async function getIssueLabels(issue) { | ||
core.info(`Obtaining labels list for the issue #${ issue }...`); | ||
try { | ||
const response = await github.request('GET /repos/{owner}/{repo}/issues/{issue_number}/labels', { | ||
owner: 'blockscout', | ||
repo: 'frontend', | ||
issue_number: issue, | ||
}); | ||
return response.data.map(({ name }) => name); | ||
} catch (error) { | ||
core.error(`Failed to obtain labels for the issue #${ issue }: ${ error.message }`); | ||
return []; | ||
} | ||
} | ||
function uniqueStringArray(array) { | ||
return Array.from(new Set(array)); | ||
} | ||
- name: Update pull request labels | ||
id: update_pr_labels | ||
uses: actions/github-script@v7 | ||
env: | ||
LABELS: ${{ steps.find_unique_labels.outputs.result }} | ||
PR_NUMBER: ${{ inputs.pr_number }} | ||
with: | ||
script: | | ||
const labels = JSON.parse(process.env.LABELS); | ||
const prNumber = Number(process.env.PR_NUMBER); | ||
if (labels.length === 0) { | ||
core.info('Nothing to update.\n'); | ||
return; | ||
} | ||
for (const label of labels) { | ||
await addLabelToPr(prNumber, label); | ||
} | ||
core.info('Done.\n'); | ||
async function addLabelToPr(prNumber, label) { | ||
console.log(`Adding label to the pull request #${ prNumber }...`); | ||
return await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/labels', { | ||
owner: 'blockscout', | ||
repo: 'frontend', | ||
issue_number: prNumber, | ||
labels: [ label ], | ||
}); | ||
} |
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ on: | |
type: choice | ||
options: | ||
- none | ||
- arbitrum | ||
- base | ||
- gnosis | ||
- eth | ||
|
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
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
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
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,21 @@ | ||
import type { Feature } from './types'; | ||
import type { DeFiDropdownItem } from 'types/client/deFiDropdown'; | ||
|
||
import { getEnvValue, parseEnvJson } from '../utils'; | ||
|
||
const items = parseEnvJson<Array<DeFiDropdownItem>>(getEnvValue('NEXT_PUBLIC_DEFI_DROPDOWN_ITEMS')) || []; | ||
|
||
const title = 'DeFi dropdown'; | ||
|
||
const config: Feature<{ items: Array<DeFiDropdownItem> }> = items.length > 0 ? | ||
Object.freeze({ | ||
title, | ||
isEnabled: true, | ||
items, | ||
}) : | ||
Object.freeze({ | ||
title, | ||
isEnabled: false, | ||
}); | ||
|
||
export default config; |
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,22 @@ | ||
import type { Feature } from './types'; | ||
|
||
import { getEnvValue } from '../utils'; | ||
import rollup from './rollup'; | ||
|
||
const title = 'Fault proof system'; | ||
|
||
const config: Feature<{ isEnabled: true }> = (() => { | ||
if (rollup.isEnabled && rollup.type === 'optimistic' && getEnvValue('NEXT_PUBLIC_FAULT_PROOF_ENABLED') === 'true') { | ||
return Object.freeze({ | ||
title, | ||
isEnabled: true, | ||
}); | ||
} | ||
|
||
return Object.freeze({ | ||
title, | ||
isEnabled: false, | ||
}); | ||
})(); | ||
|
||
export default config; |
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,29 @@ | ||
import type { Feature } from './types'; | ||
import type { MultichainProviderConfig } from 'types/client/multichainProviderConfig'; | ||
|
||
import { getEnvValue, parseEnvJson } from '../utils'; | ||
import marketplace from './marketplace'; | ||
|
||
const value = parseEnvJson<MultichainProviderConfig>(getEnvValue('NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG')); | ||
|
||
const title = 'Multichain balance'; | ||
|
||
const config: Feature<{name: string; logoUrl?: string; urlTemplate: string; dappId?: string }> = (() => { | ||
if (value) { | ||
return Object.freeze({ | ||
title, | ||
isEnabled: true, | ||
name: value.name, | ||
logoUrl: value.logo, | ||
urlTemplate: value.url_template, | ||
dappId: marketplace.isEnabled ? value.dapp_id : undefined, | ||
}); | ||
} | ||
|
||
return Object.freeze({ | ||
title, | ||
isEnabled: false, | ||
}); | ||
})(); | ||
|
||
export default config; |
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,29 @@ | ||
import type { Feature } from './types'; | ||
|
||
import services from '../services'; | ||
import { getEnvValue } from '../utils'; | ||
import addressMetadata from './addressMetadata'; | ||
|
||
const apiHost = getEnvValue('NEXT_PUBLIC_ADMIN_SERVICE_API_HOST'); | ||
|
||
const title = 'Public tag submission'; | ||
|
||
const config: Feature<{ api: { endpoint: string; basePath: string } }> = (() => { | ||
if (services.reCaptcha.siteKey && addressMetadata.isEnabled && apiHost) { | ||
return Object.freeze({ | ||
title, | ||
isEnabled: true, | ||
api: { | ||
endpoint: apiHost, | ||
basePath: '', | ||
}, | ||
}); | ||
} | ||
|
||
return Object.freeze({ | ||
title, | ||
isEnabled: false, | ||
}); | ||
})(); | ||
|
||
export default config; |
Oops, something went wrong.