Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
321c6c29
Unverified
Commit
321c6c29
authored
1 year ago
by
Nemanja Glumac
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Differentiate `UserSettings` type from the rest of the `Settings` (#39456)
parent
398ff345
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase-types/api/settings.ts
+8
-3
8 additions, 3 deletions
frontend/src/metabase-types/api/settings.ts
frontend/src/metabase/redux/settings.ts
+5
-1
5 additions, 1 deletion
frontend/src/metabase/redux/settings.ts
with
13 additions
and
4 deletions
frontend/src/metabase-types/api/settings.ts
+
8
−
3
View file @
321c6c29
...
...
@@ -190,7 +190,7 @@ export interface OpenAiModel {
export
type
HelpLinkSetting
=
"
metabase
"
|
"
hidden
"
|
"
custom
"
;
export
interface
Settings
{
interface
Instance
Settings
{
"
active-users-count
"
?:
number
;
"
admin-email
"
:
string
;
"
anon-tracking-enabled
"
:
boolean
;
...
...
@@ -205,8 +205,6 @@ export interface Settings {
"
custom-homepage
"
:
boolean
;
"
custom-homepage-dashboard
"
:
number
|
null
;
"
deprecation-notice-version
"
?:
string
;
"
dismissed-browse-models-banner
"
?:
boolean
;
"
dismissed-custom-dashboard-toast
"
?:
boolean
;
"
ee-openai-api-key
"
?:
string
;
"
email-configured?
"
:
boolean
;
"
embedding-app-origin
"
:
string
;
...
...
@@ -285,9 +283,16 @@ export interface Settings {
"
user-visibility
"
:
string
|
null
;
"
last-acknowledged-version
"
:
string
|
null
;
"
show-static-embed-terms
"
:
boolean
|
null
;
}
export
interface
UserSettings
{
"
dismissed-browse-models-banner
"
?:
boolean
;
"
dismissed-custom-dashboard-toast
"
?:
boolean
;
"
last-used-native-database-id
"
?:
number
|
null
;
}
export
type
Settings
=
InstanceSettings
&
UserSettings
;
export
type
SettingKey
=
keyof
Settings
;
export
type
SettingValue
=
Settings
[
SettingKey
];
This diff is collapsed.
Click to expand it.
frontend/src/metabase/redux/settings.ts
+
5
−
1
View file @
321c6c29
...
...
@@ -3,6 +3,7 @@ import { createAsyncThunk, createReducer } from "@reduxjs/toolkit";
import
{
createThunkAction
}
from
"
metabase/lib/redux
"
;
import
MetabaseSettings
from
"
metabase/lib/settings
"
;
import
{
SessionApi
,
SettingsApi
}
from
"
metabase/services
"
;
import
type
{
UserSettings
}
from
"
metabase-types/api
"
;
export
const
REFRESH_SITE_SETTINGS
=
"
metabase/settings/REFRESH_SITE_SETTINGS
"
;
...
...
@@ -37,7 +38,10 @@ export const settings = createReducer(
export
const
UPDATE_USER_SETTING
=
"
metabase/settings/UPDATE_USER_SETTING
"
;
export
const
updateUserSetting
=
createThunkAction
(
UPDATE_USER_SETTING
,
function
(
setting
)
{
function
<
K
extends
keyof
UserSettings
>
(
setting
:
{
key
:
K
;
value
:
UserSettings
[
K
];
})
{
return
async
function
(
dispatch
)
{
try
{
await
SettingsApi
.
put
(
setting
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment