Skip to content

Commit 656da92

Browse files
Add Semantic routing and Intelligent model routing front end codes
1 parent e59142a commit 656da92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2444
-3126
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up JDK
2525
uses: actions/setup-java@v4
2626
with:
27-
java-version: 21
27+
java-version: 11
2828
distribution: 'temurin'
2929
- uses: actions/setup-node@v4
3030
with:

.github/workflows/ui-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
with:
3232
fetch-depth: '10'
3333
path: apim-apps
34-
- name: Set up JDK 21
34+
- name: Set up JDK 11
3535
uses: actions/setup-java@v4
3636
with:
37-
java-version: 21
37+
java-version: 11
3838
distribution: 'temurin'
3939
- uses: actions/setup-node@v4
4040
with:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>org.wso2.carbon.apimgt.ui</groupId>
77
<artifactId>apim.ui.apps</artifactId>
88
<packaging>pom</packaging>
9-
<version>9.3.135-SNAPSHOT</version>
9+
<version>9.3.131-SNAPSHOT</version>
1010
<name>WSO2 API Manager UI - Parent</name>
1111
<url>https://wso2.org</url>
1212

portals/admin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>org.wso2.carbon.apimgt.ui</groupId>
2222
<artifactId>apim.ui.apps</artifactId>
23-
<version>9.3.135-SNAPSHOT</version>
23+
<version>9.3.131-SNAPSHOT</version>
2424
<relativePath>../../pom.xml</relativePath>
2525
</parent>
2626

portals/admin/src/main/webapp/site/public/locales/en.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,6 @@
724724
"KeyManagers.AddEditKeyManager.advanced.description": "Advanced options for the Key Manager",
725725
"KeyManagers.AddEditKeyManager.api.invocation.method": "API Invocation Method",
726726
"KeyManagers.AddEditKeyManager.api.no.usages": "No API usages for this key manager specifically.",
727-
"KeyManagers.AddEditKeyManager.app.config.constraints": "Application Configuration Constraints",
728727
"KeyManagers.AddEditKeyManager.application.no.usages": "No Application usages for this key manager specifically.",
729728
"KeyManagers.AddEditKeyManager.certificate": "Certificates",
730729
"KeyManagers.AddEditKeyManager.certificate.description": "Upload or provide the certificate inline.",
@@ -734,7 +733,6 @@
734733
"KeyManagers.AddEditKeyManager.claim.uris.description": "Provide claim URIs for consumer key and scopes.",
735734
"KeyManagers.AddEditKeyManager.connector.configurations": "Connector Configurations",
736735
"KeyManagers.AddEditKeyManager.connector.configurations.description": "Provide connection params for the selected Key Manager.",
737-
"KeyManagers.AddEditKeyManager.constraints.hidden.help": "Expand to configure constraints",
738736
"KeyManagers.AddEditKeyManager.endpoints": "Key Manager Endpoints",
739737
"KeyManagers.AddEditKeyManager.endpoints.description": "Configure endpoints such as client registration endpoint, the token endpoint for this Key Manager.",
740738
"KeyManagers.AddEditKeyManager.exchange.token.form.token.audience.help": "The Audience of the authorization server which the access token is intended for.",

portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx

Lines changed: 0 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ import { red } from '@mui/material/colors/';
6060
import Autocomplete from '@mui/material/Autocomplete';
6161
import CheckBoxIcon from '@mui/icons-material/CheckBox';
6262
import CheckBoxOutlineBlankIcon from '@mui/icons-material/CheckBoxOutlineBlank';
63-
import Constraints from 'AppComponents/KeyManagers/Constraints';
6463

6564
const StyledSpan = styled('span')(({ theme }) => ({ color: theme.palette.error.dark }));
6665

