Skip to content

Commit

Permalink
Fix tabs
Browse files Browse the repository at this point in the history
Signed-off-by: Kristina Fefelova <[email protected]>
  • Loading branch information
kristina-fefelova committed Oct 11, 2024
1 parent 445a05e commit ef2a051
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
buttons={'union'}
>
{#each topApps as app}
<NavLink app={app.alias} shrink={0} disabled={app._id === active} restoreLastLocation>
<NavLink app={app.alias} shrink={0} disabled={app._id === active}>
<AppItem selected={app._id === active} icon={app.icon} label={app.label} />
</NavLink>
{/each}
<div class="divider" />
{#each bottomdApps as app}
<NavLink app={app.alias} shrink={0} disabled={app._id === active} restoreLastLocation>
<NavLink app={app.alias} shrink={0} disabled={app._id === active}>
<AppItem selected={app._id === active} icon={app.icon} label={app.label} />
</NavLink>
{/each}
Expand Down
7 changes: 3 additions & 4 deletions plugins/workbench-resources/src/components/Workbench.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
let tabs: WorkbenchTab[] = []
let areTabsLoaded = false
$: prevTabId = $prevTabIdStore
const query = createQuery()
$: query.query(
Expand Down Expand Up @@ -391,9 +390,9 @@
async function syncLoc (loc: Location): Promise<void> {
accessDeniedStore.set(false)
const originalLoc = JSON.stringify(loc)
if ($tabIdStore !== prevTabId) {
if (prevTabId) {
const prevTab = tabs.find((t) => t._id === prevTabId)
if ($tabIdStore !== $prevTabIdStore) {
if ($prevTabIdStore) {
const prevTab = tabs.find((t) => t._id === $prevTabIdStore)
const prevTabLoc = prevTab ? getTabLocation(prevTab) : undefined
if (prevTabLoc === undefined || prevTabLoc.path[2] !== loc.path[2]) {
clear(1)
Expand Down
18 changes: 9 additions & 9 deletions plugins/workbench-resources/src/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ async function syncTabLoc (): Promise<void> {
tabsStore.update((tabs) => [...tabs, tab])
selectTab(tab._id)
} else {
if (
tabByName !== undefined &&
tabByName._id !== tab._id &&
(loc.path[2] !== tabLoc.path[2] || loc.path[3] !== tabLoc.path[3])
) {
selectTab(tabByName._id)
prevTabIdStore.set(tabByName._id)
return
}
// TODO: Fix this
// if (
// tabByName !== undefined &&
// tabByName._id !== tab._id &&
// (loc.path[2] !== tabLoc.path[2] || loc.path[3] !== tabLoc.path[3])
// ) {
// selectTab(tabByName._id)
// return
// }

await getClient().update(tab, { location: url, name })
}
Expand Down
4 changes: 3 additions & 1 deletion tests/sanity/tests/model/channel-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export class ChannelPage extends CommonPage {
.locator('xpath=following-sibling::div[1]')
.locator('button', { hasText: channel })

readonly chooseChannel = (channel: string): Locator => this.page.locator('div.antiPanel-navigator').getByRole('button', { name: channel })
readonly chooseChannel = (channel: string): Locator =>
this.page.locator('div.antiPanel-navigator').getByRole('button', { name: channel })

readonly closePopupWindow = (): Locator => this.page.locator('.notifyPopup button[data-id="btnNotifyClose"]')
readonly openAddMemberToChannel = (userName: string): Locator => this.page.getByRole('button', { name: userName })
readonly addMemberToChannelTableButton = (userName: string): Locator =>
Expand Down

0 comments on commit ef2a051

Please sign in to comment.