From 28d53ea8f1418dd18955c87870145e1563586c03 Mon Sep 17 00:00:00 2001 From: Nicolas Thouvenin Date: Fri, 2 Aug 2024 13:50:32 +0200 Subject: [PATCH] useless and blocking --- package-lock.json | 48 ---------- package.json | 1 - src/app/js/formats/formats.js | 8 -- .../trello-timeline/TrelloTimelineAdmin.js | 59 ------------ .../trello-timeline/TrelloTimelineView.js | 89 ------------------- .../js/formats/other/trello-timeline/index.js | 10 --- 6 files changed, 215 deletions(-) delete mode 100644 src/app/js/formats/other/trello-timeline/TrelloTimelineAdmin.js delete mode 100644 src/app/js/formats/other/trello-timeline/TrelloTimelineView.js delete mode 100644 src/app/js/formats/other/trello-timeline/index.js diff --git a/package-lock.json b/package-lock.json index b541322d9..6eab2da1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -75,7 +75,6 @@ "from": "0.1.7", "history": "^4.7.2", "inist-ark": "^2.1.3", - "inist-roadmap": "^1.2.0", "js-sentencecase": "^1.2.1", "jsonstream": "1.0.3", "jsonwebtoken": "9.0.2", @@ -17877,41 +17876,6 @@ "version": "2.1.3", "license": "MIT" }, - "node_modules/inist-roadmap": { - "version": "1.2.0", - "license": "MIT", - "dependencies": { - "latinize": "^0.4.0", - "markdown-it": "^8.4.0", - "moment": "^2.18.1", - "trello-promise": "^1.0.7" - } - }, - "node_modules/inist-roadmap/node_modules/entities": { - "version": "1.1.2", - "license": "BSD-2-Clause" - }, - "node_modules/inist-roadmap/node_modules/linkify-it": { - "version": "2.2.0", - "license": "MIT", - "dependencies": { - "uc.micro": "^1.0.1" - } - }, - "node_modules/inist-roadmap/node_modules/markdown-it": { - "version": "8.4.2", - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "entities": "~1.1.1", - "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "bin": { - "markdown-it": "bin/markdown-it.js" - } - }, "node_modules/inline-style-prefixer": { "version": "3.0.8", "license": "MIT", @@ -23162,10 +23126,6 @@ "node": ">=0.10" } }, - "node_modules/latinize": { - "version": "0.4.1", - "license": "BSD" - }, "node_modules/launch-editor": { "version": "2.6.1", "dev": true, @@ -31106,14 +31066,6 @@ "tree-kill": "cli.js" } }, - "node_modules/trello-promise": { - "version": "1.0.7", - "license": "MIT", - "dependencies": { - "form-data": "^2.1.1", - "isomorphic-fetch": "^2.2.1" - } - }, "node_modules/triple-beam": { "version": "1.3.0", "license": "MIT" diff --git a/package.json b/package.json index 521a69597..1829685ab 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,6 @@ "from": "0.1.7", "history": "^4.7.2", "inist-ark": "^2.1.3", - "inist-roadmap": "^1.2.0", "js-sentencecase": "^1.2.1", "jsonstream": "1.0.3", "jsonwebtoken": "9.0.2", diff --git a/src/app/js/formats/formats.js b/src/app/js/formats/formats.js index 72cc47707..417962163 100644 --- a/src/app/js/formats/formats.js +++ b/src/app/js/formats/formats.js @@ -19,7 +19,6 @@ import istex from './other/istex'; import link from './url/link'; import linkImage from './url/link-image'; import list from './text/list'; -import trelloTimeline from './other/trello-timeline'; import markdown from './text/markdown/simple'; import markdownModal from './text/markdown/modal'; import uri from './url/uri'; @@ -181,13 +180,6 @@ export const FORMATS_CATALOG = [ component: list, type: 'text', }, - { - name: 'formatTrelloTimeline', - description: 'formatTrelloTimelineDescription', - componentName: 'trelloTimeline', - component: trelloTimeline, - type: 'other', - }, { name: 'formatMarkdown', description: 'formatMarkdownDescription', diff --git a/src/app/js/formats/other/trello-timeline/TrelloTimelineAdmin.js b/src/app/js/formats/other/trello-timeline/TrelloTimelineAdmin.js deleted file mode 100644 index 4efcc336a..000000000 --- a/src/app/js/formats/other/trello-timeline/TrelloTimelineAdmin.js +++ /dev/null @@ -1,59 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { TextField } from '@mui/material'; -import translate from 'redux-polyglot/translate'; -import { FormatDataParamsFieldSet } from '../../utils/components/field-set/FormatFieldSets'; -import FormatGroupedFieldSet from '../../utils/components/field-set/FormatGroupedFieldSet'; - -export const defaultArgs = { - trelloKey: '', - trelloToken: '', -}; - -class TrelloTimelineAdmin extends Component { - static propTypes = { - args: PropTypes.shape({ - trelloKey: PropTypes.string, - trelloToken: PropTypes.string, - }), - onChange: PropTypes.func.isRequired, - }; - - static defaultProps = { - args: defaultArgs, - }; - - handleToken = (trelloToken) => { - const newArgs = { ...this.props.args, trelloToken }; - this.props.onChange(newArgs); - }; - - handleKey = (trelloKey) => { - const newArgs = { ...this.props.args, trelloKey }; - this.props.onChange(newArgs); - }; - - render() { - const { trelloToken, trelloKey } = this.props.args; - return ( - - - this.handleKey(e.target.value)} - value={trelloKey} - sx={{ flexGrow: 1 }} - /> - this.handleToken(e.target.value)} - value={trelloToken} - sx={{ flexGrow: 1 }} - /> - - - ); - } -} - -export default translate(TrelloTimelineAdmin); diff --git a/src/app/js/formats/other/trello-timeline/TrelloTimelineView.js b/src/app/js/formats/other/trello-timeline/TrelloTimelineView.js deleted file mode 100644 index c95bfcd95..000000000 --- a/src/app/js/formats/other/trello-timeline/TrelloTimelineView.js +++ /dev/null @@ -1,89 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { Timeline, TimelineEvent } from 'react-event-timeline/dist'; -import { - DateRange, - Alarm, - Bookmark, - RecordVoiceOver, - TrendingUp, -} from '@mui/icons-material'; -import { milestones } from 'inist-roadmap'; -import { field as fieldPropTypes } from '../../../propTypes'; -import Link from '../../../lib/components/Link'; - -function getIconFromLabel(labels) { - const smallIcon = { - width: 18, - height: 18, - }; - - if (labels.indexOf('sprint-review') !== -1) { - return ; - } else if (labels.indexOf('communication') !== -1) { - return ; - } else if (labels.indexOf('objectif') !== -1) { - return ; - } else if (labels.indexOf('reunion') !== -1) { - return ; - } - return ; -} - -const SeeMoreStyle = { - float: 'right', -}; - -export default class Roadmap extends Component { - constructor(props) { - super(props); - this.state = { milestones: [] }; - } - - componentDidMount() { - const { resource, field, trelloToken, trelloKey } = this.props; - const trelloURL = resource[field.name]; - const options = { - token: trelloToken, - key: trelloKey, - }; - milestones(trelloURL, options) - .then((values) => { - this.setState({ milestones: values }); - }) - .catch((error) => { - console.error(error); - }); - } - - render() { - return ( - - {this.state.milestones.map((milestone, index) => ( - -
- See more -
- {milestone.title} -
- ))} -
- ); - } -} - -Roadmap.propTypes = { - field: fieldPropTypes.isRequired, - resource: PropTypes.object.isRequired, - trelloToken: PropTypes.string.isRequired, - trelloKey: PropTypes.string.isRequired, -}; - -Roadmap.defaultProps = { - className: null, -}; diff --git a/src/app/js/formats/other/trello-timeline/index.js b/src/app/js/formats/other/trello-timeline/index.js deleted file mode 100644 index 88ed74311..000000000 --- a/src/app/js/formats/other/trello-timeline/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import Component from './TrelloTimelineView'; -import AdminComponent, { defaultArgs } from './TrelloTimelineAdmin'; -import DefaultFormat from '../../utils/components/default-format'; - -export default { - ...DefaultFormat, - Component, - AdminComponent, - defaultArgs, -};