diff --git a/CHANGELOG.md b/CHANGELOG.md index fd4c058..b6bc882 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed +- Default route to `roles/list + +### Removed +- Tabs + ## [0.1.2] - 2021-09-07 ### Fixed diff --git a/admin/navigation.json b/admin/navigation.json index 2b87bc8..fda8d88 100644 --- a/admin/navigation.json +++ b/admin/navigation.json @@ -1,6 +1,6 @@ { "section": "accountSettings", - "path": "/admin/storefront-permissions", + "path": "/admin/app/storefront-permissions/roles/list", "icon": "extensions-ic", "titleId": "admin/storefront-permissions.navigation.label", "searchKeyWordsHelpers": "admin/storefront-permissions.navigation.keywords" diff --git a/docs/README.md b/docs/README.md index f0974cd..b82d396 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,8 +8,7 @@ The **Storefront Permissions UI** is the interface for the APP [`vtex.storefront-permissions`](https://github.com/vtex-apps/storefront-permissions) -![image](https://user-images.githubusercontent.com/24723/129122444-16069c74-fc7d-4944-9f78-94cd72dbb8ab.png) - +![image](https://user-images.githubusercontent.com/24723/138930342-0b32937f-120b-49c9-9d3b-a20e350450a1.png) ## Functionalities @@ -102,6 +101,6 @@ Only `check-permission` block has props: | Sales Admin | `sales-admin` | | Sales Manager | `sales-manager` | | Sales Representative | `sales-representative` | -| Admin | `customer-admin` | -| Approver | `customer-approver` | -| Buyer | `customer-buyer` | +| Organization Admin | `customer-admin` | +| Organization Approver | `customer-approver` | +| Organization Buyer | `customer-buyer` | diff --git a/messages/en.json b/messages/en.json index d71a5de..f1fe2ed 100644 --- a/messages/en.json +++ b/messages/en.json @@ -2,7 +2,7 @@ "admin/storefront-permissions.navigation.label": "Storefront Permissions", "admin/storefront-permissions.navigation.keywords": "b2b, Roles, Profiles", "admin/storefront-permissions.title": "Storefront Permissions", - "admin/storefront-permissions.description": "Roles and User management", + "admin/storefront-permissions.description": "Roles management", "admin/storefront-permissions.required": "Required", "admin/storefront-permissions.tab.new.button": "New", "admin/storefront-permissions.button.save": "Save", diff --git a/react/index.tsx b/react/index.tsx index 722f535..32152a4 100644 --- a/react/index.tsx +++ b/react/index.tsx @@ -4,25 +4,16 @@ import React, { useState } from 'react' import type { InjectedIntlProps } from 'react-intl' import { FormattedMessage, injectIntl } from 'react-intl' import { useQuery } from 'react-apollo' -import { useRuntime } from 'vtex.render-runtime' -import { Layout, PageBlock, PageHeader, Tabs, Tab } from 'vtex.styleguide' +import { Layout, PageBlock, PageHeader} from 'vtex.styleguide' import GET_CONFIG from './queries/getAppSettings.gql' const AdminB2bWaffle: FC = (props) => { - const { navigate, route } = useRuntime() - const [activeTab, setActiveTab] = useState(route.id) + const [state, setState] = useState({ missingConfig: true, }) - const setActiveSection = (section: string) => () => { - const path = `admin.app.storefront-permissions.${section}-list` - - setActiveTab(path) - navigate({ page: path }) - } - const { loading } = useQuery(GET_CONFIG, { onCompleted: (res: any) => { setState({ @@ -32,13 +23,6 @@ const AdminB2bWaffle: FC = (props) => { }, }) - const isActive = (currTab: string) => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [_, current] = activeTab.split('admin.app.storefront-permissions') - const [section] = current.replace('.', '').split('-') - - return currTab === (section || 'users') - } return ( = (props) => { > <> - - - } - active={isActive('users')} - onClick={setActiveSection('users')} - disabled={loading} - > - - } - active={isActive('roles')} - onClick={setActiveSection('roles')} - disabled={loading} - > - {props.children}