Stripe potential sso/nosso section when saving postinstall notes

This commit is contained in:
Johannes Zellner
2025-07-14 15:00:44 +02:00
parent aca85b63ae
commit 15c25329b6
3 changed files with 13 additions and 2 deletions
@@ -3,6 +3,7 @@
import { ref, useTemplateRef } from 'vue';
import { marked } from 'marked';
import { Dialog } from '@cloudron/pankow';
import { stripSsoInfo } from '../utils.js';
const dialog = useTemplateRef('dialog');
const app = ref(null);
@@ -45,7 +46,7 @@ defineExpose({
</div>
</div>
<div v-if="app.manifest.postInstallMessage" v-html="marked.parse(app.manifest.postInstallMessage)"></div>
<div v-if="app.manifest.postInstallMessage" v-html="marked.parse(stripSsoInfo(app.manifest.postInstallMessage, app.sso))"></div>
<div v-if="app.manifest.documentationUrl" v-html="$t('app.appInfo.appDocsUrl', { docsUrl: app.manifest.documentationUrl, title: app.manifest.title, forumUrl: (app.manifest.forumUrl || 'https://forum.cloudron.io') })"></div>
<div class="app-info-checklist" v-show="hasPendingChecklistItems">
+3 -1
View File
@@ -3,6 +3,7 @@
import { onMounted, ref, useTemplateRef, inject } from 'vue';
import { Button } from '@cloudron/pankow';
import { prettyDate } from '@cloudron/pankow/utils';
import { stripSsoInfo } from '../../utils.js';
import { marked } from 'marked';
import AppsModel from '../../models/AppsModel.js';
@@ -66,6 +67,7 @@ function onDismiss() {
onMounted(() => {
hasOldChecklist.value = !!Object.keys(props.app.checklist).find((k) => { return props.app.checklist[k].acknowledged; });
noteContent.value = props.app.notes === null ? props.app.manifest.postInstallMessage : props.app.notes;
editing.value = false;
busy.value = false;
});
@@ -131,7 +133,7 @@ onMounted(() => {
<div>
<div v-show="!editing">
<div v-if="noteContent" v-html="marked.parse(noteContent)"></div>
<div v-if="noteContent" v-html="marked.parse(stripSsoInfo(noteContent, app.sso))"></div>
<div v-else class="text-muted hand" @click="onEdit()">{{ placeholder }}</div>
</div>
<div v-show="editing">
+8
View File
@@ -577,6 +577,12 @@ function redirectIfNeeded(status, currentView) {
return false;
}
// strip potential sso tags in postinstall notes
function stripSsoInfo(notes, sso) {
if (sso) return notes.replace(/<nosso>.*?<\/nosso>/gs, '').replace(/<sso>/gs, '').replace(/<\/sso>/gs, '');
return notes.replace(/<sso>.*?<\/sso>/gs, '').replace(/<nosso>/gs, '').replace(/<\/nosso>/gs, '');
}
// named exports
export {
download,
@@ -586,6 +592,7 @@ export {
eventlogSource,
taskNameFromInstallationState,
redirectIfNeeded,
stripSsoInfo,
};
// default export
@@ -597,4 +604,5 @@ export default {
eventlogSource,
taskNameFromInstallationState,
redirectIfNeeded,
stripSsoInfo,
};