Skip to content

Commit e1ec23d

Browse files
authored
feat(softwareCenter): add release note URLs for GitHub code repositories (#795)
NethServer/dev#7243
1 parent 99e9796 commit e1ec23d

File tree

7 files changed

+63
-10
lines changed

7 files changed

+63
-10
lines changed

core/imageroot/usr/local/agent/pypkg/cluster/modules.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ def _get_available_modules(rdb):
336336
continue # skip duplicated images from lower priority modules
337337
modules[rmod["source"]] = rmod
338338
rmod['versions'].sort(key=lambda v: _parse_version_object(v["tag"]), reverse=True)
339+
# Set the general release note URL if the code URL is a GitHub repository
340+
if rmod['docs']['code_url'].startswith("https://github.com/") and 'relnotes_url' not in rmod['docs']:
341+
rmod['docs']['relnotes_url'] = f"{rmod['docs']['code_url']}/releases"
342+
339343
# Integrate the available set with instances that do not belong to any
340344
# repository. They can be found in the "installed" dict:
341345
for module_source, module_instances in list_installed(rdb).items():

core/imageroot/var/lib/nethserver/cluster/actions/list-modules/validate-output.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,23 @@
160160
"type": "object",
161161
"parameters": {
162162
"terms_url": {
163-
"type": "uri",
163+
"type": "string",
164+
"format": "uri",
164165
"description": "Optional link to the application Terms & Conditions document"
165166
},
166167
"documentation_url": {
167-
"type": "uri",
168+
"type": "string",
169+
"format": "uri",
168170
"description": "Link to the package documentation"
169171
},
170172
"bug_url": {
171-
"type": "uri",
173+
"type": "string",
174+
"format": "uri",
172175
"description": "Link to the package issue tracker"
173176
},
174177
"code_url": {
175-
"type": "uri",
178+
"type": "string",
179+
"format": "uri",
176180
"description": "Link to the source code repository"
177181
}
178182
},

core/imageroot/var/lib/nethserver/cluster/repodata-schema.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"docs": {
2828
"documentation_url": "https://docs.nethserver.org",
2929
"bug_url": "https://github.com/NethServer/dev",
30-
"code_url": "https://github.com/NethServer/"
30+
"code_url": "https://github.com/NethServer/",
31+
"relnotes_url": "https://github.com/NethServer/ns8-kickstart/releases"
3132
},
3233
"source": "ghcr.io/nethserver/dokuwiki",
3334
"versions": [
@@ -116,20 +117,29 @@
116117
"type": "object",
117118
"parameters": {
118119
"terms_url": {
119-
"type": "uri",
120+
"type": "string",
121+
"format": "uri",
120122
"description": "Optional link to the application Terms & Conditions document"
121123
},
122124
"documentation_url": {
123-
"type": "uri",
125+
"type": "string",
126+
"format": "uri",
124127
"description": "Link to the package documentation"
125128
},
126129
"bug_url": {
127-
"type": "uri",
130+
"type": "string",
131+
"format": "uri",
128132
"description": "Link to the package issue tracker"
129133
},
130134
"code_url": {
131-
"type": "uri",
135+
"type": "string",
136+
"format": "uri",
132137
"description": "Link to the source code repository"
138+
},
139+
"relnotes_url": {
140+
"type": "string",
141+
"format": "uri",
142+
"description": "Optional link to the application release notes"
133143
}
134144
},
135145
"required": [

core/ui/public/i18n/en/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@
8787
"configure": "Configure",
8888
"terms_and_conditions": "Terms and Conditions",
8989
"terms_required": "Please read and agree to @:common.terms_and_conditions",
90-
"not_available": "Not available"
90+
"not_available": "Not available",
91+
"release_notes": "Release notes"
9192
},
9293
"error": {
9394
"error": "Error",

core/ui/src/components/software-center/AppInfoModal.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@
157157
</cv-link>
158158
</span>
159159
</template>
160+
<template v-if="app.docs.relnotes_url">
161+
&bull;
162+
<span>
163+
<cv-link :href="app.docs.relnotes_url" target="_blank">
164+
{{ $t("common.release_notes") }}
165+
</cv-link>
166+
</span>
167+
</template>
160168
</div>
161169
</div>
162170
</template>

core/ui/src/views/SoftwareCenterAppInstances.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,23 @@
323323
})
324324
}}
325325
</div>
326+
<div
327+
v-if="
328+
app.docs.relnotes_url &&
329+
isStableUpdateAvailable(app, instance)
330+
"
331+
class="row"
332+
>
333+
<cv-link
334+
class="row icon-and-text"
335+
:href="app.docs.relnotes_url"
336+
target="_blank"
337+
>
338+
<NsButton kind="ghost" :icon="Launch20">
339+
{{ $t("common.release_notes") }}
340+
</NsButton>
341+
</cv-link>
342+
</div>
326343
<div class="row actions">
327344
<!-- app is installed and can be updated -->
328345
<template v-if="isStableUpdateAvailable(app, instance)">

core/ui/src/views/SoftwareCenterCoreApps.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@
100100
<cv-data-table-cell>{{ row.version }}</cv-data-table-cell>
101101
<cv-data-table-cell v-if="isCoreUpdatable">
102102
{{ row.update || "-" }}
103+
<cv-link
104+
v-if="row.docs.relnotes_url && row.update"
105+
:href="row.docs.relnotes_url"
106+
target="_blank"
107+
>
108+
<NsButton kind="ghost" :icon="Launch20">
109+
{{ $t("common.release_notes") }}
110+
</NsButton></cv-link
111+
>
103112
</cv-data-table-cell>
104113
</cv-data-table-row>
105114
</template>

0 commit comments

Comments
 (0)