-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
122 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...thentication-administration/src/Administration/Users/Teams/TeamsTable/TeamEdit.module.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ation-administration/src/Administration/Users/Teams/TeamsTable/TeamsTableOptionsPanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2024 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
import { observer } from 'mobx-react-lite'; | ||
|
||
import { TextPlaceholder, useTranslate } from '@cloudbeaver/core-blocks'; | ||
import { useService } from '@cloudbeaver/core-di'; | ||
|
||
import { TeamEdit } from './TeamEdit.js'; | ||
import { TeamsTableOptionsPanelService } from './TeamsTableOptionsPanelService.js'; | ||
|
||
export const TeamsTableOptionsPanel = observer(function TeamsTableOptionsPanel() { | ||
const translate = useTranslate(); | ||
const teamsTableOptionsPanelService = useService(TeamsTableOptionsPanelService); | ||
|
||
if (!teamsTableOptionsPanelService.teamId) { | ||
return <TextPlaceholder>{translate('ui_not_found')}</TextPlaceholder>; | ||
} | ||
|
||
return <TeamEdit item={teamsTableOptionsPanelService.teamId} onClose={teamsTableOptionsPanelService.close} />; | ||
}); |
63 changes: 63 additions & 0 deletions
63
...administration/src/Administration/Users/Teams/TeamsTable/TeamsTableOptionsPanelService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2024 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
import { action, makeObservable, observable } from 'mobx'; | ||
|
||
import { importLazyComponent } from '@cloudbeaver/core-blocks'; | ||
import { injectable } from '@cloudbeaver/core-di'; | ||
import { Executor, type IExecutor } from '@cloudbeaver/core-executor'; | ||
import { OptionsPanelService } from '@cloudbeaver/core-ui'; | ||
|
||
const TeamsTableOptionsPanel = importLazyComponent(() => import('./TeamsTableOptionsPanel.js').then(m => m.TeamsTableOptionsPanel)); | ||
const panelGetter = () => TeamsTableOptionsPanel; | ||
|
||
@injectable() | ||
export class TeamsTableOptionsPanelService { | ||
teamId: string | null; | ||
|
||
readonly onClose: IExecutor; | ||
|
||
constructor(private readonly optionsPanelService: OptionsPanelService) { | ||
this.teamId = null; | ||
this.onClose = new Executor(); | ||
|
||
this.optionsPanelService.closeTask.next(this.onClose, undefined, () => this.optionsPanelService.isOpen(panelGetter)); | ||
this.close = this.close.bind(this); | ||
|
||
makeObservable(this, { | ||
teamId: observable.ref, | ||
open: action, | ||
close: action, | ||
}); | ||
} | ||
|
||
async open(teamId: string): Promise<boolean> { | ||
if (this.optionsPanelService.isOpen(panelGetter)) { | ||
return true; | ||
} | ||
|
||
const state = await this.optionsPanelService.open(panelGetter); | ||
|
||
if (state) { | ||
this.teamId = teamId; | ||
} | ||
|
||
return state; | ||
} | ||
|
||
async close(): Promise<void> { | ||
if (!this.optionsPanelService.isOpen(panelGetter)) { | ||
return; | ||
} | ||
|
||
const result = await this.optionsPanelService.close(); | ||
|
||
if (result) { | ||
this.teamId = null; | ||
} | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
...gin-authentication-administration/src/Administration/Users/UsersTable/UserEdit.module.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters