Skip to content

Commit 949e09c

Browse files
susnuxemoral435
authored andcommitted
enh(core): Refactor profile page to use vue components
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent b2aa27f commit 949e09c

File tree

5 files changed

+190
-326
lines changed

5 files changed

+190
-326
lines changed

core/Controller/ProfilePageController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
use OC\Profile\ProfileManager;
3131
use OCP\AppFramework\Controller;
32-
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
32+
use OCP\AppFramework\Http\Attribute\OpenAPI;
3333
use OCP\AppFramework\Http\TemplateResponse;
3434
use OCP\AppFramework\Services\IInitialState;
3535
use OCP\EventDispatcher\IEventDispatcher;
@@ -42,7 +42,7 @@
4242
use OCP\Share\IManager as IShareManager;
4343
use OCP\UserStatus\IManager as IUserStatusManager;
4444

45-
#[IgnoreOpenAPI]
45+
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
4646
class ProfilePageController extends Controller {
4747
public function __construct(
4848
string $appName,
Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@
2020
*
2121
*/
2222

23-
import Vue from 'vue'
2423
import { getRequestToken } from '@nextcloud/auth'
25-
import { translate as t } from '@nextcloud/l10n'
26-
import VTooltip from 'v-tooltip'
27-
28-
import logger from './logger.js'
24+
import Vue from 'vue'
2925

3026
import Profile from './views/Profile.vue'
3127
import ProfileSections from './profile/ProfileSections.js'
3228

33-
__webpack_nonce__ = btoa(getRequestToken())
29+
// @ts-expect-error Script nonce required for webpack loading additional scripts
30+
__webpack_nonce__ = btoa(getRequestToken() ?? '')
3431

3532
if (!window.OCA) {
3633
window.OCA = {}
@@ -41,19 +38,8 @@ if (!window.OCA.Core) {
4138
}
4239
Object.assign(window.OCA.Core, { ProfileSections: new ProfileSections() })
4340

44-
Vue.use(VTooltip)
45-
46-
Vue.mixin({
47-
props: {
48-
logger,
49-
},
50-
methods: {
51-
t,
52-
},
53-
})
54-
5541
const View = Vue.extend(Profile)
5642

5743
window.addEventListener('DOMContentLoaded', () => {
58-
new View().$mount('#vue-profile')
44+
new View().$mount('#content')
5945
})

0 commit comments

Comments
 (0)