Skip to content

Commit

Permalink
Added placeholder for no templates (#2428)
Browse files Browse the repository at this point in the history
* Added placeholder for no templates

* Reduce margin

Co-authored-by: jjgriff93 <jamesgr@microsoft.com>
  • Loading branch information
jjgriff93 and jjgriff93 authored Aug 11, 2022
1 parent 3ff5a3a commit e23317e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ui/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Operation } from './models/operation';
import { ResourceUpdate } from './models/resource';
import { HttpMethod, ResultType, useAuthApiCall } from './hooks/useAuthApiCall';
import { ApiEndpoint } from './models/apiEndpoints';
import { CreateUpdateResource } from './components/shared/CreateUpdateResource/CreateUpdateResource';
import { CreateUpdateResource } from './components/shared/create-update-resource/CreateUpdateResource';
import { CreateUpdateResourceContext } from './contexts/CreateUpdateResourceContext';
import { CreateFormResource, ResourceType } from './models/resourceType';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ export const CreateUpdateResource: React.FunctionComponent<CreateUpdateResourceP
closeButtonAriaLabel="Close"
isLightDismiss
>
{currentPage}
<div style={{ paddingTop: 30 }}>
{currentPage}
</div>
</Panel>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const SelectTemplate: React.FunctionComponent<SelectTemplateProps> = (pro
switch (loading) {
case LoadingState.Ok:
return (
templates ? <Stack style={{ marginTop: 20 }}>
templates && templates.length > 0 ? <Stack>
{
templates.map((template: any, i) => {
return (
Expand All @@ -46,7 +46,13 @@ export const SelectTemplate: React.FunctionComponent<SelectTemplateProps> = (pro
)
})
}
</Stack> : null
</Stack> : <MessageBar
messageBarType={MessageBarType.info}
isMultiline={true}
>
<h3>No templates found</h3>
<p>Looks like there aren't any templates registered for this resource type.</p>
</MessageBar>
)
case LoadingState.Error:
return (
Expand Down

0 comments on commit e23317e

Please sign in to comment.