mirror of
https://github.com/ascribe/onion.git
synced 2024-06-30 21:52:08 +02:00
some minor corrections
This commit is contained in:
parent
f066008ce9
commit
6d72352580
|
@ -1,7 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { getLangText } from '../../utils/lang_utils.js';
|
|
||||||
|
|
||||||
|
|
||||||
let AccordionListItemTableToggle = React.createClass({
|
let AccordionListItemTableToggle = React.createClass({
|
||||||
|
|
|
@ -78,7 +78,6 @@ let AclButton = React.createClass({
|
||||||
return (
|
return (
|
||||||
<ModalWrapper
|
<ModalWrapper
|
||||||
button={
|
button={
|
||||||
// TODO translate hidden?
|
|
||||||
<button className={shouldDisplay ? 'btn btn-default btn-sm ' : 'hidden'}>
|
<button className={shouldDisplay ? 'btn btn-default btn-sm ' : 'hidden'}>
|
||||||
{this.props.action.toUpperCase()}
|
{this.props.action.toUpperCase()}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -4,7 +4,6 @@ import React from 'react';
|
||||||
|
|
||||||
import FileDragAndDropDialog from './file_drag_and_drop_dialog';
|
import FileDragAndDropDialog from './file_drag_and_drop_dialog';
|
||||||
import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator';
|
import FileDragAndDropPreviewIterator from './file_drag_and_drop_preview_iterator';
|
||||||
import { getLangText } from '../../utils/lang_utils.js';
|
|
||||||
|
|
||||||
|
|
||||||
// Taken from: https://github.com/fedosejev/react-file-drag-and-drop
|
// Taken from: https://github.com/fedosejev/react-file-drag-and-drop
|
||||||
|
|
|
@ -6,9 +6,10 @@ import promise from 'es6-promise';
|
||||||
promise.polyfill();
|
promise.polyfill();
|
||||||
|
|
||||||
import fetch from 'isomorphic-fetch';
|
import fetch from 'isomorphic-fetch';
|
||||||
import AppConstants from '../../constants/application_constants';
|
|
||||||
|
|
||||||
import { getCookie } from '../../utils/fetch_api_utils';
|
import { getCookie } from '../../utils/fetch_api_utils';
|
||||||
|
import { getLangText } from '../../utils/lang_utils';
|
||||||
|
|
||||||
import S3Fetcher from '../../fetchers/s3_fetcher';
|
import S3Fetcher from '../../fetchers/s3_fetcher';
|
||||||
|
|
||||||
import fineUploader from 'fineUploader';
|
import fineUploader from 'fineUploader';
|
||||||
|
@ -146,7 +147,7 @@ var ReactS3FineUploader = React.createClass({
|
||||||
// since the csrf header is defined in this component's props,
|
// since the csrf header is defined in this component's props,
|
||||||
// everytime the csrf cookie is changed we'll need to reinitalize
|
// everytime the csrf cookie is changed we'll need to reinitalize
|
||||||
// fineuploader and update the actual csrf token
|
// fineuploader and update the actual csrf token
|
||||||
componentWillUpdate(nextProps, nextState) {
|
componentWillUpdate() {
|
||||||
let potentiallyNewCSRFToken = getCookie('csrftoken');
|
let potentiallyNewCSRFToken = getCookie('csrftoken');
|
||||||
if(this.state.csrfToken !== potentiallyNewCSRFToken) {
|
if(this.state.csrfToken !== potentiallyNewCSRFToken) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -376,12 +377,12 @@ var ReactS3FineUploader = React.createClass({
|
||||||
|
|
||||||
onDeleteComplete(id, xhr, isError) {
|
onDeleteComplete(id, xhr, isError) {
|
||||||
if(isError) {
|
if(isError) {
|
||||||
let notification = new GlobalNotificationModel('Couldn\'t delete file', 'danger', 10000);
|
let notification = new GlobalNotificationModel(getLangText('Couldn\'t delete file'), 'danger', 10000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
} else {
|
} else {
|
||||||
this.removeFileWithIdFromFilesToUpload(id);
|
this.removeFileWithIdFromFilesToUpload(id);
|
||||||
|
|
||||||
let notification = new GlobalNotificationModel('File deleted', 'success', 5000);
|
let notification = new GlobalNotificationModel(getLangText('File deleted'), 'success', 5000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,7 +465,7 @@ var ReactS3FineUploader = React.createClass({
|
||||||
// replace filelist with first-element file list
|
// replace filelist with first-element file list
|
||||||
files = tempFilesList;
|
files = tempFilesList;
|
||||||
// TOOD translate?
|
// TOOD translate?
|
||||||
let notification = new GlobalNotificationModel('Only one file allowed (took first one)', 'danger', 10000);
|
let notification = new GlobalNotificationModel(getLangText('Only one file allowed (took first one)'), 'danger', 10000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,8 @@ let CoaVerifyForm = React.createClass({
|
||||||
|
|
||||||
handleSuccess(response){
|
handleSuccess(response){
|
||||||
let notification = null;
|
let notification = null;
|
||||||
if (response.verdict){
|
if (response.verdict) {
|
||||||
// TODO translate?
|
notification = new GlobalNotificationModel(getLangText('Certificate of Authenticity successfully verified'), 'success');
|
||||||
notification = new GlobalNotificationModel('Certificate of Authenticity successfully verified', 'success');
|
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,7 +35,6 @@ import GlobalNotificationActions from '../actions/global_notification_actions';
|
||||||
|
|
||||||
import apiUrls from '../constants/api_urls';
|
import apiUrls from '../constants/api_urls';
|
||||||
import AppConstants from '../constants/application_constants';
|
import AppConstants from '../constants/application_constants';
|
||||||
import classNames from 'classnames';
|
|
||||||
|
|
||||||
import { getCookie } from '../utils/fetch_api_utils';
|
import { getCookie } from '../utils/fetch_api_utils';
|
||||||
import { getLangText } from '../utils/lang_utils';
|
import { getLangText } from '../utils/lang_utils';
|
||||||
|
@ -210,7 +209,7 @@ const CollapsibleButton = React.createClass({
|
||||||
this.setState({expanded: !this.state.expanded});
|
this.setState({expanded: !this.state.expanded});
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
let isVisible = (this.state.expanded) ? '' : getLangText('invisible');
|
let isVisible = (this.state.expanded) ? '' : 'invisible';
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
<span onClick={this.handleToggle}>
|
<span onClick={this.handleToggle}>
|
||||||
|
@ -438,7 +437,9 @@ let EditionPublicEditionNote = React.createClass({
|
||||||
handleSuccess: React.PropTypes.func
|
handleSuccess: React.PropTypes.func
|
||||||
},
|
},
|
||||||
showNotification(){
|
showNotification(){
|
||||||
this.props.handleSuccess();EnterndGlobalNotification(notification);
|
this.props.handleSuccess();
|
||||||
|
let notification = new GlobalNotificationModel(getLangText('Public note saved'), 'success');
|
||||||
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
let isEditable = this.props.edition.acl.indexOf('edit') > -1;
|
let isEditable = this.props.edition.acl.indexOf('edit') > -1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user