mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-28 19:25:36 +00: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
|
export let value: string | undefined
|
||||||
|
|
||||||
function isLink (value: string | undefined): boolean {
|
function isLink (value?: string | null): boolean {
|
||||||
if (value === undefined) return false
|
if (value == null) return false
|
||||||
const url = parseURL(value)
|
const url = parseURL(value)
|
||||||
return url.startsWith('http://') || url.startsWith('https://')
|
return url.startsWith('http://') || url.startsWith('https://')
|
||||||
}
|
}
|
||||||
|
|
||||||
function open () {
|
function open () {
|
||||||
if (value === undefined) return
|
if (value == null) return
|
||||||
const url = parseURL(value)
|
const url = parseURL(value)
|
||||||
if (url.startsWith('http://') || url.startsWith('https://')) {
|
if (url.startsWith('http://') || url.startsWith('https://')) {
|
||||||
window.open(url, '_blank')
|
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 me = getCurrentAccount()._id
|
||||||
const res: Event[] = []
|
const res: Event[] = []
|
||||||
for (const event of events) {
|
for (const event of events) {
|
||||||
if ((event.createdBy ?? event.modifiedBy) === me) {
|
if ((event.createdBy ?? event.modifiedBy) === me && allowMe) {
|
||||||
res.push(event)
|
res.push(event)
|
||||||
} else {
|
} else {
|
||||||
if (event.visibility !== undefined) {
|
if (event.visibility !== undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user