-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(desktop): add talk settings frontend API
Signed-off-by: Grigorii K. Shartsev <[email protected]>
- Loading branch information
Showing
3 changed files
with
68 additions
and
1 deletion.
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
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,52 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import { markRaw, ref } from 'vue' | ||
import type { Ref } from 'vue' | ||
|
||
type TalkSettingsSection = { | ||
/** | ||
* Section ID | ||
*/ | ||
id: string | ||
/** | ||
* Section name, passed to NcAppSettingSection component | ||
*/ | ||
name: string | ||
/** | ||
* WebComponent (custom element) name to render as the section content | ||
*/ | ||
element: string, | ||
} | ||
|
||
const additionalSettingsSections: Ref<TalkSettingsSection[]> = ref([]) | ||
|
||
/** | ||
* Register an additional settings section | ||
* @param section - Settings section | ||
*/ | ||
export function registerSettingsSection(section: TalkSettingsSection) { | ||
additionalSettingsSections.value.push(markRaw(section)) | ||
} | ||
|
||
/** | ||
* Unregister an additional settings section | ||
* @param id - Section ID | ||
*/ | ||
export function unregisterSettingsSection(id: string) { | ||
const index = additionalSettingsSections.value.findIndex((section) => section.id === id) | ||
if (index !== -1) { | ||
additionalSettingsSections.value.splice(index, 1) | ||
} | ||
} | ||
|
||
/** | ||
* Talk Settings Dialog composable | ||
*/ | ||
export function useSettingsDialog() { | ||
return { | ||
additionalSettingsSections, | ||
} | ||
} |
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