Skip to content

Commit b9e303f

Browse files
authored
Merge pull request #62625 from nextcloud/enh/noid/vue3-weather
Migrate weather status to vue3
2 parents 4cf0888 + b7a5b8f commit b9e303f

418 files changed

Lines changed: 623 additions & 688 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/weather_status/lib/Listeners/BeforeTemplateRenderedListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ public function handle(Event $event): void {
3535
}
3636

3737
Util::addScript('weather_status', 'weather-status');
38+
Util::addStyle('weather_status', 'weather-status');
3839
}
3940
}

apps/weather_status/src/App.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<NcActions
99
class="weather-status-menu-item__subheader"
1010
:aria-label="currentWeatherMessage"
11-
:menu-name="currentWeatherMessage">
11+
:menuName="currentWeatherMessage">
1212
<template #icon>
1313
<NcLoadingIcon v-if="loading" />
1414
<img
@@ -34,7 +34,7 @@
3434
v-if="gotWeather"
3535
target="_blank"
3636
:href="weatherLinkTarget"
37-
:close-after-click="true">
37+
:closeAfterClick="true">
3838
<template #icon>
3939
<NcIconSvgWrapper
4040
name="MapMarker"
@@ -57,7 +57,7 @@
5757
</NcActionButton>
5858
<NcActionSeparator v-if="address && !errorMessage" />
5959
<NcActionButton
60-
:close-after-click="true"
60+
:closeAfterClick="true"
6161
@click="onBrowserLocationClick">
6262
<template #icon>
6363
<NcIconSvgWrapper
@@ -73,7 +73,7 @@
7373
:disabled="false"
7474
icon="icon-rename"
7575
type="text"
76-
model-value=""
76+
modelValue=""
7777
@submit="onAddressSubmit" />
7878
<template v-if="favorites.length > 0">
7979
<NcActionCaption :name="t('weather_status', 'Favorites')" />
@@ -102,7 +102,6 @@ import starOutlineSvg from '@mdi/svg/svg/star-outline.svg?raw'
102102
import starSvg from '@mdi/svg/svg/star.svg?raw'
103103
import { showError } from '@nextcloud/dialogs'
104104
import { getLocale } from '@nextcloud/l10n'
105-
import moment from '@nextcloud/moment'
106105
import { imagePath } from '@nextcloud/router'
107106
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
108107
import NcActionCaption from '@nextcloud/vue/components/NcActionCaption'
@@ -865,10 +864,6 @@ export default {
865864
}
866865
},
867866
868-
formatTime(time) {
869-
return moment(time).format('LT')
870-
},
871-
872867
getTemperature(forecasts, offset = 0) {
873868
return forecasts.length > offset ? forecasts[offset].data.instant.details.air_temperature : ''
874869
},

apps/weather_status/src/weather-status.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import { getCSPNonce } from '@nextcloud/auth'
7-
import Vue from 'vue'
6+
import { createApp } from 'vue'
87
import App from './App.vue'
98

10-
__webpack_nonce__ = getCSPNonce()
11-
12-
Vue.prototype.t = t
13-
149
document.addEventListener('DOMContentLoaded', function() {
1510
if (!OCA.Dashboard) {
1611
return
1712
}
1813

1914
OCA.Dashboard.registerStatus('weather', (el) => {
20-
const Dashboard = Vue.extend(App)
21-
return new Dashboard().$mount(el)
15+
const app = createApp(App)
16+
app.mixin({ methods: { t, n } })
17+
return app.mount(el)
2218
})
2319
})

build/frontend-legacy/webpack.modules.cjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ module.exports = {
6767
updatenotification: path.join(__dirname, 'apps/updatenotification/src', 'updatenotification.js'),
6868
'update-notification-legacy': path.join(__dirname, 'apps/updatenotification/src', 'update-notification-legacy.ts'),
6969
},
70-
weather_status: {
71-
'weather-status': path.join(__dirname, 'apps/weather_status/src', 'weather-status.js'),
72-
},
7370
workflowengine: {
7471
workflowengine: path.join(__dirname, 'apps/workflowengine/src', 'workflowengine.js'),
7572
},

