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

Fix endpoint certificate upload button not activating #800

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions portals/publisher/src/main/webapp/site/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@
"Apis.Details.Endpoints.EndpointOverview.sandbox.endpoint.sandbox.header": "Sandbox Endpoint",
"Apis.Details.Endpoints.EndpointOverview.upload.mediation.message": "Please upload a mediation sequence file to Message Mediation Policies, which sets the endpoints.",
"Apis.Details.Endpoints.Endpoints.cancel": "Cancel",
"Apis.Details.Endpoints.Endpoints.delete.sequence.backend.error": "Error Deleting Sandbox Sequence Backend",
"Apis.Details.Endpoints.Endpoints.endpoints.header": "Endpoints",
"Apis.Details.Endpoints.Endpoints.missing.accessKey.secretKey.error": "Access Key, Secret Key and Region should not be empty",
"Apis.Details.Endpoints.Endpoints.missing.endpoint.error": "Either one of Production or Sandbox Endpoints should be added.",
Expand All @@ -734,6 +735,7 @@
"Apis.Details.Endpoints.Endpoints.missing.security.oauth.password.error": "Endpoint Security Token URL/API Key/API Secret/Username/Password should not be empty",
"Apis.Details.Endpoints.Endpoints.missing.security.username.error": "Endpoint Security User Name/ Password should not be empty",
"Apis.Details.Endpoints.Endpoints.missing.stsAssumeRole.config": "Role ARN, Role Session Name and Region should not be empty",
"Apis.Details.Endpoints.Endpoints.upload.sequence.backend.error": "Error Uploading Sandbox Sequence Backend",
"Apis.Details.Endpoints.GeneralConfiguration.Certificates.NoCertificatesUploaded": "You do not have any certificates uploaded",
"Apis.Details.Endpoints.GeneralConfiguration.Certificates.certificate.add.success": "Certificate added successfully",
"Apis.Details.Endpoints.GeneralConfiguration.Certificates.certificate.alias.exist": "Adding Certificate Failed. Certificate Alias Exists.",
Expand Down Expand Up @@ -867,10 +869,10 @@
"Apis.Details.Endpoints.Security.api.key.value.value": "API Key",
"Apis.Details.Endpoints.Security.no.api.key.value.error": "API Key should not be empty",
"Apis.Details.Endpoints.SequenceBackend.AddCertificat": "Add Sequence Backend",
"Apis.Details.Endpoints.SequenceBackend.AddSequence": "Add Sequence Backend",
"Apis.Details.Endpoints.SequenceBackend.delete.cancel.button": "Cancel",
"Apis.Details.Endpoints.SequenceBackend.delete.ok.button": "OK",
"Apis.Details.Endpoints.SequenceBackend.deleteCustomBackend": "Delete with caution!",
"Apis.Details.Endpoints.SequenceBackend.missing.backend.error": "Either one of Production or Sandbox Endpoints should be added.",
"Apis.Details.Endpoints.UploadCustomBackend.cancel.button": "Close",
"Apis.Details.Endpoints.UploadCustomBackend.click.or.drop.to.upload.file": "Click or drag the sequence backend file to upload.",
"Apis.Details.Endpoints.UploadCustomBackend.config.save.button": "Save",
Expand Down Expand Up @@ -1059,7 +1061,7 @@
"Apis.Details.NewOverview.MetaData.access.control.all.tooltip": "All : The API is viewable, modifiable by all the publishers and creators.",
"Apis.Details.NewOverview.MetaData.access.control.tooltip": "Restricted by roles : The API can be viewable and modifiable by only specific publishers and creators with the roles that you specify",
"Apis.Details.NewOverview.MetaData.config": "Configuration",
"Apis.Details.NewOverview.MetaData.context:": "Context:",
"Apis.Details.NewOverview.MetaData.context:": "Context",
"Apis.Details.NewOverview.MetaData.created.time": "Created Time",
"Apis.Details.NewOverview.MetaData.createdTime.not.set": "-",
"Apis.Details.NewOverview.MetaData.description": "Description",
Expand All @@ -1085,7 +1087,7 @@
"Apis.Details.NewOverview.MetaData.transports": "Transports",
"Apis.Details.NewOverview.MetaData.transports.not.set": "-",
"Apis.Details.NewOverview.MetaData.type.not.set": "-",
"Apis.Details.NewOverview.MetaData.type:": "Type:",
"Apis.Details.NewOverview.MetaData.type:": "Type",
"Apis.Details.NewOverview.MetaData.version": "Version",
"Apis.Details.NewOverview.MetaData.visibility.store": "Visibility on Developer Portal",
"Apis.Details.NewOverview.MetaData.visibility.store.all.tooltip": "Public: The API is accessible to everyone and can be advertised in multiple developer portals - a central developer portal and/or non-WSO2 developer portals.",
Expand All @@ -1095,7 +1097,7 @@
"Apis.Details.NewOverview.Operations.ShowMore": "Show More",
"Apis.Details.NewOverview.Operations.operation": "Operations",
"Apis.Details.NewOverview.Operations.operations": "Operation",
"Apis.Details.NewOverview.Policies.business.plans": "Business Plans:",
"Apis.Details.NewOverview.Policies.business.plans": "Business Plans",
"Apis.Details.NewOverview.Resources.loading": "loading...",
"Apis.Details.NewOverview.Resources.resource.not.found": "resource not found...",
"Apis.Details.NewOverview.Resources.resources": "Resources",
Expand Down Expand Up @@ -2056,8 +2058,8 @@
"Workflow.SubscriptionCreation.title.subscriptioncreation": "Subscription Creation - Approval Tasks",
"Workflow.SubscriptionCreation.title.subscriptionupdate": "Subscription Update - Approval Tasks",
"Workflow.SubscriptionCreation.update.success": "Workflow status is updated successfully",
"Workflow.SubscriptionUpdate.List.empty.content.subscriptionupdate": "There are no pending workflow requests for subscription update",
"Workflow.SubscriptionUpdate.List.empty.title.subscriptionupdate": "Subscription update",
"Workflow.SubscriptionUpdate.List.empty.content.subscriptionupdate": "There are no pending workflow requests for subscription update.",
"Workflow.SubscriptionUpdate.List.empty.title.subscriptionupdate": "Subscription Update",
"Workflow.SubscriptionUpdate.Reject.Title": "Reject",
"Workflow.SubscriptionUpdate.Reject.button.cancel": "Cancel",
"Workflow.SubscriptionUpdate.Reject.button.delete": "Reject",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Checkbox from '@mui/material/Checkbox';
import CircularProgress from '@mui/material/CircularProgress';
import { FormattedMessage } from 'react-intl';
import API from 'AppData/api';
import CONSTS from 'AppData/Constants';