@@ -247,9 +246,6 @@ function AddEditKeyManager(props) {
247246
const [enableExchangeToken, setEnableExchangeToken] = useState(false);
248247
const [enableDirectToken, setEnableDirectToken] = useState(true);
249248
const [organizations, setOrganizations] = useState([]);
250-
const [constraintConfigurations, setConstraintConfigurations] = useState([]);
251-
const [constraints, setConstraints] = useState({});
252-
const [constraintSectionExpanded, setConstraintSectionExpanded] = useState(false);
253249

254250
const restApi = new API();
255251
const handleRoleAddition = (role) => {
@@ -291,7 +287,6 @@ function AddEditKeyManager(props) {
291287
if (settings.keyManagerConfiguration) {
292288
settings.keyManagerConfiguration.map(({
293289
type: key, defaultConsumerKeyClaim, defaultScopesClaim, configurations, authConfigurations,
294-
configurationConstraints: constraintsConfigurations,
295290
}) => {
296291
if (key === keyManagerType) {
297292
if (!id) {
@@ -307,11 +302,6 @@ function AddEditKeyManager(props) {
307302
...(Array.isArray(authConfigurations) ? authConfigurations : []),
308303
...configurations,
309304
]);
310-
setConstraintConfigurations(constraintsConfigurations || []);
311-
return true;
312-
} else if (key === 'WSO2-IS' && keyManagerType === 'default') {
313-
// since Application properties are same for default(resident key manager) and WSO2-IS Key managers
314-
setConstraintConfigurations(constraintsConfigurations || []);
315305
return true;
316306
} else {
317307
return false;
@@ -547,10 +537,6 @@ function AddEditKeyManager(props) {
547537

548538
const keymanager = {
549539
...state,
550-
additionalProperties: {
551-
...state.additionalProperties,
552-
constraints: !isEmpty(constraints) ? constraints : undefined,
553-
},
554540
tokenValidation: newTokenValidation,
555541
allowedOrganizations: validOrgs,
556542
tokenType,
@@ -612,60 +598,6 @@ function AddEditKeyManager(props) {
612598
}
613599
dispatch({ field: 'additionalProperties', value: clonedAdditionalProperties });
614600
};
615-
616-
const getConstraintsData = () => {
617-
const savedConstraints = additionalProperties?.constraints || {};
618-
const constraintsData = {};
619-
constraintConfigurations.forEach((constraintConfig) => {
620-
const key = constraintConfig.name;
621-
const savedConstraint = savedConstraints[key];
622-
if (savedConstraint?.type && savedConstraint?.value) {
623-
constraintsData[key] = savedConstraint;
624-
} else if (!id && constraintConfig.default) {
625-
if (isEmpty(constraintConfig.default)) {
626-
return;
627-
}
628-
constraintsData[key] = {
629-
type: constraintConfig.constraintType,
630-
value: constraintConfig.default,
631-
};
632-
}
633-
});
634-
return { constraintsData };
635-
};
636-
637-
const handleConstraintUpdate = (configName, value) => {
638-
setConstraints((prev) => {
639-
const newConstraints = { ...prev };
640-
if (value === undefined || value === null) {
641-
delete newConstraints[configName];
642-
} else {
643-
const config = constraintConfigurations.find((c) => c.name === configName);
644-
if (config) {
645-
newConstraints[configName] = { type: config.constraintType, value };
646-
}
647-
}
648-
return newConstraints;
649-
});
650-
};
651-
652-
const handleConstraintsExpandClick = () => {
653-
setConstraintSectionExpanded(!constraintSectionExpanded);
654-
};
655-
656-
useEffect(() => {
657-
if (!isEmpty(constraintConfigurations)) {
658-
const { constraintsData } = getConstraintsData();
659-
if (!isEmpty(constraintsData)) {
660-
setConstraints(constraintsData);
661-
}
662-
// Auto-expand if any field is already constrained (value is not null)
663-
if (Object.values(constraintsData).some((c) => c.value !== null)) {
664-
setConstraintSectionExpanded(true);
665-
}
666-
}
667-
}, [constraintConfigurations, id]);
668-
669601
const setTokenValidations = (value) => {
670602
dispatch({ field: 'tokenValidation', value });
671603
};
@@ -2382,69 +2314,6 @@ function AddEditKeyManager(props) {
23822314
</Typography>
23832315
)}
23842316
</Box>
2385-
{!isEmpty(constraintConfigurations) && (
2386-
<>
2387-
<Box display='flex' marginTop={3} marginBottom={2}>
2388-
<Typography
2389-
color='inherit'
2390-
variant='subtitle2'
2391-
component='a'
2392-
onClick={handleConstraintsExpandClick}
2393-
style={{ cursor: 'pointer' }}
2394-
id='KeyManagers.AddEditKeyManager.app.config.constraints.header'
2395-
>
2396-
<FormattedMessage
2397-
id='KeyManagers.AddEditKeyManager.app.config.constraints'
2398-
defaultMessage='Application Configuration Constraints'
2399-
/>
2400-
</Typography>
2401-
<IconButton
2402-
sx={{ marginLeft: 'auto' }}
2403-
onClick={handleConstraintsExpandClick}
2404-
aria-expanded={constraintSectionExpanded}
2405-
aria-label='show more'
2406-
size='large'
2407-
>
2408-
<StyledExpandMoreIcon
2409-
className={
2410-
constraintSectionExpanded
2411-
? 'expandOpen' : 'expand'
2412-
}
2413-
/>
2414-
</IconButton>
2415-
</Box>
2416-
<Box>
2417-
<Collapse
2418-
in={constraintSectionExpanded}
2419-
timeout='auto'
2420-
unmountOnExit
2421-
>
2422-
<Box pl={2}>
2423-
<Constraints
2424-
items={constraintConfigurations}
2425-
constraintsData={constraints}
2426-
onChange={handleConstraintUpdate}
2427-
disabled={false}
2428-
/>
2429-
</Box>
2430-
</Collapse>
2431-
{!constraintSectionExpanded && (
2432-
<Typography
2433-
color='inherit'
2434-
variant='caption'
2435-
component='div'
2436-
style={{ paddingLeft: 16 }}
2437-
id='KeyManagers.AddEditKeyManager.constraints.hidden.help.body'
2438-
>
2439-
<FormattedMessage
2440-
id='KeyManagers.AddEditKeyManager.constraints.hidden.help'
2441-
defaultMessage='Expand to configure constraints'
2442-
/>
2443-
</Typography>
2444-
)}
2445-
</Box>
2446-
</>
2447-
)}
24482317
</Box>
24492318
</Grid>
24502319
)}

0 commit comments

Comments
 (0)