diff --git a/.editorconfig b/.editorconfig index 3e787db9..69b7b806 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,3 +15,7 @@ indent_style = space [*.json] indent_size = 4 indent_style = space + +[*.vue] +indent_size = 4 +indent_style = space diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 1734863b..d9f161ef 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -47,6 +47,8 @@ class Application extends App { 'show_labs_settings' => 'true', 'set_custom_permalink' => 'false', 'sso_immediate_redirect' => 'false', + + // Default is set in the OCA\RiotChat\Settings\ShareAdmin class 'share_domain' => '', 'share_prefix' => '', 'share_suffix' => '', diff --git a/lib/Settings/ElementAdmin.php b/lib/Settings/Admin.php similarity index 96% rename from lib/Settings/ElementAdmin.php rename to lib/Settings/Admin.php index c7242a69..40de6b04 100644 --- a/lib/Settings/ElementAdmin.php +++ b/lib/Settings/Admin.php @@ -30,7 +30,7 @@ use OCP\IUserSession; use OCP\Settings\ISettings; -class ElementAdmin implements ISettings { +class Admin implements ISettings { /** @var IConfig */ private $config; @@ -58,6 +58,7 @@ public function __construct(IConfig $config, IUserSession $user, IInitialStateSe */ public function getForm() { foreach (Application::AvailableSettings as $key => $default) { + // TODO: Don't send non-Element related settings here $data = $this->config->getAppValue(Application::APP_ID, $key, $default); $this->initialStateService->provideInitialState(Application::APP_ID, $key, $data); } diff --git a/lib/Settings/ElementAdminSection.php b/lib/Settings/AdminSection.php similarity index 97% rename from lib/Settings/ElementAdminSection.php rename to lib/Settings/AdminSection.php index 20a54a7d..7d00765c 100644 --- a/lib/Settings/ElementAdminSection.php +++ b/lib/Settings/AdminSection.php @@ -27,7 +27,7 @@ use OCP\IURLGenerator; use OCP\Settings\IIconSection; -class ElementAdminSection implements IIconSection { +class AdminSection implements IIconSection { /** @var IURLGenerator */ private $urlGenerator; diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index de59ef50..c41ca5db 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -22,27 +22,16 @@ namespace OCA\RiotChat\Settings; +use OCA\RiotChat\AppInfo\Application; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\Settings\ISettings; class Personal implements ISettings { - private $config; - protected $appName; - public function __construct( - string $appName, - IConfig $config - ) { - $this->appName = $appName; - $this->config = $config; - } public function getForm() { - $parameters = [ - 'appName' => $this->appName, - ]; - return new TemplateResponse($this->appName, 'settings/personal', $parameters, ''); + return new TemplateResponse(Application::APP_ID, 'settings/personal'); } public function getSection() { diff --git a/lib/Settings/ShareAdmin.php b/lib/Settings/ShareAdmin.php index fa04c692..bb4d0c4c 100644 --- a/lib/Settings/ShareAdmin.php +++ b/lib/Settings/ShareAdmin.php @@ -52,6 +52,7 @@ public function getForm() { $this->initialStateService->provideInitialState(Application::APP_ID, 'share_domain', $this->getAppValue('share_domain', $this->config->getSystemValue('trusted_domains')[0])); $this->initialStateService->provideInitialState(Application::APP_ID, 'share_prefix', $this->getAppValue('share_prefix')); $this->initialStateService->provideInitialState(Application::APP_ID, 'share_suffix', $this->getAppValue('share_suffix')); + return new TemplateResponse(Application::APP_ID, 'settings/share-admin'); } diff --git a/src/elementAdminSettings.js b/src/adminSettings.js similarity index 85% rename from src/elementAdminSettings.js rename to src/adminSettings.js index 79080c33..a8720dd8 100644 --- a/src/elementAdminSettings.js +++ b/src/adminSettings.js @@ -21,7 +21,7 @@ */ import Vue from 'vue'; -import ElementAdminSettings from "./components/settings/ElementAdminSettings"; +import AdminSettings from "./components/settings/AdminSettings"; document.addEventListener('DOMContentLoaded', main); @@ -31,7 +31,7 @@ function main () { Vue.prototype.OC = window.OC; Vue.prototype.OCA = window.OCA; - const View = Vue.extend(ElementAdminSettings); + const View = Vue.extend(AdminSettings); const view = new View(); - view.$mount('#riotchat-element-admin-settings'); + view.$mount('#riotchat-admin-settings'); } diff --git a/src/components/settings/ElementAdminSettings.vue b/src/components/settings/AdminSettings.vue similarity index 100% rename from src/components/settings/ElementAdminSettings.vue rename to src/components/settings/AdminSettings.vue diff --git a/src/components/settings/PersonalSettings.vue b/src/components/settings/PersonalSettings.vue new file mode 100644 index 00000000..07c10d27 --- /dev/null +++ b/src/components/settings/PersonalSettings.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/src/components/settings/ShareAdminSettings.vue b/src/components/settings/ShareAdminSettings.vue index 48f8ff4c..53f2660d 100644 --- a/src/components/settings/ShareAdminSettings.vue +++ b/src/components/settings/ShareAdminSettings.vue @@ -1,6 +1,6 @@