const PREFIX = 'SelectPolicies';

Expand Down Expand Up @@ -68,7 +69,7 @@ export default function SelectPolicies(props) {
multiple,
renderValue: (selected) => (Array.isArray(selected) ? selected.join(', ') : selected),
}}
helperText={isAPIProduct ? helperText + 'API Product' : helperText + 'API'}
helperText={helperText}
margin='normal'
variant='outlined'
InputProps={{
Expand All @@ -78,18 +79,19 @@ export default function SelectPolicies(props) {
for: 'itest-id-apipolicies-input',
}}
>
{policies.list.map((policy) => (
<MenuItem
dense
disableGutters={multiple}
id={policy.name}
key={policy.name}
value={policy.displayName}
>
{multiple && <Checkbox color='primary' checked={selectedPolicies.includes(policy.name)} />}
<ListItemText primary={policy.displayName} secondary={policy.description} />
</MenuItem>
))}
{policies.list.filter((policy) => !policy.name.includes(CONSTS.DEFAULT_SUBSCRIPTIONLESS_PLAN))
.map((policy) => (
<MenuItem
dense
disableGutters={multiple}
id={policy.name}
key={policy.name}
value={policy.displayName}
>
{multiple && <Checkbox color='primary' checked={selectedPolicies.includes(policy.name)} />}
<ListItemText primary={policy.displayName} secondary={policy.description} />
</MenuItem>
))}
</StyledTextField>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default function UploadCertificate(props) {
const [isSaving, setSaving] = useState(false);
const [certificate, setCertificate] = useState({ name: '', content: {} });
const [isEndpointEmpty, setIsEndpointEmpty] = useState(false);
const [isPoliciesEmpty, setPoliciesEmpty] = useState(false);
const [isPoliciesEmpty, setPoliciesEmpty] = useState(true);
const [aliasValidity, setAliasValidity] = useState();
const [keyType, setKeyType] = useState(API_SECURITY_KEY_TYPE_PRODUCTION);

Expand Down Expand Up @@ -500,7 +500,6 @@ export default function UploadCertificate(props) {
|| isSaving
|| isAliasIncluded()
|| isRejected
|| policy === ''
}
>
<FormattedMessage
Expand Down
Loading