Display <sso> and <nosso> contents based on SSO

This commit is contained in:
Girish Ramakrishnan
2017-03-08 15:02:11 -08:00
parent 397bd17c55
commit 84a35343d1
2 changed files with 9 additions and 1 deletions

View File

@@ -253,7 +253,11 @@ app.filter('postInstallMessage', function () {
if (!app) return text;
var parts = text.split(SSO_MARKER);
if (parts.length === 1) return text;
if (parts.length === 1) {
// [^] matches even newlines. '?' makes it non-greedy
if (app.sso) return text.replace(/\<nosso\>[^]*?\<\/nosso\>/g, '');
else return text.replace(/\<sso\>[^]*?\<\/sso\>/g, '');
}
if (app.sso) return parts[1];
else return parts[0];