UBER-1149: Events in team planing fixes (#3922)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-10-31 22:33:44 +07:00 committed by GitHub
parent 7382bf8ffb
commit c03f0d0417
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -4,14 +4,14 @@
export let value: string | undefined
function isLink (value: string | undefined): boolean {
if (value === undefined) return false
function isLink (value?: string | null): boolean {
if (value == null) return false
const url = parseURL(value)
return url.startsWith('http://') || url.startsWith('https://')
}
function open () {
if (value === undefined) return
if (value == null) return
const url = parseURL(value)
if (url.startsWith('http://') || url.startsWith('https://')) {
window.open(url, '_blank')

View File

@ -19,11 +19,11 @@ export function saveUTC (date: Timestamp): Timestamp {
)
}
export function hidePrivateEvents (events: Event[], calendars: IdMap<Calendar>): Event[] {
export function hidePrivateEvents (events: Event[], calendars: IdMap<Calendar>, allowMe: boolean = true): Event[] {
const me = getCurrentAccount()._id
const res: Event[] = []
for (const event of events) {
if ((event.createdBy ?? event.modifiedBy) === me) {
if ((event.createdBy ?? event.modifiedBy) === me && allowMe) {
res.push(event)
} else {
if (event.visibility !== undefined) {