Changes the default behavior for settings navigation items to stay active when navigating to sub-pages. **Problem:** - Navigation items like "Data Model" and "Webhooks" were not staying highlighted when navigating to detail pages - This was because `matchSubPages` defaulted to requiring exact path matches **Solution:** - Updated logic to make sub-page matching the default behavior (`end: item.matchSubPages === false`) - Only "Accounts" explicitly sets `matchSubPages: false` for its custom sub-item navigation - Removed redundant `matchSubPages: true` declarations throughout the codebase **URL Changes:** -- checked with @Bonapara - `/settings/workspace` → `/settings/general` - `/settings/workspace-members` → `/settings/members` - `/settings/api-keys` → `/settings/apis` - `/settings/developers/webhooks` → `/settings/webhooks` before: https://github.com/user-attachments/assets/56b94a49-9c31-4bb5-9875-ec24f4bc4d1e after: https://github.com/user-attachments/assets/38742599-c045-44d1-8020-56f3eacca779 --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
40 lines
1020 B
TypeScript
40 lines
1020 B
TypeScript
import { Bundle, ZObject } from 'zapier-platform-core';
|
|
|
|
import requestDb from './utils/requestDb';
|
|
|
|
const testAuthentication = async (z: ZObject, bundle: Bundle) => {
|
|
return await requestDb(
|
|
z,
|
|
bundle,
|
|
'query currentWorkspace {currentWorkspace {id displayName}}',
|
|
);
|
|
};
|
|
|
|
export default {
|
|
type: 'custom',
|
|
test: testAuthentication,
|
|
fields: [
|
|
{
|
|
computed: false,
|
|
key: 'apiKey',
|
|
required: true,
|
|
label: 'Api Key',
|
|
type: 'string',
|
|
helpText:
|
|
'Create an API key in [your twenty workspace](https://app.twenty.com/settings/apis)',
|
|
},
|
|
{
|
|
computed: false,
|
|
key: 'apiUrl',
|
|
required: false,
|
|
label: 'Api Url',
|
|
type: 'string',
|
|
placeholder: 'https://api.twenty.com',
|
|
helpText:
|
|
'Set this only if you self-host Twenty. Use the same value as `REACT_APP_SERVER_BASE_URL` in https://docs.twenty.com/start/self-hosting/',
|
|
},
|
|
],
|
|
connectionLabel: '{{data.currentWorkspace.displayName}}',
|
|
customConfig: {},
|
|
};
|