refactor(environment): rename urls payload to data
- replace hardcoded URL keys with a generic key-value data map - align backend DTOs, MCP schemas, and service import/export mapping - update environment UI forms to edit JSON data instead of fixed fields
This commit is contained in:
@@ -20,7 +20,7 @@ import styles from '../Page.module.css';
|
||||
function EnvironmentCard({ env, onDelete }: { env: Environment; onDelete: (id: string) => void }) {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const urlEntries = Object.entries(env.urls).filter(([, v]) => v);
|
||||
const dataEntries = Object.entries(env.data).filter(([, v]) => v);
|
||||
|
||||
const handleExport = async () => {
|
||||
const data = await environments.exportEnvironment(env.id);
|
||||
@@ -87,15 +87,15 @@ function EnvironmentCard({ env, onDelete }: { env: Environment; onDelete: (id: s
|
||||
footer={footer}
|
||||
onClick={() => navigate(`/environments/${env.id}`)}
|
||||
>
|
||||
{urlEntries.length > 0 && (
|
||||
{dataEntries.length > 0 && (
|
||||
<DescriptionList
|
||||
layout="compact"
|
||||
truncate
|
||||
items={urlEntries.map(([key, value]) => ({ term: key, detail: value }))}
|
||||
items={dataEntries.map(([key, value]) => ({ term: key, detail: value }))}
|
||||
/>
|
||||
)}
|
||||
{urlEntries.length === 0 && (
|
||||
<p className={styles.envCardEmpty}>{t('environments.no_urls')}</p>
|
||||
{dataEntries.length === 0 && (
|
||||
<p className={styles.envCardEmpty}>{t('environments.no_data')}</p>
|
||||
)}
|
||||
</Card>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user