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

fix: remove unused style #4244

Merged
merged 2 commits into from
Dec 5, 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
53 changes: 11 additions & 42 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use OCA\Contacts\Service\GroupSharingService;
use OCA\Contacts\Service\SocialApiService;
use OCP\App\IAppManager;

use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
Expand All @@ -22,48 +21,19 @@
use OCP\Util;

class PageController extends Controller {
/** @var IConfig */
private $config;

/** @var IInitialStateService */
private $initialStateService;

/** @var IFactory */
private $languageFactory;

/** @var IUserSession */
private $userSession;

/** @var SocialApiService */
private $socialApiService;

/** @var IAppManager */
private $appManager;

/** @var CompareVersion */
private $compareVersion;

private GroupSharingService $groupSharingService;

public function __construct(IRequest $request,
IConfig $config,
IInitialStateService $initialStateService,
IFactory $languageFactory,
IUserSession $userSession,
SocialApiService $socialApiService,
IAppManager $appManager,
CompareVersion $compareVersion,
GroupSharingService $groupSharingService) {
public function __construct(
IRequest $request,
private IConfig $config,
private IInitialStateService $initialStateService,
private IFactory $languageFactory,
private IUserSession $userSession,
private SocialApiService $socialApiService,
private IAppManager $appManager,
private CompareVersion $compareVersion,
private GroupSharingService $groupSharingService,
) {
parent::__construct(Application::APP_ID, $request);

$this->config = $config;
$this->initialStateService = $initialStateService;
$this->languageFactory = $languageFactory;
$this->userSession = $userSession;
$this->socialApiService = $socialApiService;
$this->appManager = $appManager;
$this->compareVersion = $compareVersion;
$this->groupSharingService = $groupSharingService;
}

/**
Expand Down Expand Up @@ -107,7 +77,6 @@ public function index(): TemplateResponse {
$this->initialStateService->provideInitialState(Application::APP_ID, 'isCirclesEnabled', $isCirclesEnabled && $isCircleVersionCompatible);
$this->initialStateService->provideInitialState(Application::APP_ID, 'isTalkEnabled', $isTalkEnabled && $isTalkVersionCompatible);

Util::addStyle(Application::APP_ID, 'contacts-index');
Util::addStyle(Application::APP_ID, 'contacts-main');
Util::addScript(Application::APP_ID, 'contacts-main');

Expand Down
11 changes: 2 additions & 9 deletions lib/Listener/LoadContactsFilesActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@

class LoadContactsFilesActions implements IEventListener {
public function handle(Event $event): void {
if (!($event instanceof LoadAdditionalScriptsEvent)) {
if (!$event instanceof LoadAdditionalScriptsEvent) {

Check warning on line 20 in lib/Listener/LoadContactsFilesActions.php

View check run for this annotation

Codecov / codecov/patch

lib/Listener/LoadContactsFilesActions.php#L20

Added line #L20 was not covered by tests
return;
}

Util::addStyle(Application::APP_ID, 'contacts-index');
Util::addStyle(Application::APP_ID, 'contacts-files-action');

// only available since Nc 28
if (method_exists(Util::class, 'addInitScript')) {
Util::addInitScript(Application::APP_ID, 'contacts-files-action');
} else {
Util::addScript(Application::APP_ID, 'contacts-files-action', 'files');
}
Util::addInitScript(Application::APP_ID, 'contacts-files-action');

Check warning on line 25 in lib/Listener/LoadContactsFilesActions.php

View check run for this annotation

Codecov / codecov/patch

lib/Listener/LoadContactsFilesActions.php#L25

Added line #L25 was not covered by tests
}
}