Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
430b86f
chore: Migrate package to use vite for building and use Vue for UI
susnux Oct 11, 2023
5b9f53a
fix: Allow directly navigating to a the filtered app view
susnux Oct 30, 2023
c18aa03
fix: Make the app navigation a second named router-view
susnux Oct 30, 2023
1c2e6ef
fix!: Make the setting for RSS feed to take a real boolean as value
susnux Oct 30, 2023
ad2e221
feat: Implement ActivityFeed view
susnux Nov 5, 2023
a92520c
feat(Activity): Allow to show previews in Activity component
susnux Nov 5, 2023
88787e2
fix: Load and show previews in the Activity app view
susnux Nov 5, 2023
c91d5ea
fix: Adjust icons to Nextcloud default size of 20x20 px
susnux Nov 8, 2023
7472efe
feat: Show loading indicator on activity feed
susnux Nov 8, 2023
29000ec
fix!: Drop legacy scripts
susnux Nov 8, 2023
3e2d69e
chore: Do not introduce too many new stuff, revert css modules to sco…
susnux Nov 8, 2023
a0d917e
fix: Adjusted loading indicator to look like in previous UI version
susnux Nov 8, 2023
2723ddc
fix(Actvitiy): When wraping text keep content within container and do…
susnux Nov 8, 2023
f612016
fix: On Nextcloud GmbH the copyright should be set to author instead …
susnux Nov 8, 2023
58ae402
fix: Allow empty filter and fallback to `all`
susnux Nov 8, 2023
fd0b1bc
fix: Adjust UI for some review comments
susnux Nov 8, 2023
219ec1f
fix(tests): Adjust unit tests
susnux Nov 8, 2023
158bb17
chore(deps): Update to stable nextcloud/vue and nextcloud/dialogs
susnux Nov 8, 2023
b15a83a
fix(tests): Adjust node tests to use vitest
susnux Nov 8, 2023
80d57db
chore: Compile assets
susnux Nov 8, 2023
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
Next Next commit
chore: Migrate package to use vite for building and use Vue for UI
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Nov 8, 2023
commit 430b86f48d59ecd7b479436c7a9b0e392ae49a85
12 changes: 0 additions & 12 deletions .eslintrc.js

This file was deleted.

12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"@nextcloud/eslint-config/typescript"
],
"rules": {
// Allow shallow import of @vue/test-utils in order to be able to use it in
// the src folder
"n/no-unpublished-import": ["error", {
"allowModules": ["@vue/test-utils", "@testing-library/vue", "regenerator-runtime"]
}]
}
}
5 changes: 0 additions & 5 deletions babel.config.js

This file was deleted.

6 changes: 3 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

import {
configureNextcloud,
startNextcloud,
stopNextcloud,
waitOnNextcloud,
} from './cypress/dockerNode'
// eslint-disable-next-line n/no-extraneous-import
import { defineConfig } from 'cypress'

import browserify from '@cypress/browserify-preprocessor'
import vitePreprocessor from 'cypress-vite'
import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin'

export default defineConfig({
Expand Down Expand Up @@ -45,7 +45,7 @@ export default defineConfig({
// You may want to clean this up later by importing these.
async setupNodeEvents(on, config) {
// Fix browserslist extend https://github.com/cypress-io/cypress/issues/2983#issuecomment-570616682
on('file:preprocessor', browserify({ typescript: require.resolve('typescript') }))
on('file:preprocessor', vitePreprocessor({ configFile: false }))

// Enable the snapshot compare plugin
getCompareSnapshotsPlugin(on, config)
Expand Down
5 changes: 3 additions & 2 deletions cypress/dockerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ import Docker from 'dockerode'
import path from 'path'
import waitOn from 'wait-on'

import pkg from '../package.json'
import { fileURLToPath } from 'url';
const __dirname = fileURLToPath(new URL('.', import.meta.url));

export const docker = new Docker()

const APP_PATH = path.resolve(__dirname, '../')
const APP_NAME = pkg.name
const APP_NAME = 'activity'

const CONTAINER_NAME = 'nextcloud-cypress-tests-' + APP_NAME
const SERVER_IMAGE = 'ghcr.io/nextcloud/continuous-integration-shallow-server'
Expand Down
7 changes: 7 additions & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"extends": "../tsconfig.json",
"include": ["./**/*.ts"],
"compilerOptions": {
"types": [
"cypress",
"dockerode",
"node"
]
}
}
83 changes: 72 additions & 11 deletions lib/Controller/ActivitiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Joas Schilling <[email protected]>
* @author Ferdinand Thiessen <[email protected]>
*
* @license AGPL-3.0
*
Expand All @@ -24,24 +25,31 @@

use OCA\Activity\Data;
use OCA\Activity\Event\LoadAdditionalScriptsEvent;
use OCA\Activity\Navigation;
use OCP\Activity\IFilter;
use OCP\Activity\IManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IRequest;
use OCP\IURLGenerator;

class ActivitiesController extends Controller {

public function __construct(
string $appName,
IRequest $request,
protected IConfig $config,
protected Data $data,
protected Navigation $navigation,
protected IEventDispatcher $eventDispatcher,
private IL10N $l10n) {
private string $userId,
private IConfig $config,
private Data $data,
private IL10N $l10n,
private IEventDispatcher $eventDispatcher,
private IInitialState $initialState,
private IURLGenerator $urlGenerator,
private IManager $activityManager,
) {
parent::__construct($appName, $request);
}

Expand All @@ -59,11 +67,64 @@ public function showList(string $filter = 'all'): TemplateResponse {
$this->eventDispatcher->dispatchTyped($event);
$this->eventDispatcher->dispatch(LoadAdditionalScriptsEvent::EVENT_ENTITY, $event);

return new TemplateResponse('activity', 'stream.body', [
'appNavigation' => $this->navigation->getTemplate($filter),
'avatars' => $this->config->getSystemValue('enable_avatars', true) ? 'yes' : 'no',
'filter' => $filter,
'pageTitle' => $this->l10n->t('Activity')
$this->initialState->provideInitialState('settings', [
'enableAvatars' => $this->config->getSystemValue('enable_avatars', true),
'personalSettingsLink' => $this->getPersonalSettingsLink(),
'rssLink' => $this->getRSSLink(),
]);
$this->initialState->provideInitialState('filter', $filter);
$this->initialState->provideInitialState('navigationList', $this->getLinkList());

\OCP\Util::addScript($this->appName, 'activity-app');
\OCP\Util::addStyle($this->appName, 'style');

return new TemplateResponse($this->appName, 'app-main');
}

/**
* Get link for personal settings
*/
protected function getPersonalSettingsLink(): string {
return $this->urlGenerator->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'notifications']);
}

/**
* Link to RSS feed if there is a RSS token, empty string otherwise
*/
protected function getRSSLink(): string {
$rssToken = $this->config->getUserValue($this->userId, 'activity', 'rsstoken');
if ($rssToken) {
return $this->urlGenerator->linkToRouteAbsolute('activity.Feed.show', ['token' => $rssToken]);
} else {
return '';
}
}

/**
* Get all items for the users we want to send an email to
*
* @return array Notification data (user => array of rows from the table)
*/
protected function getLinkList(): array {
$filters = $this->activityManager->getFilters();
usort($filters, static function (IFilter $a, IFilter $b) {
if ($a->getPriority() === $b->getPriority()) {
return (int) ($a->getIdentifier() > $b->getIdentifier());
}

return (int) ($a->getPriority() > $b->getPriority());
});

$entries = [];
foreach ($filters as $filter) {
$entries[] = [
'id' => $filter->getIdentifier(),
'icon' => $filter->getIcon(),
'name' => $filter->getName(),
'url' => $this->urlGenerator->linkToRoute('activity.Activities.showList', ['filter' => $filter->getIdentifier()]),
];
}

return $entries;
}
}
114 changes: 0 additions & 114 deletions lib/Navigation.php

This file was deleted.

Loading