From f454d91e3a95448b5d3352dbe2a9f020e8af1fef Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 14 Jul 2023 21:58:51 -0300 Subject: [PATCH 1/6] Add route to Security settings Signed-off-by: Vitor Mattos --- src/components/LeftSidebar.vue | 12 +++++++++++- src/router/router.js | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/LeftSidebar.vue b/src/components/LeftSidebar.vue index 713bda7..656dffa 100644 --- a/src/components/LeftSidebar.vue +++ b/src/components/LeftSidebar.vue @@ -7,7 +7,17 @@ :exact="true" /> + :open="false" + :allowCollapse="true" + icon="icon-user"> + + diff --git a/src/router/router.js b/src/router/router.js index e199303..44a254a 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -5,6 +5,7 @@ import { generateUrl } from '@nextcloud/router' import Home from '../views/Home.vue' import Profile from '../views/Profile.vue' +import Security from '../views/Security.vue' Vue.use(VueRouter) @@ -24,5 +25,10 @@ export default new VueRouter({ component: Profile, name: 'profile', }, + { + path: '/security', + component: Security, + name: 'security' + }, ], }) From 4772bd386864bafcd0e2eb8607408ddafaa6ca35 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 14 Jul 2023 21:59:37 -0300 Subject: [PATCH 2/6] Add security view Signed-off-by: Vitor Mattos --- src/views/Security.vue | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/views/Security.vue diff --git a/src/views/Security.vue b/src/views/Security.vue new file mode 100644 index 0000000..61b065e --- /dev/null +++ b/src/views/Security.vue @@ -0,0 +1,20 @@ + + + From 483f915a2d7c2d8bba36a9adaee60b41bf45cf78 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 14 Jul 2023 22:16:31 -0300 Subject: [PATCH 3/6] Fill Security component with values Load from initial state Signed-off-by: Vitor Mattos --- lib/Controller/PageController.php | 4 +++- src/views/Security.vue | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 47bd39e..bfdc83e 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -4,6 +4,7 @@ use OCA\MyCompany\AppInfo\Application; use OCA\Settings\Settings\Personal\PersonalInfo; +use OCA\Settings\Settings\Personal\Security\Authtokens; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; @@ -14,7 +15,8 @@ class PageController extends Controller { public function __construct( IRequest $request, - private PersonalInfo $personalInfo + private PersonalInfo $personalInfo, + private Authtokens $authTokens, ) { parent::__construct(Application::APP_ID, $request); } diff --git a/src/views/Security.vue b/src/views/Security.vue index 61b065e..8d85fa3 100644 --- a/src/views/Security.vue +++ b/src/views/Security.vue @@ -3,18 +3,32 @@

{{ t('my_company', 'Security') }}

+
From 410d69b1c2f1caade4edce19e3fe5beb90be33f7 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sat, 15 Jul 2023 10:36:19 -0300 Subject: [PATCH 4/6] Fix linter Signed-off-by: Vitor Mattos --- src/components/LeftSidebar.vue | 8 +++----- src/router/router.js | 2 +- src/views/Security.vue | 28 +++++++++++++++------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/LeftSidebar.vue b/src/components/LeftSidebar.vue index 656dffa..b0e1e83 100644 --- a/src/components/LeftSidebar.vue +++ b/src/components/LeftSidebar.vue @@ -8,14 +8,12 @@ diff --git a/src/router/router.js b/src/router/router.js index 44a254a..891e65c 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -28,7 +28,7 @@ export default new VueRouter({ { path: '/security', component: Security, - name: 'security' + name: 'security', }, ], }) diff --git a/src/views/Security.vue b/src/views/Security.vue index 8d85fa3..6fc167a 100644 --- a/src/views/Security.vue +++ b/src/views/Security.vue @@ -1,24 +1,30 @@ From 7ad0cb2833e416a99156573d26c92f8b89741a62 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sat, 15 Jul 2023 11:07:45 -0300 Subject: [PATCH 5/6] Add pending method Signed-off-by: Vitor Mattos --- lib/Controller/PageController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index bfdc83e..7637bf6 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -27,6 +27,7 @@ public function index(string $path): TemplateResponse { Util::addScript(Application::APP_ID, 'my_company-main'); $this->personalInfo->getForm(); + $this->authTokens->getForm(); $response = new TemplateResponse(Application::APP_ID, 'main'); From fe11f3182268621ac879e7abd44a40d2a594ff92 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 17 Jul 2023 19:52:28 -0300 Subject: [PATCH 6/6] Update psalm baseline Signed-off-by: Vitor Mattos --- tests/psalm-baseline.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 7015c25..cdcd87b 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -2,8 +2,10 @@ + authTokens]]> personalInfo]]> private + private