Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add topBar settings type #182

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- Add TopBarSettings type in B2B settings and updated saveB2BSettings to use the new topBar field in UISettings

## [0.61.1] - 2024-10-29

### Fixed

- Avoid calls to checkUserPermissions when session data is not available

## [0.61.0] - 2024-10-16
Expand All @@ -21,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [0.60.0] - 2024-10-09

### Added

- Add new store user token validation directive to some APIs

## [0.59.0] - 2024-10-08
Expand Down
12 changes: 12 additions & 0 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,15 @@ type TransactionEmailSettings {
organizationStatusChanged: Boolean
}

type TopBarSettings {
name: String
hexColor: String
}

type UISettings {
showModal: Boolean
clearCart: Boolean
topBar: TopBarSettings
fullImpersonation: Boolean
}

Expand Down Expand Up @@ -677,9 +683,15 @@ input TransactionEmailSettingsInput {
organizationStatusChanged: Boolean
}

input TopBarSettingsInput {
name: String
hexColor: String
}

input UISettingsInput {
showModal: Boolean
clearCart: Boolean
topBar: TopBarSettingsInput
fullImpersonation: Boolean
}

Expand Down
6 changes: 5 additions & 1 deletion node/resolvers/Mutations/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ const Settings = {
transactionEmailSettings:
transactionEmailSettings ??
currentB2BSettings?.transactionEmailSettings,
uiSettings,
uiSettings: {
showModal: uiSettings.showModal,
clearCart: uiSettings.clearCart,
topBar: uiSettings.topBar ?? currentB2BSettings?.uiSettings?.topBar,
},
}

await vbase.saveJSON(B2B_SETTINGS_DATA_ENTITY, 'settings', b2bSettings)
Expand Down
6 changes: 6 additions & 0 deletions node/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,15 @@ interface Price {
id: string
}

interface TopBarSetting {
name: string
hexColor: string
}

interface UISettings {
showModal: boolean
clearCart: boolean
topBar?: TopBarSetting | null
fullImpersonation: boolean
}

Expand Down