settings: Improve check for incomplete org profile.

Use a regex to check for the pattern "Organization
imported from ..." instead of the previous approach
where we just checked if pattern startswith "Organiztion
imported from".

This allows users to extend the description from the original
"Organization imported from Slack." with a few extra sentences without
this warning remaining indefinitely.

Fixes #17463
This commit is contained in:
Tushar912
2021-03-04 23:45:12 +05:30
committed by Tim Abbott
parent e587c029f6
commit 432751c319

View File

@@ -58,7 +58,7 @@ export function check_profile_incomplete() {
// since their organization might not have a logo yet.
if (
page_params.realm_description === "" ||
page_params.realm_description.startsWith("Organization imported from")
/^Organization imported from [A-Za-z]+[!.]$/.test(page_params.realm_description)
) {
$("[data-process='profile-incomplete']").show();
} else {