From 0931cd50fb2656064b1716e59c425886b5d1973f Mon Sep 17 00:00:00 2001 From: aushaag <23203007+aushaag@users.noreply.github.com> Date: Fri, 9 Apr 2021 16:43:50 -0400 Subject: [PATCH 1/9] Changing "Navigation" to "Navigation and Buttons" "Buttons" for some of the translations Since there are button settings in the "Navigation" section of buttons, it seems clearer to rename "Navigation" in the settings list to "Navigation and Buttons". There are many languages I have not added this to yet, but I can complete the translations soon. --- src/translations/ar-SA.json | 2 +- src/translations/be-BY.json | 2 +- src/translations/bn-BD.json | 2 +- src/translations/cs-CZ.json | 2 +- src/translations/da-DK.json | 4 ++-- src/translations/de-DE.json | 2 +- src/translations/el-GR.json | 2 +- src/translations/en-GB.json | 4 ++-- src/translations/en-US.json | 4 ++-- src/translations/es-ES.json | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/translations/ar-SA.json b/src/translations/ar-SA.json index 5ad55deda..cc11db001 100644 --- a/src/translations/ar-SA.json +++ b/src/translations/ar-SA.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "تحرير اسم اللوحة ووصفها", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "يمكنك تعديل اسم اللوحة ووصفها من هنا. يرجى النظر في كتابة وصف ذي مغزى لمنتداك.", "board.components.CommunicatorDialog.noTitle": "بلا عنوان", - "cboard.components.Settings.navigation": "التنقل", + "cboard.components.Settings.navigation": "التنقل والأزرار", "cboard.components.Settings.scanning": "مسح", "cboard.components.Settings.display": "عرض", "cboard.components.Settings.feedback": "ردود الفعل", diff --git a/src/translations/be-BY.json b/src/translations/be-BY.json index 25c3a48b1..b22c2e0f8 100644 --- a/src/translations/be-BY.json +++ b/src/translations/be-BY.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "Адрэдагаваць назву дошкі і апісанне", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "Вы можаце змяніць назву дошкі і апісанне тут. Калі ласка, падумайце, каб напісаць змястоўнае апісанне для вашай дошкі.", "board.components.CommunicatorDialog.noTitle": "Без назвы", - "cboard.components.Settings.navigation": "рух", + "cboard.components.Settings.navigation": "Навігацыя і кнопкі", "cboard.components.Settings.scanning": "сканаванне", "cboard.components.Settings.display": "дысплей", "cboard.components.Settings.feedback": "зваротная сувязь", diff --git a/src/translations/bn-BD.json b/src/translations/bn-BD.json index eccd8c684..6d73c0379 100644 --- a/src/translations/bn-BD.json +++ b/src/translations/bn-BD.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "বোর্ডের নাম এবং বর্ণনা সম্পাদনা করুন", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "আপনি এখান থেকে বোর্ডের নাম এবং বর্ণনা সম্পাদনা করতে পারেন। আপনার বোর্ডের জন্য একটি অর্থবহ বর্ণনা লিখতে দয়া করে বিবেচনা করুন।", "board.components.CommunicatorDialog.noTitle": "কোনো শিরোনাম নেই", - "cboard.components.Settings.navigation": "ন্যাভিগেশন", + "cboard.components.Settings.navigation": "নেভিগেশন এবং বোতাম", "cboard.components.Settings.scanning": "স্ক্যান করা হচ্ছে", "cboard.components.Settings.display": "প্রদর্শন", "cboard.components.Settings.feedback": "প্রতিক্রিয়া", diff --git a/src/translations/cs-CZ.json b/src/translations/cs-CZ.json index c86abd244..09f51d96c 100644 --- a/src/translations/cs-CZ.json +++ b/src/translations/cs-CZ.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "Upravit název a popis desky", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "Zde můžete upravit název a popis desky. Zvažte prosím napsat smysluplný popis své rady.", "board.components.CommunicatorDialog.noTitle": "Bez názvu", - "cboard.components.Settings.navigation": "Navigace", + "cboard.components.Settings.navigation": "Navigace a tlačítka", "cboard.components.Settings.scanning": "Snímání", "cboard.components.Settings.display": "Zobrazit", "cboard.components.Settings.feedback": "Zpětná vazba", diff --git a/src/translations/da-DK.json b/src/translations/da-DK.json index a3801e9e3..50ef973df 100644 --- a/src/translations/da-DK.json +++ b/src/translations/da-DK.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "Rediger kortets navn og beskrivelse", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "Du kan redigere kortets navn og beskrivelse herfra. Overvej at skrive en meningsfuld beskrivelse til dit bord.", "board.components.CommunicatorDialog.noTitle": "Ingen titel", - "cboard.components.Settings.navigation": "Navigation", + "cboard.components.Settings.navigation": "Navigation og knapper", "cboard.components.Settings.scanning": "Scanning", "cboard.components.Settings.display": "Skærm", "cboard.components.Settings.feedback": "Feedback", @@ -260,7 +260,7 @@ "cboard.components.Settings.Scanning.scannerHowToDeactivate": "Tryk Escape 4 gange for at deaktivere Scanner", "cboard.components.Settings.Scanning.scannerManualStrategy": "Scanner fremskridt med mellemrumstasten, tryk på enter for at vælge et element", "cboard.components.Settings.Scanning.scannerAutomaticStrategy": "Scanneren gentager elementerne, tryk på en vilkårlig tast for at vælge dem", - "cboard.components.Settings.Navigation.navigation": "Navigation", + "cboard.components.Settings.Navigation.navigation": "Navigation og knapper", "cboard.components.Settings.Navigation.enable": "Aktivér kontekstbevidst tilbage-knap", "cboard.components.Settings.Navigation.enableSecondary": "Viser store tilbage knapper oven på brædderne", "cboard.components.Settings.Navigation.quickUnlock": "Aktivér hurtig indstilling oplåsning", diff --git a/src/translations/de-DE.json b/src/translations/de-DE.json index 3132adfc6..476f474ae 100644 --- a/src/translations/de-DE.json +++ b/src/translations/de-DE.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "Bearbeiten Sie den Namen und die Beschreibung der Karte", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "Hier können Sie den Namen und die Beschreibung des Boards bearbeiten. Bitte denken Sie daran, eine aussagekräftige Beschreibung für Ihr Board zu schreiben.", "board.components.CommunicatorDialog.noTitle": "Kein Titel", - "cboard.components.Settings.navigation": "Navigation", + "cboard.components.Settings.navigation": "Navigation und Schaltflächen", "cboard.components.Settings.scanning": "Scannen", "cboard.components.Settings.display": "Anzeige", "cboard.components.Settings.feedback": "Feedback", diff --git a/src/translations/el-GR.json b/src/translations/el-GR.json index 92b2b5c69..770a558c2 100644 --- a/src/translations/el-GR.json +++ b/src/translations/el-GR.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "Επεξεργασία ονόματος και περιγραφής πίνακα", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "Μπορείτε να επεξεργαστείτε το όνομα και την περιγραφή του πίνακα από εδώ. Εξετάστε το ενδεχόμενο να γράψετε μια σημαντική περιγραφή για το διοικητικό συμβούλιο.", "board.components.CommunicatorDialog.noTitle": "Χωρίς τίτλο", - "cboard.components.Settings.navigation": "Πλοήγηση", + "cboard.components.Settings.navigation": "Πλοήγηση και κουμπιά", "cboard.components.Settings.scanning": "Ερευνα", "cboard.components.Settings.display": "Απεικόνιση", "cboard.components.Settings.feedback": "Ανατροφοδότηση", diff --git a/src/translations/en-GB.json b/src/translations/en-GB.json index 404f4011c..2c590f6b2 100644 --- a/src/translations/en-GB.json +++ b/src/translations/en-GB.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "Edit board name and description", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "You can edit board name and description from here. Please consider to write a meaningful description for your board.", "board.components.CommunicatorDialog.noTitle": "No title", - "cboard.components.Settings.navigation": "Navigation", + "cboard.components.Settings.navigation": "Navigation and Buttons", "cboard.components.Settings.scanning": "Scanning", "cboard.components.Settings.display": "Display", "cboard.components.Settings.feedback": "Feedback", @@ -260,7 +260,7 @@ "cboard.components.Settings.Scanning.scannerHowToDeactivate": "Press Escape 4 times to deactivate Scanner", "cboard.components.Settings.Scanning.scannerManualStrategy": "Scanner advances with space bar key, press enter to select an item", "cboard.components.Settings.Scanning.scannerAutomaticStrategy": "Scanner will iterate over elements, press any key to select them", - "cboard.components.Settings.Navigation.navigation": "Navigation", + "cboard.components.Settings.Navigation.navigation": "Navigation and Buttons", "cboard.components.Settings.Navigation.enable": "Enable context aware back button", "cboard.components.Settings.Navigation.enableSecondary": "Shows big back buttons on top of the boards", "cboard.components.Settings.Navigation.quickUnlock": "Enable quick settings unlock", diff --git a/src/translations/en-US.json b/src/translations/en-US.json index 6af99fe6b..5a4e9db6b 100644 --- a/src/translations/en-US.json +++ b/src/translations/en-US.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "Edit board name and description", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "You can edit board name and description from here. Please consider to write a meaningful description for your board.", "board.components.CommunicatorDialog.noTitle": "No title", - "cboard.components.Settings.navigation": "Navigation", + "cboard.components.Settings.navigation": "Navigation and Buttons", "cboard.components.Settings.scanning": "Scanning", "cboard.components.Settings.display": "Display", "cboard.components.Settings.feedback": "Feedback", @@ -260,7 +260,7 @@ "cboard.components.Settings.Scanning.scannerHowToDeactivate": "Press Escape 4 times to deactivate Scanner", "cboard.components.Settings.Scanning.scannerManualStrategy": "Scanner advances with space bar key, press enter to select an item", "cboard.components.Settings.Scanning.scannerAutomaticStrategy": "Scanner will iterate over elements, press any key to select them", - "cboard.components.Settings.Navigation.navigation": "Navigation", + "cboard.components.Settings.Navigation.navigation": "Navigation and Buttons", "cboard.components.Settings.Navigation.enable": "Enable context aware back button", "cboard.components.Settings.Navigation.enableSecondary": "Shows big back buttons on top of the boards", "cboard.components.Settings.Navigation.quickUnlock": "Enable quick settings unlock", diff --git a/src/translations/es-ES.json b/src/translations/es-ES.json index 5655191c0..fbfec0b73 100644 --- a/src/translations/es-ES.json +++ b/src/translations/es-ES.json @@ -200,7 +200,7 @@ "cboard.components.CommunicatorDialog.editBoardTitle": "Editar nombre y descripción del tablero", "cboard.components.CommunicatorDialog.editBoardTitleDescription": "Puedes editar el nombre y la descripción del tablero desde aquí. Por favor considera escribir una descripción significativa para tu tablero.", "board.components.CommunicatorDialog.noTitle": "Sin título", - "cboard.components.Settings.navigation": "Navegación", + "cboard.components.Settings.navigation": "Navegación y Botones", "cboard.components.Settings.scanning": "Exploración", "cboard.components.Settings.display": "Visualizar", "cboard.components.Settings.feedback": "Sugerencias", @@ -260,7 +260,7 @@ "cboard.components.Settings.Scanning.scannerHowToDeactivate": "Presiona Escape 4 veces para desactivar el escáner", "cboard.components.Settings.Scanning.scannerManualStrategy": "El escáner avanza con la tecla de la barra espaciadora, presione Entrar para seleccionar un elemento", "cboard.components.Settings.Scanning.scannerAutomaticStrategy": "El escáner recorrerá los elementos, presione cualquier tecla para seleccionarlos", - "cboard.components.Settings.Navigation.navigation": "Navegación", + "cboard.components.Settings.Navigation.navigation": "Navegación y Botones", "cboard.components.Settings.Navigation.enable": "Habilitar el botón de navegación Atrás (dependiendo del contexto)", "cboard.components.Settings.Navigation.enableSecondary": "Muestra botones grandes por encima de los tableros", "cboard.components.Settings.Navigation.quickUnlock": "Habilitar desbloqueo de configuración rápida", From 18bd5d6cbc22a0b79b819138d4e06b8666526bbb Mon Sep 17 00:00:00 2001 From: aushaag <23203007+aushaag@users.noreply.github.com> Date: Fri, 9 Apr 2021 16:46:58 -0400 Subject: [PATCH 2/9] Add copy button to settings Add new setting for showing/hiding the copy button in the output. Also add dividers between options to match other settings. --- src/components/App/App.reducer.js | 1 + .../App/__tests__/App.reducer.test.js | 2 ++ src/components/Board/Board.component.js | 5 ++-- .../Navigation/Navigation.component.js | 28 +++++++++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/components/App/App.reducer.js b/src/components/App/App.reducer.js index 81a3c1bea..2a34ea8c7 100644 --- a/src/components/App/App.reducer.js +++ b/src/components/App/App.reducer.js @@ -17,6 +17,7 @@ const initialState = { displaySettings: { uiSize: DISPLAY_SIZE_STANDARD, fontSize: DISPLAY_SIZE_STANDARD, + copyShowActive: false, hideOutputActive: false, labelPosition: LABEL_POSITION_BELOW, darkThemeActive: false diff --git a/src/components/App/__tests__/App.reducer.test.js b/src/components/App/__tests__/App.reducer.test.js index fe8378dff..bb2b5254b 100644 --- a/src/components/App/__tests__/App.reducer.test.js +++ b/src/components/App/__tests__/App.reducer.test.js @@ -26,6 +26,7 @@ describe('reducer', () => { navigationSettings: { active: false, caBackButtonActive: false, + copyShowActive: false, quickUnlockActive: false, removeOutputActive: false, vocalizeFolders: false @@ -46,6 +47,7 @@ describe('reducer', () => { navigationSettings: { active: false, caBackButtonActive: false, + copyShowActive: false, quickUnlockActive: false, removeOutputActive: false, vocalizeFolders: false diff --git a/src/components/Board/Board.component.js b/src/components/Board/Board.component.js index d35d3c35d..3584eb1ff 100644 --- a/src/components/Board/Board.component.js +++ b/src/components/Board/Board.component.js @@ -81,7 +81,7 @@ export class Board extends Component { onBoardTypeChange: PropTypes.func, isFixedBoard: PropTypes.bool, onAddRemoveColumn: PropTypes.func, - onAddRemoveRow: PropTypes.func, + onAddRemoveRow: PropTypes.func, onLayoutChange: PropTypes.func }; @@ -89,6 +89,7 @@ export class Board extends Component { displaySettings: { uiSize: 'Standard', labelPosition: 'Below', + copyShowActive: false, hideOutputActive: false }, navigationSettings: {}, @@ -277,7 +278,7 @@ export class Board extends Component { emptyVoiceAlert, onAddRemoveRow, onAddRemoveColumn, - onTileDrop, + onTileDrop, onLayoutChange } = this.props; diff --git a/src/components/Settings/Navigation/Navigation.component.js b/src/components/Settings/Navigation/Navigation.component.js index a01e97d83..76ac8efa3 100644 --- a/src/components/Settings/Navigation/Navigation.component.js +++ b/src/components/Settings/Navigation/Navigation.component.js @@ -7,6 +7,7 @@ import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemText from '@material-ui/core/ListItemText'; import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; +import Divider from '@material-ui/core/Divider'; import FullScreenDialog from '../../UI/FullScreenDialog'; import messages from './Navigation.messages'; @@ -42,6 +43,12 @@ class Navigation extends React.Component { }); }; + toggleCopyShow = () => { + this.setState({ + copyShowActive: !this.state.copyShowActive + }); + }; + toggleRemoveOutput = () => { this.setState({ removeOutputActive: !this.state.removeOutputActive @@ -85,6 +92,25 @@ class Navigation extends React.Component { /> + + + } + secondary={ + + } + /> + + + + + + + Date: Fri, 9 Apr 2021 16:48:28 -0400 Subject: [PATCH 3/9] Implement Copy Button Implement copy button functionality. When copy button is clicked, output labels of currently selected symbols to clipboard --- .../Board/Output/Output.container.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/Board/Output/Output.container.js b/src/components/Board/Output/Output.container.js index 458a1a4da..967e61484 100644 --- a/src/components/Board/Output/Output.container.js +++ b/src/components/Board/Output/Output.container.js @@ -3,6 +3,8 @@ import PropTypes from 'prop-types'; import { injectIntl, intlShape } from 'react-intl'; import { connect } from 'react-redux'; import keycode from 'keycode'; +import messages from '../Board.messages'; +import { showNotification } from '../../Notifications/Notifications.actions'; import { cancelSpeech, @@ -179,6 +181,16 @@ export class OutputContainer extends Component { this.clearOutput(); }; + handleCopyClick = () => { + const { intl, showNotification } = this.props; + let labels = []; + this.props.output.map(symbol => { + labels.push(symbol.label); + }); + navigator.clipboard.writeText(labels.join(' ')); + showNotification(intl.formatMessage(messages.copyMessage)); + }; + handleRemoveClick = index => event => { const { cancelSpeech } = this.props; cancelSpeech(); @@ -207,6 +219,7 @@ export class OutputContainer extends Component { { return { output: board.output, - navigationSettings: app.navigationSettings, + navigationSettings: app.navigationSettings }; }; @@ -229,7 +242,8 @@ const mapDispatchToProps = { cancelSpeech, changeOutput, clickOutput, - speak + speak, + showNotification }; export default connect( From 224f61cb6d06209fe1c0c771488c462f180ed538 Mon Sep 17 00:00:00 2001 From: aushaag <23203007+aushaag@users.noreply.github.com> Date: Fri, 9 Apr 2021 16:49:59 -0400 Subject: [PATCH 4/9] Create new CopyButton Component Create CopyButton component that follows BackspaceButton as template. --- .../SymbolOutput/CopyButton/CopyButton.js | 50 +++++++++++++++++++ .../Output/SymbolOutput/CopyButton/index.js | 1 + 2 files changed, 51 insertions(+) create mode 100644 src/components/Board/Output/SymbolOutput/CopyButton/CopyButton.js create mode 100644 src/components/Board/Output/SymbolOutput/CopyButton/index.js diff --git a/src/components/Board/Output/SymbolOutput/CopyButton/CopyButton.js b/src/components/Board/Output/SymbolOutput/CopyButton/CopyButton.js new file mode 100644 index 000000000..9014bda0b --- /dev/null +++ b/src/components/Board/Output/SymbolOutput/CopyButton/CopyButton.js @@ -0,0 +1,50 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { withStyles } from '@material-ui/core/styles'; +import IconButton from '@material-ui/core/IconButton'; +import FileCopy from '@material-ui/icons/FileCopy'; +import { Scannable } from 'react-scannable'; + +const styles = { + button: { + alignSelf: 'center', + height: '64px', + width: '64px' + }, + icon: { + height: '32px', + width: '32px' + } +}; + +export class CopyButton extends Component { + static propTypes = { + /** + * @ignore + */ + classes: PropTypes.object, + /** + * @ignore + */ + theme: PropTypes.object, + + hidden: PropTypes.bool + }; + + render() { + const { classes, theme, hidden, ...other } = this.props; + + const copyIconStyle = + theme.direction === 'ltr' ? null : { transform: 'scaleX(-1)' }; + + return ( + + + + + + ); + } +} + +export default withStyles(styles, { withTheme: true })(CopyButton); diff --git a/src/components/Board/Output/SymbolOutput/CopyButton/index.js b/src/components/Board/Output/SymbolOutput/CopyButton/index.js new file mode 100644 index 000000000..90e9e6d20 --- /dev/null +++ b/src/components/Board/Output/SymbolOutput/CopyButton/index.js @@ -0,0 +1 @@ +export { default } from './CopyButton'; From b8a9bcc5aeb816a6ab85097f42fe4db812de40ee Mon Sep 17 00:00:00 2001 From: aushaag <23203007+aushaag@users.noreply.github.com> Date: Fri, 9 Apr 2021 16:51:38 -0400 Subject: [PATCH 5/9] Add CopyButton to SymbolOutput Add CopyButton to SymbolOutput to the left of backspace and clear. CopyButton is only displayed when enabled in navigationSettings (copyShowActive). CopyButton is also only displayed when at least one symbol has been selected (symbols.length > 0). --- .../Board/Output/SymbolOutput/SymbolOutput.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/Board/Output/SymbolOutput/SymbolOutput.js b/src/components/Board/Output/SymbolOutput/SymbolOutput.js index 23da03262..1d32c4245 100644 --- a/src/components/Board/Output/SymbolOutput/SymbolOutput.js +++ b/src/components/Board/Output/SymbolOutput/SymbolOutput.js @@ -7,6 +7,7 @@ import IconButton from '@material-ui/core/IconButton'; import Symbol from '../../Symbol'; import BackspaceButton from './BackspaceButton'; import ClearButton from './ClearButton'; +import CopyButton from './CopyButton'; import Scroll from './Scroll'; import './SymbolOutput.css'; @@ -37,6 +38,7 @@ class SymbolOutput extends PureComponent { const { onBackspaceClick, onClearClick, + onCopyClick, onRemoveClick, symbols, navigationSettings, @@ -47,6 +49,10 @@ class SymbolOutput extends PureComponent { visibility: symbols.length ? 'visible' : 'hidden' }; + const copyButtonStyle = { + visibility: symbols.length ? 'visible' : 'hidden' + }; + const removeButtonStyle = { visibility: navigationSettings.removeOutputActive ? 'visible' : 'hidden' }; @@ -80,7 +86,14 @@ class SymbolOutput extends PureComponent { ))} - + {navigationSettings.copyShowActive && ( +