Skip to content

Commit

Permalink
Fix ci (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
houshuang committed Jan 10, 2019
1 parent fc0ade7 commit 70f26c4
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 100 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Expand Up @@ -7,3 +7,5 @@ templates/*
frogapi-test/**
frog/packages/*
**/clientFiles/*
ac/ac-autocode/src/lib/**

4 changes: 3 additions & 1 deletion .eslintrc.js
Expand Up @@ -15,6 +15,9 @@ module.exports = {
Meteor: true
},
rules: {
'react/no-unused-prop-types': 'off',
'react/no-access-state-in-setstate': 'off',
'react/button-has-type': 'off',
'react/destructuring-assignment': 'off',
'import/imports-first': ['warn', 'DISABLE-absolute-first'],
'import/order': ['error', { groups: ['builtin', 'external'] }],
Expand Down Expand Up @@ -62,7 +65,6 @@ module.exports = {
'no-use-before-define': 'off',
'prefer-destructuring': 'off',
'prefer-template': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-closing-bracket-location': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-indent': 'off',
Expand Down
56 changes: 27 additions & 29 deletions ac/ac-brainstorm/src/ActivityRunner.js
Expand Up @@ -128,29 +128,27 @@ const Idea = ({
/>
</A>
)}
{editable &&
config.allowEdit && (
<A onClick={() => editFn(meta.id)}>
<PencilIcon
style={{
float: 'right',
marginRight: '10px'
}}
/>
</A>
)}
{zoomable &&
!config.expandItems && (
<A onClick={() => zoomFn(meta.id)}>
<ZoomInIcon
glyph="zoom-in"
style={{
float: 'right',
marginRight: '10px'
}}
/>
</A>
)}
{editable && config.allowEdit && (
<A onClick={() => editFn(meta.id)}>
<PencilIcon
style={{
float: 'right',
marginRight: '10px'
}}
/>
</A>
)}
{zoomable && !config.expandItems && (
<A onClick={() => zoomFn(meta.id)}>
<ZoomInIcon
glyph="zoom-in"
style={{
float: 'right',
marginRight: '10px'
}}
/>
</A>
)}
</font>
</div>
</div>
Expand Down Expand Up @@ -194,12 +192,12 @@ const IdeaListRaw = ({
edit === x.id
? 'edit'
: zoom === x.id
? history
? 'history'
: 'view'
: config.expandItems
? 'view'
: 'thumbView'
? history
? 'history'
: 'view'
: config.expandItems
? 'view'
: 'thumbView'
}
render={({ zoomable, editable, children }) => (
<Idea
Expand Down
35 changes: 17 additions & 18 deletions ac/ac-gallery/src/ActivityRunner.js
Expand Up @@ -154,24 +154,23 @@ class ActivityRunner extends React.Component<
/>
</div>
)}
{category !== 'categories' &&
zoomOn && (
<ZoomView
key={index}
index={index}
commentBox={config.canComment}
commentGuidelines={config.commentGuidelines}
close={() => setZoom(false)}
bigZoom={config.bigZoom}
{...{
learningItems,
LearningItem: dataFn.LearningItem,
setIndex,
dataFn,
logger
}}
/>
)}
{category !== 'categories' && zoomOn && (
<ZoomView
key={index}
index={index}
commentBox={config.canComment}
commentGuidelines={config.commentGuidelines}
close={() => setZoom(false)}
bigZoom={config.bigZoom}
{...{
learningItems,
LearningItem: dataFn.LearningItem,
setIndex,
dataFn,
logger
}}
/>
)}
</>
);
}
Expand Down
2 changes: 1 addition & 1 deletion ac/ac-select/src/dashboards.js
Expand Up @@ -31,7 +31,7 @@ const styles = () => ({
}
});

const lookupCapitalization = (word, text, activityId) => {
const lookupCapitalization = (word, text) => {
if (text.includes(word)) {
return word;
} else return text.match(new RegExp(word, 'gi'))[0];
Expand Down
49 changes: 23 additions & 26 deletions ac/ac-single-li/src/ActivityRunner.js
Expand Up @@ -62,32 +62,29 @@ class ActivityRunner extends React.Component<
render={({ editable, children }) => (
<div>
{children}
{!editing &&
!conf.noSubmit &&
conf.allowEditing && (
<Fab
onClick={() =>
editable
? this.setState({ editing: true })
: dataFn.objDel(null, 'li')
}
color="secondary"
aria-label={editable ? 'edit' : 'delete'}
>
{editable ? <EditIcon /> : <CloseIcon />}
</Fab>
)}
{editing &&
!conf.noSubmit && (
<Button
onClick={() => this.setState({ editing: false })}
color="primary"
variant="contained"
aria-label="save"
>
Save
</Button>
)}
{!editing && !conf.noSubmit && conf.allowEditing && (
<Fab
onClick={() =>
editable
? this.setState({ editing: true })
: dataFn.objDel(null, 'li')
}
color="secondary"
aria-label={editable ? 'edit' : 'delete'}
>
{editable ? <EditIcon /> : <CloseIcon />}
</Fab>
)}
{editing && !conf.noSubmit && (
<Button
onClick={() => this.setState({ editing: false })}
color="primary"
variant="contained"
aria-label="save"
>
Save
</Button>
)}
</div>
)}
/>
Expand Down
3 changes: 2 additions & 1 deletion frog-utils/src/types.js
Expand Up @@ -339,7 +339,8 @@ export type LIComponentPropsT =
render?: React.ComponentType<{
...{| dataFn: Object |},
...LIRenderPropsT
}>
}>,
notEmpty?: boolean
|};

export type LearningItemComponentT = React.ComponentType<LIComponentPropsT>;
Expand Down
5 changes: 2 additions & 3 deletions frog/imports/api/versionUpgrades.js
Expand Up @@ -26,9 +26,8 @@ export const GraphObjUpgrades: Object = {
...graphObj.graph,
graphVersion: graphObj.graph.graphVersion + 1
},
activities: graphObj.activities.map(
x =>
x.activityType === 'ac-image' ? { ...x, activityType: 'ac-gallery' } : x
activities: graphObj.activities.map(x =>
x.activityType === 'ac-image' ? { ...x, activityType: 'ac-gallery' } : x
)
})
};
35 changes: 17 additions & 18 deletions frog/imports/client/LearningItem/RenderLearningItem.js
Expand Up @@ -46,24 +46,23 @@ const withNullCheck = ({
>
{result}
</MaybeClickable>
{this.props.open &&
liType.Viewer && (
<Dialog
maxWidth={false}
open
onClose={() => {
setOpen(false);
}}
>
<liType.Viewer
type="view"
isPlayback={isPlayback}
data={data.payload}
dataFn={dataFn}
LearningItem={dataFn && dataFn.LearningItem}
/>
</Dialog>
)}
{this.props.open && liType.Viewer && (
<Dialog
maxWidth={false}
open
onClose={() => {
setOpen(false);
}}
>
<liType.Viewer
type="view"
isPlayback={isPlayback}
data={data.payload}
dataFn={dataFn}
LearningItem={dataFn && dataFn.LearningItem}
/>
</Dialog>
)}
</>
);
if (render) {
Expand Down
6 changes: 3 additions & 3 deletions package-scripts.js
@@ -1,5 +1,5 @@
const { sync } = require('find-up');
const { dirname } = require('path');
const { sync } = require('find-up');

const help = `echo '
FROG scripts:
Expand Down Expand Up @@ -61,11 +61,11 @@ module.exports = {
),
test: {
default: fromRoot(
`nps -s flow.quiet eslint.normal jest`,
`nps -s flow.quiet eslint jest`,
'Running Flow, ESLint and Jest'
),
ci: fromRoot(
`nps -s lockfiles flow.quiet eslint.normal jest`,
`nps -s lockfiles flow.quiet eslint jest`,
'Running LockFiles, Flow, ESLint and Jest'
)
},
Expand Down

0 comments on commit 70f26c4

Please sign in to comment.