Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36fa80c

Browse files
committed
chore: make templates search error the same as workspaces
1 parent4b5c45d commit36fa80c

File tree

2 files changed

+36
-38
lines changed

2 files changed

+36
-38
lines changed

‎site/src/pages/TemplatesPage/TemplatesFilter.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ import type { FC } from "react";
1616

1717
interfaceTemplatesFilterProps{
1818
filter:ReturnType<typeofuseFilter>;
19+
error?:unknown;
1920
}
2021

21-
exportconstTemplatesFilter:FC<TemplatesFilterProps>=({ filter})=>{
22+
exportconstTemplatesFilter:FC<TemplatesFilterProps>=({ filter, error})=>{
2223
constorganizationMenu=useFilterMenu({
2324
onChange:(option)=>
2425
filter.update({ ...filter.values,organization:option?.value}),
@@ -48,6 +49,7 @@ export const TemplatesFilter: FC<TemplatesFilterProps> = ({ filter }) => {
4849
// learnMoreLink={docs("/templates#template-filtering")}
4950
isLoading={false}
5051
filter={filter}
52+
error={error}
5153
options={
5254
<>
5355
<SelectFilter

‎site/src/pages/TemplatesPage/TemplatesPageView.tsx

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -228,45 +228,41 @@ export const TemplatesPageView: FC<TemplatesPageViewProps> = ({
228228
</PageHeaderSubtitle>
229229
</PageHeader>
230230

231-
<TemplatesFilterfilter={filter}/>
231+
<TemplatesFilterfilter={filter}error={error}/>
232+
233+
<TableContainer>
234+
<Table>
235+
<TableHead>
236+
<TableRow>
237+
<TableCellwidth="35%">{Language.nameLabel}</TableCell>
238+
<TableCellwidth="15%">
239+
{showOrganizations ?"Organization" :Language.usedByLabel}
240+
</TableCell>
241+
<TableCellwidth="10%">{Language.buildTimeLabel}</TableCell>
242+
<TableCellwidth="15%">{Language.lastUpdatedLabel}</TableCell>
243+
<TableCellwidth="1%"/>
244+
</TableRow>
245+
</TableHead>
246+
<TableBody>
247+
{isLoading&&<TableLoader/>}
232248

233-
{error ?(
234-
<ErrorAlerterror={error}/>
235-
) :(
236-
<TableContainer>
237-
<Table>
238-
<TableHead>
239-
<TableRow>
240-
<TableCellwidth="35%">{Language.nameLabel}</TableCell>
241-
<TableCellwidth="15%">
242-
{showOrganizations ?"Organization" :Language.usedByLabel}
243-
</TableCell>
244-
<TableCellwidth="10%">{Language.buildTimeLabel}</TableCell>
245-
<TableCellwidth="15%">{Language.lastUpdatedLabel}</TableCell>
246-
<TableCellwidth="1%"/>
247-
</TableRow>
248-
</TableHead>
249-
<TableBody>
250-
{isLoading&&<TableLoader/>}
251-
252-
{isEmpty ?(
253-
<EmptyTemplates
254-
canCreateTemplates={canCreateTemplates}
255-
examples={examples??[]}
249+
{isEmpty ?(
250+
<EmptyTemplates
251+
canCreateTemplates={canCreateTemplates}
252+
examples={examples??[]}
253+
/>
254+
) :(
255+
templates?.map((template)=>(
256+
<TemplateRow
257+
key={template.id}
258+
showOrganizations={showOrganizations}
259+
template={template}
256260
/>
257-
) :(
258-
templates?.map((template)=>(
259-
<TemplateRow
260-
key={template.id}
261-
showOrganizations={showOrganizations}
262-
template={template}
263-
/>
264-
))
265-
)}
266-
</TableBody>
267-
</Table>
268-
</TableContainer>
269-
)}
261+
))
262+
)}
263+
</TableBody>
264+
</Table>
265+
</TableContainer>
270266
</Margins>
271267
);
272268
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp