Skip to content

Commit

Permalink
Merge pull request #1145 from nextcloud/feat/add-nextcloud-changelog
Browse files Browse the repository at this point in the history
feat: Add Nextcloud Hub changelog
  • Loading branch information
susnux authored Apr 8, 2024
2 parents 0f82f02 + 32f3d46 commit b05e8cf
Show file tree
Hide file tree
Showing 42 changed files with 1,210 additions and 756 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["@nextcloud"]
"extends": ["@nextcloud/eslint-config/typescript"]
}
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,14 @@ Make sure you have `node`, `npm` and `make` installed on your system.
3. 🏗 To build the Javascript after you have made changes, run `npm run build`
4. ✅ Enable the app through the app management of your Nextcloud
5. 🎉 Partytime! Help fix [some issues](https://github.com/nextcloud/firstrunwizard/issues) and [review pull requests](https://github.com/nextcloud/firstrunwizard/pulls) 👍

### Add Nextcloud Hub release notes

1. Open the `src/hub-release.ts` file
2. Adjust the `version` property to reflect the new Hub release version
3. Adjust the `link` (e.g. blog post)
4. Add `releaseNotes`, this is an array of strings, for localization those are translated using `t('firstrunwizard', 'YOUR MESSAGE')`
5. Change the `videoAltText` for the Hub release animation if needed (alternative text for accessibility)
6. Adjust the `shareSubject` which is used when users share their thoughts about the release on social media
7. Replace `img/nextcloudHub.mp4` and `img/nextcloudHub.webm` (VP9) with updated animations
8. Update the current changelog version in `lib/Constants.php`
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The First run wizard can be customized to meet specific design goals, or to chan
<navigations>
<navigation>
<id>firstrunwizard_about</id>
<name>About</name>
<name>About &amp; What's new</name>
<icon>info.svg</icon>
<order>99990</order>
<type>settings</type>
Expand Down
23 changes: 1 addition & 22 deletions css/firstrunwizard-main.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions img/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/mastodon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/nextcloudHub.mp4
Binary file not shown.
Binary file added img/nextcloudHub.webm
Binary file not shown.
1 change: 1 addition & 0 deletions img/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions js/firstrunwizard-about.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = [OC.filePath('firstrunwizard', '', 'js/main-grmXwU92.mjs'),OC.filePath('firstrunwizard', '', 'css/firstrunwizard-main.css')]
__vite__mapDeps.viteFileDeps = [OC.filePath('firstrunwizard', '', 'js/main-rS92LHob.mjs'),OC.filePath('firstrunwizard', '', 'css/firstrunwizard-main.css')]
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
/*! third party licenses: js/vendor.LICENSE.txt */
import{_ as i}from"./modulepreload-polyfill-DDskOgo1.mjs";document.addEventListener("DOMContentLoaded",function(){const o=document.querySelector("#firstrunwizard_about button"),t=()=>{document.querySelector("#firstrunwizard_about button").addEventListener("click",async function(e){var n;e.stopPropagation(),e.preventDefault();const r=(n=document.querySelector('[aria-controls="header-menu-user-menu"]'))!=null?n:void 0,{open:u}=await i(()=>import("./main-grmXwU92.mjs"),__vite__mapDeps([0,1]),import.meta.url);u(r),OC.hideMenus(()=>!1)})};o?t():window._nc_event_bus.subscribe("core:user-menu:mounted",t)});
import{_ as i}from"./modulepreload-polyfill-DDskOgo1.mjs";document.addEventListener("DOMContentLoaded",function(){const o=document.querySelector("#firstrunwizard_about button"),t=()=>{document.querySelector("#firstrunwizard_about button").addEventListener("click",async function(e){var n;e.stopPropagation(),e.preventDefault();const r=(n=document.querySelector('[aria-controls="header-menu-user-menu"]'))!=null?n:void 0,{open:u}=await i(()=>import("./main-rS92LHob.mjs"),__vite__mapDeps([0,1]),import.meta.url);u(r),OC.hideMenus(()=>!1)})};o?t():window._nc_event_bus.subscribe("core:user-menu:mounted",t)});
4 changes: 2 additions & 2 deletions js/firstrunwizard-activate.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = [OC.filePath('firstrunwizard', '', 'js/main-grmXwU92.mjs'),OC.filePath('firstrunwizard', '', 'css/firstrunwizard-main.css')]
__vite__mapDeps.viteFileDeps = [OC.filePath('firstrunwizard', '', 'js/main-rS92LHob.mjs'),OC.filePath('firstrunwizard', '', 'css/firstrunwizard-main.css')]
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
/*! third party licenses: js/vendor.LICENSE.txt */
import{_ as t}from"./modulepreload-polyfill-DDskOgo1.mjs";document.addEventListener("DOMContentLoaded",async function(){(await t(()=>import("./main-grmXwU92.mjs"),__vite__mapDeps([0,1]),import.meta.url)).open()});
import{_ as t}from"./modulepreload-polyfill-DDskOgo1.mjs";document.addEventListener("DOMContentLoaded",async function(){(await t(()=>import("./main-rS92LHob.mjs"),__vite__mapDeps([0,1]),import.meta.url)).open()});
2 changes: 0 additions & 2 deletions js/main-grmXwU92.mjs

This file was deleted.

1 change: 0 additions & 1 deletion js/main-grmXwU92.mjs.map

This file was deleted.

2 changes: 2 additions & 0 deletions js/main-rS92LHob.mjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/main-rS92LHob.mjs.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions js/vendor.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ license: MIT
version: 0.1.5
license: Apache-2.0

@mdi/js
version: 7.4.47
license: Apache-2.0

@nextcloud/auth
version: 2.2.1
license: GPL-3.0-or-later
Expand Down Expand Up @@ -200,10 +204,6 @@ vue-demi
version: 0.14.7
license: MIT

vue-material-design-icons
version: 5.3.0
license: MIT

vue2-datepicker
version: 3.11.1
license: MIT
32 changes: 32 additions & 0 deletions lib/Constants.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* @copyright Copyright (c) 2024 Ferdinand Thiessen <[email protected]>
*
* @author Ferdinand Thiessen <[email protected]>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\FirstRunWizard;

class Constants {
/**
* Version for which the latest changelog entries are available
* This is used to decide if we show the wizard for users on an update
*/
public const CHANGELOG_VERSION = '29.0.0';
}
7 changes: 6 additions & 1 deletion lib/Controller/WizardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public function __construct(
* @return DataResponse
*/
public function disable() {
$this->config->setUserValue($this->userId, 'firstrunwizard', 'show', '0');
// get the current Nextcloud version
$version = \OCP\Util::getVersion();
// we only use major.minor.patch
array_splice($version, 3);
// Set "show" to current version to only show on update
$this->config->setUserValue($this->userId, 'firstrunwizard', 'show', implode('.', $version));
return new DataResponse();
}
}
13 changes: 12 additions & 1 deletion lib/Listener/BeforeTemplateRenderedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
namespace OCA\FirstRunWizard\Listener;

use OCA\FirstRunWizard\AppInfo\Application;
use OCA\FirstRunWizard\Constants;
use OCA\FirstRunWizard\Notification\AppHint;
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
use OCP\AppFramework\Services\IAppConfig;
Expand Down Expand Up @@ -73,9 +74,19 @@ public function handle(Event $event): void {
}

if ($this->appConfig->getAppValueBool('wizard_enabled', true)) {
if ($this->config->getUserValue($user->getUID(), Application::APP_ID, 'show', '1') !== '0') {
$lastSeenVersion = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'show', '0.0.0');

// If current is newer then last seen we activate the wizard
if (version_compare(Constants::CHANGELOG_VERSION, $lastSeenVersion, '>')) {
Util::addScript(Application::APP_ID, Application::APP_ID . '-activate');
}

// If the user was already seen before (compatibility with older wizard versions where the value was 1)
// then we only show the changelog
if (version_compare($lastSeenVersion, '1', '>')) {
$this->initialState->provideInitialState('changelogOnly', true);
} else {
// Otherwise if the user really uses Nextcloud for the very first time we create notifications for them
$this->jobList->add('OCA\FirstRunWizard\Notification\BackgroundJob', ['uid' => $this->userSession->getUser()->getUID()]);
}

Expand Down
42 changes: 25 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"stylelint:fix": "stylelint src/**/*.scss src/**/*.vue --fix"
},
"dependencies": {
"@mdi/js": "^7.4.47",
"@nextcloud/axios": "^2.4.0",
"@nextcloud/initial-state": "^2.1.0",
"@nextcloud/l10n": "^2.2.0",
"@nextcloud/router": "^3.0.0",
"@nextcloud/vue": "^8.11.1",
"vue": "^2.7.16",
"vue-material-design-icons": "^5.3.0"
"vue": "^2.7.16"
},
"browserslist": [
"extends @nextcloud/browserslist-config"
Expand All @@ -35,8 +35,10 @@
"@nextcloud/browserslist-config": "^3.0.0",
"@nextcloud/eslint-config": "^8.3.0",
"@nextcloud/stylelint-config": "^2.4.0",
"@nextcloud/typings": "^1.8.0",
"@nextcloud/vite-config": "^1.2.2",
"@vue/tsconfig": "^0.5.1",
"sass": "^1.74.1",
"vite": "^5.2.7"
"vite": "^5.2.8"
}
}
Loading

0 comments on commit b05e8cf

Please sign in to comment.