mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
UBER-1149: Events in team planing fixes (#3922)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
7382bf8ffb
commit
c03f0d0417
@ -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')
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user