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

enh(profile): Refactor code to use vue components and styles where possible #42668

Merged
merged 2 commits into from
Jan 10, 2024
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
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)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly this is not supported by the tool yet.... Still waiting for @provokateurin in nextcloud/openapi-extractor#24

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in #42705

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
Loading