Skip to content

Commit

Permalink
Merge pull request #35939 from nextcloud/bugfix/noid/update-status-da…
Browse files Browse the repository at this point in the history
…shboard-widget

Update the user status dashboard widget and fix the icon color
  • Loading branch information
nickvergessen authored Jan 2, 2023
2 parents 67845dd + f998fe0 commit 961dcdd
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 61 deletions.
4 changes: 4 additions & 0 deletions apps/user_status/css/user-status-menu.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/user_status/css/user-status-menu.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions apps/user_status/css/user-status-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
background-image: url("../img/app.svg");
}

.icon-user-status-dark {
background-image: url("../img/app-dark.svg");

}

.icon-user-status-online {
background-image: url('../img/user-status-online.svg');
}
Expand Down
1 change: 1 addition & 0 deletions apps/user_status/img/app-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/user_status/lib/Dashboard/UserStatusWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ public function getOrder(): int {
* @inheritDoc
*/
public function getIconClass(): string {
return 'icon-user-status';
return 'icon-user-status-dark';
}

/**
* @inheritDoc
*/
public function getIconUrl(): string {
return $this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->imagePath(Application::APP_ID, 'app.svg')
$this->urlGenerator->imagePath(Application::APP_ID, 'app-dark.svg')
);
}

Expand Down
43 changes: 17 additions & 26 deletions apps/user_status/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
-->

<template>
<DashboardWidget id="user-status_panel"
<NcDashboardWidget id="user-status_panel"
:items="items"
:loading="loading">
:loading="loading"
:empty-content-message="t('user_status', 'No recent status changes')">
<template #default="{ item }">
<DashboardWidgetItem :main-text="item.mainText"
<NcDashboardWidgetItem :main-text="item.mainText"
:sub-text="item.subText">
<template #avatar>
<NcAvatar class="item-avatar"
Expand All @@ -34,33 +35,27 @@
:show-user-status="false"
:show-user-status-compact="false" />
</template>
</DashboardWidgetItem>
</NcDashboardWidgetItem>
</template>
<template #empty-content>
<NcEmptyContent id="user_status-widget-empty-content">
<template #icon>
<div class="icon-user-status" />
</template>
{{ t('user_status', 'No recent status changes') }}
</NcEmptyContent>
<template #emptyContentIcon>
<div class="icon-user-status-dark" />
</template>
</DashboardWidget>
</NcDashboardWidget>
</template>

<script>
import { DashboardWidget, DashboardWidgetItem } from '@nextcloud/vue-dashboard'
import { loadState } from '@nextcloud/initial-state'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar'
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent'
import NcDashboardWidget from '@nextcloud/vue/dist/Components/NcDashboardWidget'
import NcDashboardWidgetItem from '@nextcloud/vue/dist/Components/NcDashboardWidgetItem'
import moment from '@nextcloud/moment'

export default {
name: 'Dashboard',
components: {
NcAvatar,
DashboardWidget,
DashboardWidgetItem,
NcEmptyContent,
NcDashboardWidget,
NcDashboardWidgetItem,
},
data() {
return {
Expand Down Expand Up @@ -117,14 +112,10 @@ export default {
</script>

<style lang="scss">
#user_status-widget-empty-content {
text-align: center;
margin-top: 5vh;
.icon-user-status {
width: 64px;
height: 64px;
background-size: 64px;
filter: var(--background-invert-if-dark);
}
.icon-user-status-dark {
width: 64px;
height: 64px;
background-size: 64px;
filter: var(--background-invert-if-dark);
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function testGetOrder(): void {
}

public function testGetIconClass(): void {
$this->assertEquals('icon-user-status', $this->widget->getIconClass());
$this->assertEquals('icon-user-status-dark', $this->widget->getIconClass());
}

public function testGetUrl(): void {
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

26 changes: 4 additions & 22 deletions dist/core-common.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@

/*! For license information please see NcColorPicker.js.LICENSE.txt */

/*! For license information please see NcDashboardWidget.js.LICENSE.txt */

/*! For license information please see NcDashboardWidgetItem.js.LICENSE.txt */

/*! For license information please see NcDatetimePicker.js.LICENSE.txt */

/*! For license information please see NcHighlight.js.LICENSE.txt */
Expand Down Expand Up @@ -686,28 +690,6 @@
*
*/

/**
* @copyright Copyright (c) 2020 Greta Doci <gretadoci@gmail.com>
*
* @author 2020 Greta Doci <gretadoci@gmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
*
Expand Down
2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/user_status-dashboard.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/user_status-dashboard.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/weather_status-weather-status.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/weather_status-weather-status.js.map

Large diffs are not rendered by default.

0 comments on commit 961dcdd

Please sign in to comment.