Skip to content

Commit

Permalink
Fix logout + fix multiple typos + Add link to Github issues when phil…
Browse files Browse the repository at this point in the history
…ips hue light is not integrated (#835)

* Fix translations

* Fix logout

* Fix typos

* Fix #810 : Add a link to Github when philips hue light is not integrated

* Remove test data
  • Loading branch information
Pierre-Gilles authored Jul 27, 2020
1 parent 597c803 commit eba7207
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
13 changes: 9 additions & 4 deletions front/src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const defaultState = getDefaultState();
const store = createStore(defaultState);

const AppRouter = connect(
'currentUrl,user,profilePicture,showDropDown,showCollapsedMenu,integrationCategories',
'currentUrl,user,profilePicture,showDropDown,showCollapsedMenu',
actions
)(props => (
<div id="app">
Expand Down Expand Up @@ -142,9 +142,14 @@ const AppRouter = connect(
<Dashboard path="/dashboard" />
<Device path="/dashboard/device" />
<IntegrationPage path="/dashboard/integration" />
{props.integrationCategories.map(category => (
<IntegrationPage path={`/dashboard/integration/${category.type}`} category={category.type} />
))}

<IntegrationPage path="/dashboard/integration/device" />
<IntegrationPage path="/dashboard/integration/communication" />
<IntegrationPage path="/dashboard/integration/calendar" />
<IntegrationPage path="/dashboard/integration/music" />
<IntegrationPage path="/dashboard/integration/health" />
<IntegrationPage path="/dashboard/integration/weather" />
<IntegrationPage path="/dashboard/integration/navigation" />

<TelegramPage path="/dashboard/integration/communication/telegram" />
<CaldavPage path="/dashboard/integration/calendar/caldav" />
Expand Down
3 changes: 2 additions & 1 deletion front/src/config/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@
"search": "Search devices",
"noDevices": "No Philips Hue device added yet.",
"deviceNotHandled": "Device not handled yet, please contact us to help us connect it in Gladys!",
"noDevicesFound": "No devices found. Make sure you have connected one Philips Hue bridge in the setup tab."
"noDevicesFound": "No devices found. Make sure you have connected one Philips Hue bridge in the setup tab.",
"createGithubIssue": "Suggest this device"
}
},
"rtspCamera": {
Expand Down
9 changes: 5 additions & 4 deletions front/src/config/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
"restartButton": "Redémarrer",
"stopButton": "Arrêter",
"menu": {
"all": "Toutes les integrations",
"all": "Toutes les intégrations",
"device": "Appareils",
"communication": "Communication",
"calendar": "Calendrier",
Expand Down Expand Up @@ -309,12 +309,13 @@
"search": "Recherche d'appareils",
"noDevices": "Aucun appareil Philips Hue ajouté.",
"deviceNotHandled": "L'appareil n'est pas encore géré, veuillez nous contacter pour nous aider à le connecter dans Gladys !",
"noDevicesFound": "Aucun appareil trouvé. Assurez-vous d'avoir connecté un pont Philips Hue dans l'onglet de configuration."
"noDevicesFound": "Aucun appareil trouvé. Assurez-vous d'avoir connecté un pont Philips Hue dans l'onglet de configuration.",
"createGithubIssue": "Proposer ce périphérique"
}
},
"rtspCamera": {
"title": "Caméras",
"description": "Affichez vos caméras HTTP/RTSP.",
"description": "Affichez vos caméras.",
"search": "Chercher une caméra",
"new": "Nouveau",
"nameLabel": "Nom de la caméra",
Expand Down Expand Up @@ -868,7 +869,7 @@
"disconnectButton": "Déconnecter",
"gatewayConnectedSuccessTitle": "Gladys Plus est connecté avec succès !",
"gatewayConnectedSuccessDescription": "Votre instance de Gladys s'est connectée avec succès.",
"gatewayConnectedSuccessBackupKey": "Une sauvegarde sera faite chaque jour, encodée avec la clé suivante. Ainsi vous pourrez restaurer votre instance plus tard, merci d'enregistrer cette clé de cryptage quelque part, en dehors de Gladys. Sans cette clé, il vous sera impossible de restaurer Gladys.",
"gatewayConnectedSuccessBackupKey": "Une sauvegarde sera faite chaque jour, encodée avec la clé suivante. Ainsi vous pourrez restaurer votre instance plus tard, merci d'enregistrer cette clé de chiffrement quelque part, en dehors de Gladys. Sans cette clé, il vous sera impossible de restaurer Gladys.",
"gatewayConnectedSuccessButton": "J'ai enregistré la clé de sauvegarde !"
},
"gatewayPricing": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ const createDevice = (props, device) => () => {
props.createDevice(device);
};

const GITHUB_BASE_URL = 'https://github.com/GladysAssistant/Gladys/issues/new';

const createGithubUrl = device => {
const title = encodeURIComponent(`Philips Hue: Add device ${device.model}`);
const body = encodeURIComponent('```\n' + JSON.stringify(device, null, 2) + '\n```');
return `${GITHUB_BASE_URL}?title=${title}&body=${body}`;
};

const FoundDevices = ({ children, ...props }) => (
<div class="card">
<div class="card-header">
Expand Down Expand Up @@ -48,8 +56,18 @@ const FoundDevices = ({ children, ...props }) => (
</button>
)}
{device.not_handled && (
<div class="alert alert-warning">
<Text id="integration.philipsHue.device.deviceNotHandled" />
<div>
<div class="alert alert-warning">
<Text id="integration.philipsHue.device.deviceNotHandled" />
</div>
<a
class="btn btn-primary"
href={createGithubUrl(device)}
target="_blank"
rel="noopener noreferrer"
>
<Text id="integration.philipsHue.device.createGithubIssue" />
</a>
</div>
)}
</div>
Expand Down

0 comments on commit eba7207

Please sign in to comment.