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

Add getAppsConfig #41

Merged
merged 4 commits into from
Jan 27, 2025
Merged

Add getAppsConfig #41

merged 4 commits into from
Jan 27, 2025

Conversation

gciotola
Copy link
Contributor

@gciotola gciotola commented Jan 13, 2025

What I did

  • Breaking change: getConfig has been renamed in getMfeConfig and moved into own file
  • Added configuration to run eslint on save
  • New: Added getAppsConfig
  • New: All types for organization-config package are now generated automatically from the remote json schema

The new getAppsConfig takes the organization config as only argument and returns a full object that contains all apps merged with the default values found in config.

Example:

const config = getAppsConfig({
  jsonConfig: {
    apps: {
      default: { hide: ['details', 'metadata'] },
      orders: { hide: ['markets'] },
      customers: { hide: ['customer_groups'] },
      shipments: { hide: ['tags', 'details'] }
    }
  }
})

// console.log(config) will output
{
  bundles: { hide: ['details', 'metadata'] },
  customers: { hide: ['details', 'metadata', 'customer_groups'] },
  exports: { hide: ['details', 'metadata'] },
  gift_cards: { hide: ['details', 'metadata'] },
  imports: { hide: ['details', 'metadata'] },
  inventory: { hide: ['details', 'metadata'] },
  orders: { hide: ['details', 'metadata', 'markets'] },
  price_lists: { hide: ['details', 'metadata'] },
  promotions: { hide: ['details', 'metadata'] },
  returns: { hide: ['details', 'metadata'] },
  shipments: { hide: ['details', 'metadata', 'tags'] },
  sku_lists: { hide: ['details', 'metadata'] },
  skus: { hide: ['details', 'metadata'] },
  stock_transfers: { hide: ['details', 'metadata'] },
  subscriptions: { hide: ['details', 'metadata'] },
  tags: { hide: ['details', 'metadata'] },
  webhooks: { hide: ['details', 'metadata'] }
 }

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests).
  • Make sure to add/update documentation regarding your changes.
  • You are NOT deprecating/removing a feature.

@gciotola gciotola added enhancement New feature or request breaking-change This potentially causes other components to fail labels Jan 13, 2025
@gciotola gciotola requested a review from malessani January 13, 2025 14:04
@gciotola gciotola self-assigned this Jan 13, 2025
@gciotola gciotola merged commit e6ee1bb into main Jan 27, 2025
@gciotola gciotola deleted the apps-config branch January 27, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This potentially causes other components to fail enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants