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

Make the title optional in the device and scene widgets. #2220

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
38 changes: 20 additions & 18 deletions front/src/components/boxs/device-in-room/DeviceCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,26 @@ const DeviceCard = ({ children, ...props }) => {

return (
<div class="card">
<div class="card-header">
<h3 class="card-title">{boxTitle}</h3>
{hasBinaryLightDeviceFeature && (
<div class="card-options">
<label class="custom-switch m-0">
<input
type="checkbox"
name={props.boxTitle}
value="1"
class="custom-switch-input"
checked={roomLightStatus === 1}
onClick={props.changeAllLightsStatusRoom}
/>
<span class="custom-switch-indicator" />
</label>
</div>
)}
</div>
{boxTitle && (
<div class="card-header">
<h3 class="card-title">{boxTitle}</h3>
{hasBinaryLightDeviceFeature && (
<div class="card-options">
<label class="custom-switch m-0">
<input
type="checkbox"
name={props.boxTitle}
value="1"
class="custom-switch-input"
checked={roomLightStatus === 1}
onClick={props.changeAllLightsStatusRoom}
/>
<span class="custom-switch-indicator" />
</label>
</div>
)}
</div>
)}
<div
class={cx('dimmer', {
active: loading
Expand Down
9 changes: 5 additions & 4 deletions front/src/components/boxs/scene/SceneBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ class SceneBoxComponent extends Component {

return (
<div class="card">
<div class="card-header">
<h3 class="card-title">{boxTitle}</h3>
</div>

{boxTitle && (
<div class="card-header">
<h3 class="card-title">{boxTitle}</h3>
</div>
)}
<div
class={cx('dimmer', {
active: loading
Expand Down
4 changes: 2 additions & 2 deletions front/src/config/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
},
"devices": {
"editDeviceFeaturesLabel": "Wähle die Geräte aus, die du anzeigen möchtest:",
"editNameLabel": "Widget-Name",
"editNameLabel": "Widget-Name (optional)",
"editNamePlaceholder": "Gib den Namen des Widgets ein",
"addADeviceLabel": "Füge ein Gerät hinzu:"
},
Expand Down Expand Up @@ -414,7 +414,7 @@
"no": "Nein"
},
"scene": {
"editNameLabel": "Gib den Namen dieser Box ein",
"editNameLabel": "Widget-Name (optional)",
"editNamePlaceholder": "Name auf dem Dashboard angezeigt",
"editSceneLabel": "Wähle die Szene aus, die hier angezeigt werden soll."
},
Expand Down
4 changes: 2 additions & 2 deletions front/src/config/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
},
"devices": {
"editDeviceFeaturesLabel": "Select the devices you want to display:",
"editNameLabel": "Widget name",
"editNameLabel": "Widget Name (optional)",
"editNamePlaceholder": "Enter the name of the widget",
"addADeviceLabel": "Add a device:"
},
Expand Down Expand Up @@ -414,7 +414,7 @@
"no": "No"
},
"scene": {
"editNameLabel": "Enter the name of this box",
"editNameLabel": "Widget Name (optional)",
"editNamePlaceholder": "Name displayed on the dashboard",
"editSceneLabel": "Select the scene you want to display here."
},
Expand Down
4 changes: 2 additions & 2 deletions front/src/config/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
},
"devices": {
"editDeviceFeaturesLabel": "Vous pouvez modifier le nom affiché ici :",
"editNameLabel": "Nom du widget",
"editNameLabel": "Nom du widget (optionnel)",
"editNamePlaceholder": "Entrez le nom du widget",
"addADeviceLabel": "Ajouter un appareil :"
},
Expand Down Expand Up @@ -414,7 +414,7 @@
"no": "Non"
},
"scene": {
"editNameLabel": "Entrez le nom de cette box",
"editNameLabel": "Nom du widget (optionnel)",
"editNamePlaceholder": "Nom affiché sur le tableau de bord",
"editSceneLabel": "Sélectionnez la scène que vous souhaitez afficher ici."
},
Expand Down
Loading