Skip to content

Commit 3d391dc

Browse files
davidmrc6usselite
andauthored
fix: setting inheritance (#40)
* fix: setting inheritance * fix: html snippet not updating when resetting to default * feat: add visual indicator when html snippet editor is disabled * feat: add url hash navigation * feat: releases api with new card design * Changes for releases and clean-up * Fix lint * Releases time-out and offline check * Releases UI changes * UI default group setting fixed * Update URLs * Updated releases information URLs * Some fixes related to licensing --------- Co-authored-by: usselite <mail@lucpasmans.nl>
1 parent 7b33e23 commit 3d391dc

23 files changed

+834
-214
lines changed

.editorconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ end_of_line = lf
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[src/**.ts]
11+
[src/**.{ts,vue}]
1212
charset = utf-8
13-
indent_style = space
14-
indent_size = 4
13+
indent_style = tab
1514
quote_type = single
1615

1716
[lib/**.php]

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<name>Sendent</name>
55
<summary lang="en">Sendent allows you to securely exchange files and emails</summary>
66
<description lang="en">Sendent now securely exchanges files and emails, integrating with both Microsoft Outlook and Microsoft Teams. This enhanced capability allows users to seamlessly conduct their work, not only within their preferred email environment but also within the collaborative framework of Microsoft Teams. Whether sharing privacy-sensitive documents, content, or handling attachments that exceed standard email size constraints, Sendent ensures a streamlined and secure communication experience. All files are directed to your Nextcloud instance, empowering you to control and manage access permissions effectively.</description>
7-
<version>4.0.4</version>
7+
<version>4.1.0</version>
88
<licence>agpl</licence>
99
<author mail="support@sendent.com" homepage="https://www.sendent.com">Sendent B.V.</author>
1010
<namespace>Sendent</namespace>

appinfo/routes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@
113113
['name' => 'termsagreement_api#agree', 'url' => '/api/1.0/termsagreement/agree/{version}', 'verb' => 'POST'],
114114
['name' => 'termsagreement_api#isAgreed', 'url' => '/api/1.0/termsagreement/isagreed/{version}', 'verb' => 'GET'],
115115

116+
['name' => 'releases_api#index', 'url' => '/api/1.0/releases', 'verb' => 'GET'],
117+
116118
[
117119
'name' => 'setting_groups_management#preflighted_cors',
118120
'url' => '/api/2.0/{path}',
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright (c) 2026 Sendent B.V.
5+
*
6+
* @author Sendent B.V. <info@sendent.com>
7+
*
8+
* @license GNU AGPL version 3 or any later version
9+
*
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU Affero General Public License as
12+
* published by the Free Software Foundation, either version 3 of the
13+
* License, or (at your option) any later version.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU Affero General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU Affero General Public License
21+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
*/
23+
24+
namespace OCA\Sendent\Controller;
25+
26+
use OCP\AppFramework\ApiController;
27+
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
28+
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
29+
use OCP\AppFramework\Http\DataResponse;
30+
use OCP\Http\Client\IClientService;
31+
use OCP\IRequest;
32+
use Psr\Log\LoggerInterface;
33+
34+
class ReleasesApiController extends ApiController {
35+
private const BASE_URL = 'https://changelog.scwcloud.sendent.nl/';
36+
37+
private const WORKSPACES = [
38+
'outlook-cross-platform' => 'outlook-cross-platform',
39+
'ms-teams' => 'ms-teams',
40+
'outlook-windows' => 'outlook-windows',
41+
];
42+
43+
private $httpClient;
44+
private $logger;
45+
46+
public function __construct(
47+
$appName,
48+
IRequest $request,
49+
IClientService $clientService,
50+
LoggerInterface $logger,
51+
) {
52+
parent::__construct($appName, $request);
53+
$this->httpClient = $clientService->newClient();
54+
$this->logger = $logger;
55+
}
56+
57+
/**
58+
* Fetches the latest release entry for all products.
59+
*
60+
* @return DataResponse
61+
*/
62+
#[NoAdminRequired]
63+
#[NoCSRFRequired]
64+
public function index(): DataResponse {
65+
$results = [];
66+
foreach (self::WORKSPACES as $slug => $uuid) {
67+
try {
68+
$response = $this->httpClient->get(self::BASE_URL . $uuid, ['timeout' => 5]);
69+
$data = json_decode($response->getBody(), true);
70+
if ($data) {
71+
$results[$slug] = $data;
72+
}
73+
} catch (\Exception $e) {
74+
$this->logger->warning('Failed to fetch release for ' . $slug . ': ' . $e->getMessage());
75+
}
76+
}
77+
return new DataResponse($results);
78+
}
79+
}

lib/Service/LicenseManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function activateLicense(License $license) {
214214

215215
return $this->licenseservice->create(
216216
$activatedLicense->getLicensekey(),
217-
$activatedLicense->getLicensekeytoken(),
217+
$activatedLicense->getLicensekeytoken() ?? '',
218218
$activatedLicense->getSubscriptionstatus(),
219219
date_create($activatedLicense->getDategraceperiodend()),
220220
date_create($activatedLicense->getDatelicenseend()),

lib/Service/LicenseService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ public function findUserLicense(string $userId) {
192192
$this->logger->debug('Did not find a license for group ' . $userSendentGroups[array_keys($userSendentGroups)[0]]);
193193
$license = $this->findByGroup('');
194194
}
195-
$this->logger->debug('Found license: ' . $license[0]->getId() . ' for group ' . $userSendentGroups[array_keys($userSendentGroups)[0]]);
195+
if (count($license) > 0) {
196+
$this->logger->debug('Found license: ' . $license[0]->getId() . ' for group ' . $userSendentGroups[array_keys($userSendentGroups)[0]]);
197+
}
196198
}
197199

198200
// If we haven't found a license, then usage is unlicensed

src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<!-- Main app content -->
2727
<template v-if="termsStore.agreed">
2828
<h2>Sendent for Outlook / Teams</h2>
29-
<TabContainer :tabs="mainTabs" default-tab="general">
29+
<TabContainer :tabs="mainTabs" default-tab="general" hash-key="tab">
3030
<template #general>
3131
<GeneralTab />
3232
</template>
@@ -76,6 +76,7 @@ onMounted(async () => {
7676
// If agreed, fetch initial data
7777
if (termsStore.agreed) {
7878
await licenseStore.refreshStatus('')
79+
licenseStore.checkAnyValidLicense()
7980
}
8081
})
8182
</script>

src/components/TabContainer.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
<script setup lang="ts">
3939
import { ref } from 'vue'
40+
import { useHashParam } from '../composables/useHashParam'
4041
4142
interface Tab {
4243
id: string
@@ -46,9 +47,13 @@ interface Tab {
4647
const props = defineProps<{
4748
tabs: Tab[]
4849
defaultTab?: string
50+
hashKey?: string
4951
}>()
5052
51-
const activeTab = ref(props.defaultTab ?? props.tabs[0]?.id ?? '')
53+
const defaultId = props.defaultTab ?? props.tabs[0]?.id ?? ''
54+
const activeTab = props.hashKey
55+
? useHashParam(props.hashKey, defaultId)
56+
: ref(defaultId)
5257
</script>
5358

5459
<style scoped>

0 commit comments

Comments
 (0)