From e16ab4a3641bad7762a9e0ce2f1c66943cd8298b Mon Sep 17 00:00:00 2001 From: Devlin Junker Date: Mon, 25 Sep 2023 13:15:14 -0700 Subject: add warning message generated with PHP, also check for subcribe_to parameter Signed-off-by: Devlin Junker --- docs/developer.md | 2 +- lib/Plugin/Client/Plugin.php | 2 + src/components/AddFeed.vue | 5 +++ src/components/Sidebar.vue | 14 +++++-- src/components/SidebarFeedLinkActions.vue | 1 - src/components/feed-display/FeedItemRow.vue | 2 +- src/main.js | 10 ++++- templates/index.php | 23 ++++++----- templates/part.content.warnings.php | 61 +++++++++++++++++++++++++++++ 9 files changed, 103 insertions(+), 17 deletions(-) create mode 100644 templates/part.content.warnings.php diff --git a/docs/developer.md b/docs/developer.md index 50f82db1d..0d8f26f04 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -20,7 +20,7 @@ The PHP code should all adhere to [PSR-2](https://www.php-fig.org/psr/psr-2/). *Note that this is a different codestyle than Nextcloud itself uses.* To test the codestyle you can run `make phpcs`. -For linting JavaScript, a [jshint file](https://github.com/nextcloud/news/blob/master/js/.jshintrc) is used that is run before compiling the JavaScript. +The application Front End uses Vue 2.7 and the Nextcloud Libraries [Vue Components](https://github.com/nextcloud-libraries/nextcloud-vue) for building the Application running inside your Nextcloud instance. For linting these files, we are using eslint, see the [config file](https://github.com/nextcloud/news/blob/master/.eslintrc.js). We also have Unit Tests for the components that run with Jest, please ensure these pass when adding new features/fixing bugs. ## General Developer setup Check the Nextcloud [documentation](https://docs.nextcloud.com/server/latest/developer_manual/getting_started/devenv.html) to learn how to setup a developer environment, alternatively to a proper web server you can also use the [builtin php server](https://www.php.net/manual/en/features.commandline.webserver.php) on demand, it is enough for development purposes. diff --git a/lib/Plugin/Client/Plugin.php b/lib/Plugin/Client/Plugin.php index 373968056..d96d306e6 100644 --- a/lib/Plugin/Client/Plugin.php +++ b/lib/Plugin/Client/Plugin.php @@ -14,6 +14,8 @@ namespace OCA\News\Plugin\Client; /** + * TODO: remove this? it seems old.. there is no global list of plugins anymore and seems like plugins register themselves + * * We actually really want to avoid this global list of plugins. A way would be * for News plugin apps to register themselves in a special database table * and the News app would just pull out the scripts that should be attached diff --git a/src/components/AddFeed.vue b/src/components/AddFeed.vue index 6e0aac0a8..77f5e5b6e 100644 --- a/src/components/AddFeed.vue +++ b/src/components/AddFeed.vue @@ -151,6 +151,11 @@ export default Vue.extend({ || (this.createNewFolder && (this.newFolderName === '' || this.folderNameExists()))) }, }, + created() { + if (this.$route.query.subscribe_to) { + this.feedUrl = this.$route.query.subscribe_to as string + } + }, methods: { /** * Adds a New Feed via the Vuex Store diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 392c0ccfb..9fd3e8a05 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -48,7 +48,8 @@ :name="topLevelItem.name || topLevelItem.title" :icon="''" :to="isFolder(topLevelItem) ? { name: ROUTES.FOLDER, params: { folderId: topLevelItem.id.toString() }} : { name: ROUTES.FEED, params: { feedId: topLevelItem.id.toString() } }" - :allow-collapse="true"> + :allow-collapse="true" + :force-menu="true"> - diff --git a/src/components/feed-display/FeedItemRow.vue b/src/components/feed-display/FeedItemRow.vue index 03670295a..34a8d18b8 100644 --- a/src/components/feed-display/FeedItemRow.vue +++ b/src/components/feed-display/FeedItemRow.vue @@ -203,7 +203,7 @@ export default Vue.extend({ align-self: start; } - .button-container .action-item .button-vue, .button-container .material-design-icon { + .feed-item-row .button-container .button-vue, .feed-item-row .button-container .button-vue .button-vue__wrapper, .feed-item-row .button-container .material-design-icon { width: 30px !important; min-width: 30px; min-height: 30px; diff --git a/src/main.js b/src/main.js index e2ddda527..571646471 100644 --- a/src/main.js +++ b/src/main.js @@ -23,6 +23,14 @@ const store = new Store(mainStore) export default new Vue({ router, store, - el: '#content', + el: '#q-app', render: (h) => h(App), }) + +/** + * Closes warning messages generated by PHP code + */ +function closeCronWarning() { + document.getElementById('cron-warning').style.display = 'none' +} +document.getElementById('close-cron-warning').onclick = closeCronWarning diff --git a/templates/index.php b/templates/index.php index 561bf361b..1f661979c 100644 --- a/templates/index.php +++ b/templates/index.php @@ -1,14 +1,19 @@ $fileName) { + style($appName, $fileName); +} +foreach (Plugin::getScripts() as $appName => $fileName) { + script($appName, $fileName); +} + +print_unescaped($this->inc('part.content.warnings')) + ?> +
diff --git a/templates/part.content.warnings.php b/templates/part.content.warnings.php new file mode 100644 index 000000000..b791de024 --- /dev/null +++ b/templates/part.content.warnings.php @@ -0,0 +1,61 @@ + + + +
+
+

t('Ajax or webcron mode detected! Your feeds will not be updated!')); ?>

+ +
+
+ X +
+
+ -- cgit v1.2.3