mirror of
https://github.com/SomboChea/ui
synced 2026-01-12 22:25:52 +07:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
233ba196a0 | ||
|
|
c9fb3c4c50 | ||
|
|
3d752e079c | ||
|
|
7f07a322f4 | ||
|
|
9ffa6290cc | ||
|
|
47b98c5550 | ||
|
|
da4ac7e851 | ||
|
|
c960fa76db | ||
|
|
5e43ac0d49 | ||
|
|
4e899a8574 |
168
.circleci/config.yml
Normal file
168
.circleci/config.yml
Normal file
@@ -0,0 +1,168 @@
|
||||
version: 2
|
||||
|
||||
aliases:
|
||||
- &defaults
|
||||
working_directory: ~/ui-theme
|
||||
- &node11_executor
|
||||
docker:
|
||||
- image: circleci/node:11.10.1
|
||||
- &node8_executor
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
- &node10_executor
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
- &default_executor
|
||||
<<: *node10_executor
|
||||
- &repo_key
|
||||
repo-{{ .Branch }}-{{ .Revision }}
|
||||
- &coverage_key
|
||||
coverage-{{ .Branch }}-{{ .Revision }}
|
||||
- &base_config_key
|
||||
base-config-{{ .Branch }}-{{ .Revision }}
|
||||
- &yarn_cache_key
|
||||
yarn-sha-{{ checksum "yarn.lock" }}
|
||||
- &restore_repo
|
||||
restore_cache:
|
||||
keys:
|
||||
- *repo_key
|
||||
- &ignore_non_dev_branches
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
branches:
|
||||
ignore:
|
||||
- /release\/.*/
|
||||
- &execute_on_release
|
||||
filters:
|
||||
tags:
|
||||
only: /(v)?[0-9]+(\.[0-9]+)*/
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
<<: *defaults
|
||||
<<: *default_executor
|
||||
steps:
|
||||
- *restore_repo
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: *base_config_key
|
||||
- run:
|
||||
name: 'Base environment setup'
|
||||
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
||||
- save_cache:
|
||||
key: *base_config_key
|
||||
paths:
|
||||
- ~/.npmrc
|
||||
- ~/.gitconfig
|
||||
- restore_cache:
|
||||
key: *yarn_cache_key
|
||||
- run:
|
||||
name: Install Js dependencies
|
||||
command: yarn install --no-progress --registry https://registry.verdaccio.org --no-lockfile
|
||||
- run:
|
||||
name: Build project
|
||||
command: yarn run build
|
||||
- save_cache:
|
||||
key: *yarn_cache_key
|
||||
paths:
|
||||
- ~/.yarn
|
||||
- ~/.cache/yarn
|
||||
- node_modules
|
||||
- save_cache:
|
||||
key: *repo_key
|
||||
paths:
|
||||
- ~/ui-theme
|
||||
|
||||
test_node11:
|
||||
<<: *defaults
|
||||
<<: *node11_executor
|
||||
steps:
|
||||
- *restore_repo
|
||||
- run:
|
||||
name: Test with Node 11
|
||||
command: yarn run test
|
||||
|
||||
test_node8:
|
||||
<<: *defaults
|
||||
<<: *node8_executor
|
||||
steps:
|
||||
- *restore_repo
|
||||
- run:
|
||||
name: Test with Node 8
|
||||
command: yarn test
|
||||
|
||||
test_node10:
|
||||
<<: *defaults
|
||||
<<: *node10_executor
|
||||
steps:
|
||||
- *restore_repo
|
||||
- run:
|
||||
name: Test with Node 10
|
||||
command: yarn run test
|
||||
- save_cache:
|
||||
key: *coverage_key
|
||||
paths:
|
||||
- coverage
|
||||
|
||||
coverage:
|
||||
<<: *defaults
|
||||
<<: *default_executor
|
||||
steps:
|
||||
- *restore_repo
|
||||
- restore_cache:
|
||||
key: *coverage_key
|
||||
- run:
|
||||
name: Publish coverage
|
||||
command: yarn run coverage:publish
|
||||
- store_artifacts:
|
||||
path: coverage/clover.xml
|
||||
prefix: tests
|
||||
- store_artifacts:
|
||||
path: coverage
|
||||
prefix: coverage
|
||||
- store_test_results:
|
||||
path: coverage/clover.xml
|
||||
|
||||
publish_package:
|
||||
<<: *defaults
|
||||
<<: *default_executor
|
||||
steps:
|
||||
- *restore_repo
|
||||
- restore_cache:
|
||||
key: *base_config_key
|
||||
- run:
|
||||
name: Publish
|
||||
command: yarn publish
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
workflow:
|
||||
jobs:
|
||||
- prepare:
|
||||
<<: *ignore_non_dev_branches
|
||||
- test_node11:
|
||||
requires:
|
||||
- prepare
|
||||
<<: *ignore_non_dev_branches
|
||||
- test_node8:
|
||||
requires:
|
||||
- prepare
|
||||
<<: *ignore_non_dev_branches
|
||||
- test_node10:
|
||||
requires:
|
||||
- prepare
|
||||
<<: *ignore_non_dev_branches
|
||||
- coverage:
|
||||
requires:
|
||||
- test_node11
|
||||
- test_node8
|
||||
- test_node10
|
||||
<<: *ignore_non_dev_branches
|
||||
- publish_package:
|
||||
requires:
|
||||
- coverage
|
||||
<<: *execute_on_release
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
## npm
|
||||
/*
|
||||
!/static/*
|
||||
!/static/**/*
|
||||
!index.js
|
||||
!README.md
|
||||
|
||||
|
||||
30
CHANGELOG.md
30
CHANGELOG.md
@@ -2,6 +2,36 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="0.1.7"></a>
|
||||
## [0.1.7](https://github.com/verdaccio/ui/compare/v0.1.6...v0.1.7) (2019-05-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* search suggestion container height ([#54](https://github.com/verdaccio/ui/issues/54)) ([c9fb3c4](https://github.com/verdaccio/ui/commit/c9fb3c4))
|
||||
|
||||
|
||||
|
||||
<a name="0.1.6"></a>
|
||||
## [0.1.6](https://github.com/verdaccio/ui/compare/v0.1.5...v0.1.6) (2019-05-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* pattern allow yarn to add all files on pack ([#50](https://github.com/verdaccio/ui/issues/50)) ([9ffa629](https://github.com/verdaccio/ui/commit/9ffa629))
|
||||
|
||||
|
||||
|
||||
<a name="0.1.5"></a>
|
||||
## [0.1.5](https://github.com/verdaccio/ui/compare/v0.1.4...v0.1.5) (2019-05-04)
|
||||
|
||||
|
||||
|
||||
<a name="0.1.4"></a>
|
||||
## [0.1.4](https://github.com/verdaccio/ui/compare/v0.1.3...v0.1.4) (2019-05-04)
|
||||
|
||||
|
||||
|
||||
<a name="0.1.3"></a>
|
||||
## [0.1.3](https://github.com/verdaccio/ui/compare/v0.1.2...v0.1.3) (2019-05-04)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/ui-theme",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.7",
|
||||
"description": "Verdaccio User Interface",
|
||||
"author": {
|
||||
"name": "Verdaccio Core Team"
|
||||
|
||||
13
scripts/gh_publish.sh
Executable file
13
scripts/gh_publish.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the last tag from GitHub
|
||||
lastTag=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
|
||||
# Print it to the console for verification
|
||||
echo "Bumping version to new tag: ${lastTag}"
|
||||
|
||||
# creating .npmrc
|
||||
echo "//$REGISTRY_URL/:_authToken=$REGISTRY_AUTH_TOKEN" > .npmrc
|
||||
|
||||
# Publish to NPM
|
||||
npm publish --registry https://$REGISTRY_URL/
|
||||
@@ -6,8 +6,5 @@ lastTag=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
# Print it to the console for verification
|
||||
echo "Bumping version to new tag: ${lastTag}"
|
||||
|
||||
# creating .npmrc
|
||||
echo "//$REGISTRY_URL/:_authToken=$REGISTRY_AUTH_TOKEN" > .npmrc
|
||||
|
||||
# Publish to NPM
|
||||
npm publish --registry https://$REGISTRY_URL/
|
||||
npm publish
|
||||
|
||||
@@ -8,11 +8,10 @@ import type { Node } from 'react';
|
||||
import Autosuggest from 'react-autosuggest';
|
||||
import match from 'autosuggest-highlight/match';
|
||||
import parse from 'autosuggest-highlight/parse';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import MenuItem from '@material-ui/core/MenuItem';
|
||||
|
||||
import { fontWeight } from '../../utils/styles/sizes';
|
||||
import { Wrapper, InputField } from './styles';
|
||||
import { Wrapper, InputField, SuggestionContainer } from './styles';
|
||||
import { IProps } from './types';
|
||||
|
||||
const renderInputComponent = (inputProps): Node => {
|
||||
@@ -110,12 +109,12 @@ const AutoComplete = ({
|
||||
// this format avoid arrow function eslint rule
|
||||
function renderSuggestionsContainer({ containerProps, children, query }) {
|
||||
return (
|
||||
<Paper {...containerProps} square={true}>
|
||||
<SuggestionContainer {...containerProps} square={true}>
|
||||
{suggestionsLoaded && children === null && query && renderMessage(SUGGESTIONS_RESPONSE.NO_RESULT)}
|
||||
{suggestionsLoading && query && renderMessage(SUGGESTIONS_RESPONSE.LOADING)}
|
||||
{suggestionsError && renderMessage(SUGGESTIONS_RESPONSE.FAILURE)}
|
||||
{children}
|
||||
</Paper>
|
||||
</SuggestionContainer>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import styled, { css } from 'react-emotion';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
|
||||
import TextField from '../TextField';
|
||||
import { IInputField } from './types';
|
||||
@@ -50,3 +51,10 @@ export const InputField = ({ color, ...others }: IInputField) => (
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
export const SuggestionContainer = styled(Paper)`
|
||||
&& {
|
||||
max-height: 500px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
`;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<Search /> component test should load the component in default state 1`] = `"<div class=\\"css-1crzyyo e18292mt0\\"><div role=\\"combobox\\" aria-haspopup=\\"listbox\\" aria-owns=\\"react-autowhatever-1\\" aria-expanded=\\"false\\" class=\\"react-autosuggest__container\\"><div class=\\"MuiFormControl-root-1 MuiFormControl-fullWidth-4 react-autosuggest__input\\" aria-autocomplete=\\"list\\" aria-controls=\\"react-autowhatever-1\\"><div class=\\"MuiInputBase-root-18 MuiInput-root-5 css-n9ojyg MuiInput-underline-9 MuiInputBase-fullWidth-27 MuiInput-fullWidth-12 MuiInputBase-formControl-19 MuiInput-formControl-6 MuiInputBase-adornedStart-22\\"><div class=\\"MuiInputAdornment-root-35 MuiInputAdornment-positionStart-37\\" style=\\"color: rgb(255, 255, 255);\\"><svg class=\\"MuiSvgIcon-root-40\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path d=\\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\\"></path><path fill=\\"none\\" d=\\"M0 0h24v24H0z\\"></path></svg></div><input aria-invalid=\\"false\\" autocomplete=\\"off\\" class=\\"MuiInputBase-input-28 MuiInput-input-13 css-hodoyq MuiInputBase-inputAdornedStart-33\\" placeholder=\\"Search Packages\\" type=\\"text\\" value=\\"\\"></div></div><div class=\\"MuiPaper-root-49 MuiPaper-elevation2-53 react-autosuggest__suggestions-container\\" id=\\"react-autowhatever-1\\" role=\\"listbox\\"></div></div></div>"`;
|
||||
exports[`<Search /> component test should load the component in default state 1`] = `"<div class=\\"css-1crzyyo e18292mt0\\"><div role=\\"combobox\\" aria-haspopup=\\"listbox\\" aria-owns=\\"react-autowhatever-1\\" aria-expanded=\\"false\\" class=\\"react-autosuggest__container\\"><div class=\\"MuiFormControl-root-1 MuiFormControl-fullWidth-4 react-autosuggest__input\\" aria-autocomplete=\\"list\\" aria-controls=\\"react-autowhatever-1\\"><div class=\\"MuiInputBase-root-18 MuiInput-root-5 css-n9ojyg MuiInput-underline-9 MuiInputBase-fullWidth-27 MuiInput-fullWidth-12 MuiInputBase-formControl-19 MuiInput-formControl-6 MuiInputBase-adornedStart-22\\"><div class=\\"MuiInputAdornment-root-35 MuiInputAdornment-positionStart-37\\" style=\\"color: rgb(255, 255, 255);\\"><svg class=\\"MuiSvgIcon-root-40\\" focusable=\\"false\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" role=\\"presentation\\"><path d=\\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\\"></path><path fill=\\"none\\" d=\\"M0 0h24v24H0z\\"></path></svg></div><input aria-invalid=\\"false\\" autocomplete=\\"off\\" class=\\"MuiInputBase-input-28 MuiInput-input-13 css-hodoyq MuiInputBase-inputAdornedStart-33\\" placeholder=\\"Search Packages\\" type=\\"text\\" value=\\"\\"></div></div><div class=\\"MuiPaper-root-49 MuiPaper-elevation2-53 react-autosuggest__suggestions-container css-1aijpo3 e18292mt1\\" id=\\"react-autowhatever-1\\" role=\\"listbox\\"></div></div></div>"`;
|
||||
|
||||
@@ -34,6 +34,7 @@ export default {
|
||||
__APP_VERSION__: `"${getPackageJson('version')}"`,
|
||||
}),
|
||||
new HTMLWebpackPlugin({
|
||||
__UI_OPTIONS: JSON.stringify({base: '/'}),
|
||||
title: 'Verdaccio Dev UI',
|
||||
scope: '',
|
||||
logo: 'https://verdaccio.org/img/logo/symbol/svg/verdaccio-tiny.svg',
|
||||
|
||||
Reference in New Issue
Block a user