Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd34bafa

Browse files
authored
1 parent5db0c98 commitd34bafa

File tree

209 files changed

+4514
-3724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+4514
-3724
lines changed

‎clean-build-cache.sh‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
echo'Removing "cli/src/node_modules"'
4+
rm -R -f cli/src/node_modules
5+
6+
echo'Removing "worker/src/node_modules"'
7+
rm -R -f worker/src/node_modules
8+
9+
echo'Removing "api/src/node_modules"'
10+
rm -R -f api/src/node_modules
11+
12+
echo'Removing "ui/src/node_modules"'
13+
rm -R -f ui/src/node_modules
14+
15+
16+
echo'Removing "cli/dist"'
17+
rm -R -f cli/dist
18+
19+
echo'Removing "worker/dist"'
20+
rm -R -f worker/dist
21+
22+
echo'Removing "api/dist"'
23+
rm -R -f api/dist
24+
25+
echo'Removing "ui/dist"'
26+
rm -R -f ui/dist
27+

‎package.json‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"test":"yarn test-api && yarn test-lib && yarn test-worker && yarn test-ui && yarn test-cli",
4646
"migrate":"node cli/dist/server migrateMongo --up",
4747
"rollback":"node cli/dist/server migrateMongo --down last",
48-
"semantic-release":"ht2-release-private-circleci"
48+
"semantic-release":"ht2-release-private-circleci",
49+
"clean-cache":"sh ./clean-build-cache.sh"
4950
},
5051
"dependencies": {
5152
"@azure/service-bus":"^1.0.2",
@@ -218,6 +219,7 @@
218219
"isomorphic-style-loader":"^2.0.0",
219220
"jest":"^19.0.2",
220221
"jest-enzyme":"^4.0.1",
222+
"jest-styled-components":"^6.3.4",
221223
"mocha":"^2.3.3",
222224
"mocha-mongoose":"^1.2.0",
223225
"mocha-webpack":"^0.7.0",
@@ -252,7 +254,8 @@
252254
"husky": {
253255
"hooks": {
254256
"pre-push":"yarn lint-ci",
255-
"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"
257+
"commit-msg":"commitlint -E HUSKY_GIT_PARAMS",
258+
"post-checkout":"yarn clean-cache"
256259
}
257260
}
258261
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
importstyledfrom'styled-components';
2+
3+
exportdefaultstyled.input`
4+
border: none;
5+
flex-grow: 1;
6+
padding-left: 8px;
7+
8+
&:focus {
9+
outline: 0;
10+
}
11+
`;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
importstyled,{css}from'styled-components';
2+
3+
constopenedMixin=css`
4+
border-radius: 4px 4px 2px 2px;
5+
border-bottom: 1px solid #eee;
6+
`;
7+
8+
exportdefaultstyled.div`
9+
border-radius: 2px;
10+
overflow: hidden;
11+
flex-wrap: wrap;
12+
min-height: 36px;
13+
display: flex;
14+
align-items: center;
15+
${props=>props.isBorderHidden&&'border: 1px solid transparent'||'border: 1px solid #ccc;'}
16+
${props=>props.isOpen&&openedMixin||''}
17+
`;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
importstyledfrom'styled-components';
2+
import{rotation}from'ui/utils/styled/animations';
3+
4+
exportdefaultstyled.div`
5+
width: 18px;
6+
height: 18px;
7+
margin: 3px;
8+
animation:${rotation} .75s infinite linear;
9+
border-right: 2px solid #ddd;
10+
border-left: 2px solid #ddd;
11+
border-bottom: 2px solid #ddd;
12+
border-top: 2px solid #888;
13+
border-radius: 100%;
14+
margin-left: auto;
15+
`;

‎ui/src/components/AutoComplete/autocomplete.css‎

Lines changed: 0 additions & 41 deletions
This file was deleted.

‎ui/src/components/AutoComplete/index.js‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
importReact,{Component}from'react';
22
importPropTypesfrom'prop-types';
3-
importclassNamesfrom'classnames';
4-
importwithStylesfrom'isomorphic-style-loader/lib/withStyles';
53
import{Map,List}from'immutable';
64
import{noop,identity,debounce,isNull}from'lodash';
75
importOptionListfrom'ui/components/OptionList';
86
importOptionListItemfrom'ui/components/OptionListItem';
97
importareEqualPropsfrom'ui/utils/hocs/areEqualProps';
108
importkeyCodesfrom'lib/constants/keyCodes';
119
importTokenfrom'./token/Token';
12-
importstylesfrom'./autocomplete.css';
10+
importInputfrom'./Input';
11+
importInputWrapperfrom'./InputWrapper';
12+
importSpinnerfrom'./Spinner';
1313

1414
classAutoCompleteextendsComponent{
1515

@@ -44,7 +44,7 @@ class AutoComplete extends Component {
4444
// initial state
4545
options:newList(),
4646
isLoading:false,
47-
fetchMore:()=>{},
47+
fetchMore:()=>{},
4848

4949
values:newMap(),
5050
placeholder:'Type to limit suggestions',
@@ -251,7 +251,7 @@ class AutoComplete extends Component {
251251
returnnull;
252252
}
253253

254-
renderStatus=()=>(this.props.isLoading ?<divclassName={styles.isLoading}/> :null);
254+
renderStatus=()=>(this.props.isLoading ?<Spinner/> :null);
255255

256256
renderSingleValue=(value)=>{
257257
const{ renderSingleValue}=this.props;
@@ -271,8 +271,7 @@ class AutoComplete extends Component {
271271
constplaceholder=hasSingleValue ?'' :this.props.placeholder;
272272
constinputValue=this.getInputValue();
273273
return(
274-
<input
275-
className={styles.input}
274+
<Input
276275
onFocus={this.focus}
277276
onChange={this.onChangeFilter}
278277
value={inputValue}
@@ -295,30 +294,31 @@ class AutoComplete extends Component {
295294
parse={parseOption}
296295
parseTooltip={parseOptionTooltip}
297296
handleRemove={this.deleteValue.bind(this,key)}/>
298-
).valueSeq();
297+
).valueSeq();
299298
}
300299
returnhasSingleValue&&inputValue===''&&
301300
this.renderSingleValue(values.first());
302301
}
303302

304303
render(){
305-
constwrapperClasses=classNames({
306-
[styles.inputWrapper]:true,
307-
[styles.open]:this.state.focused,
308-
[styles.noBorder]:!this.state.focused&&this.props.noBorder
309-
});
304+
const{ focused, noBorder}=this.props;
310305

311306
return(
312-
<divref={(ref)=>{this.wrapper=ref;}}className={styles.wrapper}>
313-
<divonClick={this.focus}className={wrapperClasses}>
307+
<div
308+
ref={(ref)=>{this.wrapper=ref;}}
309+
style={{position:'relative',height:'100%'}}>
310+
<InputWrapper
311+
isOpen={focused}
312+
isBorderHidden={!focused&&noBorder}
313+
onClick={this.focus}>
314314
{this.renderValues()}
315315
{this.renderInput()}
316316
{this.renderStatus()}
317-
</div>
317+
</InputWrapper>
318318
{this.renderOptionsDropdown()}
319319
</div>
320320
);
321321
}
322322
}
323323

324-
exportdefaultwithStyles(styles)(AutoComplete);
324+
exportdefaultAutoComplete;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
importstyledfrom'styled-components';
2+
3+
exportdefaultstyled.div`
4+
margin-left: 2px;
5+
justify-content: flex-end;
6+
display: flex;
7+
align-items: center;
8+
padding: 0 6px;
9+
color: #888;
10+
font-size: 10px;
11+
border-left: 1px solid #ccc;
12+
line-height: 100%;
13+
cursor: pointer;
14+
15+
&:hover {
16+
color: #777;
17+
background: #eee;
18+
}
19+
`;

‎ui/src/components/AutoComplete/token/Token.js‎

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import React, { Component } from 'react';
22
importPropTypesfrom'prop-types';
33
import{identity,noop}from'lodash';
44
importclassNamesfrom'classnames';
5-
importwithStylesfrom'isomorphic-style-loader/lib/withStyles';
6-
importstylesfrom'./styles.css';
5+
importRemoveButtonfrom'./RemoveButton';
6+
importValuefrom'./Value';
7+
importWrapperfrom'./Wrapper';
78

89
classTokenextendsComponent{
910
staticdisplayName='Token';
@@ -36,31 +37,24 @@ class Token extends Component {
3637
}
3738

3839
renderRemoveBtn=()=>(
39-
<div
40-
className={styles.removeBtn}
41-
onClick={this.onRemoveBtnClick}>
40+
<RemoveButtononClick={this.onRemoveBtnClick}>
4241
<iclassName="ion-close-round"/>
43-
</div>
42+
</RemoveButton>
4443
);
4544

4645
render(){
4746
const{ fullWidth, value, parse, parseTooltip}=this.props;
48-
constwrapperClasses=classNames({
49-
[styles.wrapper]:true,
50-
[styles.wrapperFullWidth]:fullWidth
51-
});
47+
constwrapperClasses=classNames({ fullWidth});
5248
constparsedValue=parse(value);
5349
constparsedIdent=parseTooltip(value);
5450
consttitle=parsedIdent;
5551
return(
56-
<divtitle={title}className={wrapperClasses}>
57-
<divclassName={styles.value}>
58-
{parsedValue}
59-
</div>
60-
{!fullWidth ?this.renderRemoveBtn() :null}
61-
</div>
52+
<Wrappertitle={title}className={wrapperClasses}>
53+
<Value>{parsedValue}</Value>
54+
{!fullWidth ?this.renderRemoveBtn() :null}
55+
</Wrapper>
6256
);
6357
}
6458
}
6559

66-
exportdefaultwithStyles(styles)(Token);
60+
exportdefaultToken;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
importstyledfrom'styled-components';
2+
3+
exportdefaultstyled.div`
4+
font-size: 12px;
5+
padding: 2px 5px;
6+
justify-content: flex-start;
7+
word-break: break-word;
8+
`;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp