Skip to content

Commit

Permalink
Merge pull request #104 from vtex-apps/feature/setting-readonly-fields
Browse files Browse the repository at this point in the history
Feature/setting readonly fields
  • Loading branch information
albertm805 authored Apr 5, 2023
2 parents a9699aa + da834dd commit 331bdfc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added
- Added two new boolean values in order to prevent user from changing state and business field in the cost center

## [0.31.0] - 2023-03-31

### Added
Expand Down
4 changes: 4 additions & 0 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ type MarketingTags {

type B2BSettings {
autoApprove: Boolean
businessReadOnly: Boolean
stateReadOnly: Boolean
defaultPaymentTerms: [PaymentTerm]
defaultPriceTables: [String]
organizationCustomFields: [SettingsCustomField]
Expand Down Expand Up @@ -542,6 +544,8 @@ input UISettingsInput {

input B2BSettingsInput {
autoApprove: Boolean
businessReadOnly: Boolean
stateReadOnly: Boolean
defaultPaymentTerms: [PaymentTermInput]
defaultPriceTables: [String]
uiSettings: UISettingsInput
Expand Down
4 changes: 4 additions & 0 deletions node/resolvers/Mutations/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const Settings = {
{
input: {
autoApprove,
businessReadOnly,
stateReadOnly,
defaultPaymentTerms,
defaultPriceTables,
uiSettings,
Expand Down Expand Up @@ -88,6 +90,8 @@ const Settings = {
try {
const b2bSettings = {
autoApprove,
businessReadOnly,
stateReadOnly,
costCenterCustomFields:
costCenterCustomFields ?? currentB2BSettings?.costCenterCustomFields,
defaultPaymentTerms,
Expand Down
4 changes: 4 additions & 0 deletions node/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ interface Address {

interface B2BSettings {
autoApprove: boolean
businessReadOnly: boolean
stateReadOnly: boolean
defaultPaymentTerms: PaymentTerm[]
defaultPriceTables: [string]
organizationCustomFields: SettingsCustomField[]
Expand Down Expand Up @@ -217,6 +219,8 @@ interface TransactionEmailSetting {

interface B2BSettingsInput {
autoApprove: boolean
businessReadOnly: boolean
stateReadOnly: boolean
defaultPaymentTerms: PaymentTerm[]
defaultPriceTables: Price[]
uiSettings: UISettings
Expand Down
2 changes: 1 addition & 1 deletion node/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ sprintf-js@~1.0.2:
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=

"stats-lite@github:vtex/node-stats-lite#dist":
stats-lite@vtex/node-stats-lite#dist:
version "2.2.0"
resolved "https://codeload.github.com/vtex/node-stats-lite/tar.gz/1b0d39cc41ef7aaecfd541191f877887a2044797"
dependencies:
Expand Down

0 comments on commit 331bdfc

Please sign in to comment.