Skip to content

Commit

Permalink
enh(core): Refactor profile page to use vue components
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Jan 9, 2024
1 parent 6daa77b commit 4b12a24
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 326 deletions.
4 changes: 2 additions & 2 deletions core/Controller/ProfilePageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

use OC\Profile\ProfileManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\EventDispatcher\IEventDispatcher;
Expand All @@ -42,7 +42,7 @@
use OCP\Share\IManager as IShareManager;
use OCP\UserStatus\IManager as IUserStatusManager;

#[IgnoreOpenAPI]
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
class ProfilePageController extends Controller {
public function __construct(
string $appName,
Expand Down
22 changes: 4 additions & 18 deletions core/src/profile.js → core/src/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@
*
*/

import Vue from 'vue'
import { getRequestToken } from '@nextcloud/auth'
import { translate as t } from '@nextcloud/l10n'
import VTooltip from 'v-tooltip'

import logger from './logger.js'
import Vue from 'vue'

import Profile from './views/Profile.vue'
import ProfileSections from './profile/ProfileSections.js'

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

if (!window.OCA) {
window.OCA = {}
Expand All @@ -41,19 +38,8 @@ if (!window.OCA.Core) {
}
Object.assign(window.OCA.Core, { ProfileSections: new ProfileSections() })

Vue.use(VTooltip)

Vue.mixin({
props: {
logger,
},
methods: {
t,
},
})

const View = Vue.extend(Profile)

window.addEventListener('DOMContentLoaded', () => {
new View().$mount('#vue-profile')
new View().$mount('#content')
})
Loading

0 comments on commit 4b12a24

Please sign in to comment.