build/frontend/apps/weather_status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../apps/weather_status

build/frontend/vite.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ const modules = {
8282
user_status: {
8383
menu: resolve(import.meta.dirname, 'apps/user_status/src', 'menu.js'),
8484
},
85+
weather_status: {
86+
'weather-status': resolve(import.meta.dirname, 'apps/weather_status/src', 'weather-status.js'),
87+
},
8588
}
8689

8790
// convert modules to modules entries prefied with the app id
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import{a as t}from"./index-Czc5GTr1.chunk.mjs";import{t as m}from"./translation-DoG5ZELJ-hYauSqYO.chunk.mjs";import{C as e,a as p}from"./CommentView-CPZtmu56.chunk.mjs";import{l as i}from"./activity-CAMqbip4.chunk.mjs";import{b as a,r as s,o as n,c,m as u}from"./Web-Cti_s7Nd.chunk.mjs";import{_ as l}from"./public-C1mLBHT3.chunk.mjs";import"./mdi-BmXSqhBI.chunk.mjs";import"./NcModal-DiDvgcU8-Byn0vO0C.chunk.mjs";import"./logger-D3RVzcfQ-C7aw_g9X.chunk.mjs";import"./createElementId-DhjFt1I9-DyhKY9_Z.chunk.mjs";import"./index-kP1pdrFW.chunk.mjs";import"./Check-BCcekaS6.chunk.mjs";import"./TrashCanOutline--zyyOtWX.chunk.mjs";import"./PencilOutline-rDieoUFC.chunk.mjs";import"./NcActionSeparator-B9pNQaji-Oo0JJDSn.chunk.mjs";import"./NcAvatar-1KxMUN7V-B2YSKjzX.chunk.mjs";import"./index-B1wP8tlr.chunk.mjs";import"./util-C9Hc1fff.chunk.mjs";import"./ArrowRight-Bmx0uKvc.chunk.mjs";import"./colors-Cv9F-jWS-xyX99ako.chunk.mjs";import"./NcUserStatusIcon-BF5OEQFU-mN2bb1uW.chunk.mjs";import"./NcActionLink-BFiaYt9A-C1NepubF.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7-BfjdLGR6.chunk.mjs";import"./NcActionText-CQ9qwJ0p-B9DxMewk.chunk.mjs";import"./NcUserBubble-BXR7vT0V-D3Ki-x4R.chunk.mjs";import"./GetComments-KeOYs-CY.chunk.mjs";import"./index-CdlgfEAJ.chunk.mjs";import"./dav-7lRRXOj7.chunk.mjs";import"./externalStorageUtils-C3askeL2.chunk.mjs";const d=a({components:{CommentEntry:p},mixins:[e],props:{reloadCallback:{type:Function,required:!0}},methods:{onNewComment(){try{this.reloadCallback()}catch(o){t(m("comments","Could not reload comments")),i.error("Could not reload comments",{error:o})}}}});function C(o,f,y,b,w,N){const r=s("CommentEntry");return n(),c(r,u(o.editorData,{autoComplete:o.autoComplete,resourceType:o.resourceType,editor:!0,userData:o.userData,resourceId:o.resourceId,class:"comments-action",onNew:o.onNewComment}),null,16,["autoComplete","resourceType","userData","resourceId","onNew"])}const W=l(d,[["render",C],["__scopeId","data-v-099b6b12"]]);export{W as default};
2+
//# sourceMappingURL=ActivityCommentAction-BjD71twg.chunk.mjs.map
File renamed without changes.

dist/ActivityCommentAction-BseXwmnO.chunk.mjs.map renamed to dist/ActivityCommentAction-BjD71twg.chunk.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ActivityCommentAction-BseXwmnO.chunk.mjs.map.license renamed to dist/ActivityCommentAction-BjD71twg.chunk.mjs.map.license

File renamed without changes.

0 commit comments

Comments
 (0)