mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-06 07:46:32 +00:00
Short link fixes (#2744)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
0c1b13f5e7
commit
032f632105
@ -212,7 +212,7 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Loca
|
|||||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||||
const component = panelComponent.component ?? view.component.EditDoc
|
const component = panelComponent.component ?? view.component.EditDoc
|
||||||
return {
|
return {
|
||||||
path: [appComponent, workspace, chunterId],
|
path: [appComponent, workspace],
|
||||||
fragment: getPanelURI(component, comment.attachedTo, comment.attachedToClass, 'content')
|
fragment: getPanelURI(component, comment.attachedTo, comment.attachedToClass, 'content')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,13 +13,28 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Organization } from '@hcengineering/contact'
|
import attachment from '@hcengineering/attachment'
|
||||||
import { Avatar } from '@hcengineering/presentation'
|
import { Channel, Organization } from '@hcengineering/contact'
|
||||||
import { closePanel, closePopup, closeTooltip, getCurrentLocation, Label, navigate } from '@hcengineering/ui'
|
import { Avatar, createQuery } from '@hcengineering/presentation'
|
||||||
|
import { Component, Label } from '@hcengineering/ui'
|
||||||
|
import { DocNavLink } from '@hcengineering/view-resources'
|
||||||
import contact from '../plugin'
|
import contact from '../plugin'
|
||||||
|
import ChannelsEditor from './ChannelsEditor.svelte'
|
||||||
|
|
||||||
export let organization: Organization
|
export let organization: Organization
|
||||||
export let disabled: boolean = false
|
export let disabled: boolean = false
|
||||||
|
|
||||||
|
let channels: Channel[] = []
|
||||||
|
const channelsQuery = createQuery()
|
||||||
|
channelsQuery.query(
|
||||||
|
contact.class.Channel,
|
||||||
|
{
|
||||||
|
attachedTo: organization._id
|
||||||
|
},
|
||||||
|
(res) => {
|
||||||
|
channels = res
|
||||||
|
}
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex-col h-full card-container">
|
<div class="flex-col h-full card-container">
|
||||||
@ -29,26 +44,29 @@
|
|||||||
</div>
|
</div>
|
||||||
{#if organization}
|
{#if organization}
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
<div
|
<DocNavLink object={organization} disableClick={disabled}>
|
||||||
class="name lines-limit-2"
|
<div class="name lines-limit-2">
|
||||||
class:over-underline={!disabled}
|
{organization.name}
|
||||||
on:click={() => {
|
</div>
|
||||||
if (!disabled) {
|
</DocNavLink>
|
||||||
closeTooltip()
|
<div class="footer flex flex-reverse flex-grow">
|
||||||
closePopup()
|
<div class="flex-center flex-wrap">
|
||||||
closePanel()
|
<Component
|
||||||
const loc = getCurrentLocation()
|
is={attachment.component.AttachmentsPresenter}
|
||||||
loc.path[3] = organization._id
|
props={{ value: organization.attachments, object: organization, size: 'medium', showCounter: true }}
|
||||||
loc.path.length = 4
|
/>
|
||||||
navigate(loc)
|
</div>
|
||||||
}
|
{#if channels[0]}
|
||||||
}}
|
<div class="flex flex-grow">
|
||||||
>
|
<ChannelsEditor
|
||||||
{organization.name}
|
attachedTo={channels[0].attachedTo}
|
||||||
|
attachedClass={channels[0].attachedToClass}
|
||||||
|
length={'short'}
|
||||||
|
editable={false}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if organization}
|
|
||||||
<span class="label">{organization.name}</span>
|
|
||||||
{/if}
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Loca
|
|||||||
const appComponent = loc.path[0] ?? ''
|
const appComponent = loc.path[0] ?? ''
|
||||||
const workspace = loc.path[1] ?? ''
|
const workspace = loc.path[1] ?? ''
|
||||||
return {
|
return {
|
||||||
path: [appComponent, workspace, contactId],
|
path: [appComponent, workspace],
|
||||||
fragment: getPanelURI(view.component.EditDoc, doc._id, doc._class, 'content')
|
fragment: getPanelURI(view.component.EditDoc, doc._id, doc._class, 'content')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Loca
|
|||||||
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
const panelComponent = hierarchy.as(targetClass, view.mixin.ObjectPanel)
|
||||||
const component = panelComponent.component ?? view.component.EditDoc
|
const component = panelComponent.component ?? view.component.EditDoc
|
||||||
return {
|
return {
|
||||||
path: [appComponent, workspace, recruitId],
|
path: [appComponent, workspace],
|
||||||
fragment: getPanelURI(component, doc._id, doc._class, 'content')
|
fragment: getPanelURI(component, doc._id, doc._class, 'content')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
loc.path[4] = 'projects'
|
loc.path[4] = 'projects'
|
||||||
loc.path[5] = value._id
|
loc.path[5] = value._id
|
||||||
loc.path.length = 6
|
loc.path.length = 6
|
||||||
|
loc.fragment = undefined
|
||||||
navigate(loc)
|
navigate(loc)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -78,7 +78,7 @@ export async function generateIssueLocation (loc: Location, issueId: string): Pr
|
|||||||
const appComponent = loc.path[0] ?? ''
|
const appComponent = loc.path[0] ?? ''
|
||||||
const workspace = loc.path[1] ?? ''
|
const workspace = loc.path[1] ?? ''
|
||||||
return {
|
return {
|
||||||
path: [appComponent, workspace, trackerId, team._id, 'issues'],
|
path: [appComponent, workspace],
|
||||||
fragment: generateIssuePanelUri(issue)
|
fragment: generateIssuePanelUri(issue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,11 +220,17 @@
|
|||||||
// resolve short links
|
// resolve short links
|
||||||
const resolvedLocation = await resolveShortLink(loc)
|
const resolvedLocation = await resolveShortLink(loc)
|
||||||
if (resolvedLocation && !areLocationsEqual(loc, resolvedLocation)) {
|
if (resolvedLocation && !areLocationsEqual(loc, resolvedLocation)) {
|
||||||
loc.path[2] = app = resolvedLocation.path[2] ?? app
|
if (app !== resolvedLocation.path[2] && resolvedLocation.path[2] !== undefined) {
|
||||||
loc.path[3] = space = (resolvedLocation.path[3] as Ref<Space>) ?? space
|
loc.path[2] = app = resolvedLocation.path[2] ?? app
|
||||||
|
loc.path[3] = space = (resolvedLocation.path[3] as Ref<Space>) ?? space
|
||||||
|
loc.path[4] = special = resolvedLocation.path[4] ?? special
|
||||||
|
} else if (space !== (resolvedLocation.path[3] as Ref<Space>) && resolvedLocation.path[3] !== undefined) {
|
||||||
|
loc.path[3] = space = (resolvedLocation.path[3] as Ref<Space>) ?? space
|
||||||
|
loc.path[4] = special = resolvedLocation.path[4] ?? special
|
||||||
|
}
|
||||||
loc.path[4] = special = resolvedLocation.path[4] ?? special
|
loc.path[4] = special = resolvedLocation.path[4] ?? special
|
||||||
loc.fragment = fragment = resolvedLocation.fragment ?? fragment
|
loc.fragment = fragment = resolvedLocation.fragment ?? fragment
|
||||||
navigate(resolvedLocation, false)
|
navigate(loc, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentAppAlias !== app) {
|
if (currentAppAlias !== app) {
|
||||||
|
Loading…
Reference in New Issue
Block a user