Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planning: provide a visual solution for smaller screens to show the additional link action in the header of the list views #2123

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 29 additions & 34 deletions client/components/MultiSelectActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {every} from 'lodash';
import {eventUtils, planningUtils, gettext} from '../utils';
import {MAIN} from '../constants';
import {SlidingToolBar} from './UI/SubNav';
import {Button} from './UI';
import {IEventItem, ILockedItems, IPlanningItem, IPrivileges, ISession} from 'interfaces';
import {IconButton} from 'superdesk-ui-framework';

interface IReduxState {
selectedEvents: Array<any>;
Expand Down Expand Up @@ -119,48 +119,46 @@ export class MultiSelectActionsComponent extends React.PureComponent<IProps> {

if (selectedPlannings.every((planning) => planning.lock_action == null)) {
tools.push(
<Button
<IconButton
key={0}
hollow={true}
icon="assign"
ariaValue={gettext('Add to workflow')}
onClick={() => {
this.props.addToWorkflow(this.getItemList());
}}
text={gettext('Add to workflow')}
/>
);
}

if (showExport) {
tools.push(
<Button
<IconButton
key={1}
hollow={true}
icon="upload"
ariaValue={gettext('Export')}
onClick={this.exportArticle}
text={gettext('Export')}
/>
);
}

if (showSpike) {
tools.push(
<Button
<IconButton
key={2}
icon="trash"
ariaValue={gettext('Spike')}
onClick={this.itemSpike}
color="alert"
hollow={true}
text={gettext('Spike')}
icon="icon-trash"
/>
);
}

if (showUnspike) {
tools.push(
<Button
<IconButton
key={3}
icon="unspike"
ariaValue={gettext('Unspike')}
onClick={this.itemUnSpike}
color="warning"
icon="icon-unspike"
text={gettext('Unspike')}
/>
);
}
Expand Down Expand Up @@ -192,53 +190,50 @@ export class MultiSelectActionsComponent extends React.PureComponent<IProps> {
);

let tools = [(
<Button
<IconButton
key={0}
icon="upload"
ariaValue={gettext('Export')}
onClick={this.exportArticle}
hollow
text={gettext('Export')}
/>
), (
<Button
<IconButton
key={1}
icon="download"
ariaValue={gettext('Download')}
onClick={this.exportArticle.bind(null, true)}
color="primary"
text={gettext('Download')}
/>
)];

if (showCreatePlan) {
tools.push(
<Button
<IconButton
key={2}
icon="calendar"
ariaValue={gettext('Create planning')}
onClick={this.createPlanning}
color="primary"
text={gettext('Create planning')}
/>
);
}

if (showSpike) {
tools.push(
<Button
<IconButton
key={3}
icon="trash"
ariaValue={gettext('Spike')}
onClick={this.itemSpike}
color="alert"
hollow={true}
text={gettext('Spike')}
icon="icon-trash"
/>
);
}

if (showUnspike) {
tools.push(
<Button
<IconButton
key={4}
icon="unspike"
ariaValue={gettext('Unspike')}
onClick={this.itemUnSpike}
color="warning"
text={gettext('Unspike')}
icon="icon-unspike"
/>
);
}
Expand Down
51 changes: 10 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"sinon": "^4.5.0",
"superdesk-code-style": "1.5.0",
"superdesk-core": "github:superdesk/superdesk-client-core#develop",
"superdesk-ui-framework": "^3.1.15",
"superdesk-ui-framework": "^3.1.29",
"ts-node": "~7.0.1",
"tslint": "5.11.0",
"typescript-eslint-parser": "^18.0.0"
Expand Down
Loading