navbar_alerts: Delay showing "Complete the organization profile" banner.

Currently, we are displaying the "Complete the organization profile"
banner immediately after the organization was created. It's important to
strongly encourage orgs to configure their profile, so we should delay
showing the banner if the profile has not been configured after 15 days.
Thus also allows the users to check out Zulip and see how it works before
configuring the organization settings.

Fixes: #24122.
This commit is contained in:
Joelute
2023-08-11 13:46:58 -04:00
committed by Tim Abbott
parent 255e382750
commit eb78264162
8 changed files with 48 additions and 1 deletions

View File

@@ -490,3 +490,14 @@ export function get_time_limit_setting_in_appropriate_unit(
const time_limit_in_days = Math.floor(time_limit_in_hours / 24);
return {value: time_limit_in_days, unit: "day"};
}
export function should_display_profile_incomplete_alert(timestamp: number): boolean {
const today = new Date(Date.now());
const time = new Date(timestamp);
const days_old = differenceInCalendarDays(today, time);
if (days_old >= 15) {
return true;
}
return false;
}