Skip to content

Commit

Permalink
Merge pull request #721 from DinithHerath/main
Browse files Browse the repository at this point in the history
Fix issues related to document markdown editor and tryout console in publisher portal
  • Loading branch information
DinithHerath authored Aug 16, 2024
2 parents aae2f57 + 5c64607 commit b463e24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ const StyledDialog = styled(Dialog)({
},
[`& .${classes.splitWrapper}`]: {
padding: 0,
height: 'calc(100vh - 64px)',
overflow: 'hidden',
},
[`& .${classes.docName}`]: {
alignItems: 'center',
Expand Down Expand Up @@ -193,6 +195,7 @@ function TextEditor(props) {
editorState={editorState}
wrapperClassName='draftjs-wrapper'
editorClassName='draftjs-editor'
editorStyle={{ height: 'calc(100vh - 128px)', overflowY: 'auto' }}
onEditorStateChange={onEditorStateChange}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const tasksReducer = (state, action) => {
const TryOutConsole = () => {

const [api] = useAPI();
const [apiKey, setAPIKey] = useState('');
const [apiKey, setAPIKey] = useState(null);
const [deployments, setDeployments] = useState([]);
const [selectedDeployment, setSelectedDeployment] = useState();
const [oasDefinition, setOasDefinition] = useState();
Expand Down Expand Up @@ -283,15 +283,15 @@ const TryOutConsole = () => {
const currentSelection = deployments.find((deployment) => deployment.name === selectedGWEnvironment);
setSelectedDeployment(currentSelection);
};
const decodedJWT = useMemo(() => Utils.decodeJWT(apiKey), [apiKey]);
const decodedJWT = useMemo(() => Utils.decodeJWT(apiKey || ''), [apiKey]);
const isAPIRetired = api.lifeCycleStatus === 'RETIRED';

const accessTokenProvider = () => {
if (isAdvertised) {
return advAuthHeaderValue;
}
return apiKey;
};
};

const getAuthorizationHeader = () => {
if (isAdvertised) {
Expand Down Expand Up @@ -326,6 +326,9 @@ const TryOutConsole = () => {
defaultMessage='Internal API Key'
/>
)}
InputLabelProps={{
shrink: true,
}}
type='password'
value={apiKey}
helperText={decodedJWT ? (
Expand Down Expand Up @@ -455,7 +458,7 @@ const TryOutConsole = () => {
advertiseInfo={api.advertiseInfo}
/>
)}
{updatedOasDefinition ? (
{updatedOasDefinition && apiKey !== null ? (
<Suspense
fallback={(
<CircularProgress />
Expand Down

0 comments on commit b463e24

Please sign in to comment.