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

Commit1aedb92

Browse files
committed
Update titles
1 parent0efc40d commit1aedb92

File tree

2 files changed

+141
-127
lines changed

2 files changed

+141
-127
lines changed

‎site/src/pages/DeploySettingsPage/NotificationsPage/NotificationsPage.tsx

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import ToggleButton from "@mui/material/ToggleButton";
88
importToggleButtonGroupfrom"@mui/material/ToggleButtonGroup";
99
importTooltipfrom"@mui/material/Tooltip";
1010
import{Fragment,typeFC}from"react";
11+
import{Helmet}from"react-helmet-async";
1112
import{useMutation,useQueries,useQueryClient}from"react-query";
1213
import{useSearchParams}from"react-router-dom";
1314
import{
@@ -30,6 +31,7 @@ import {
3031
}from"modules/notifications/utils";
3132
import{Section}from"pages/UserSettingsPage/Section";
3233
import{deploymentGroupHasParent}from"utils/deployOptions";
34+
import{pageTitle}from"utils/page";
3335
import{useDeploySettings}from"../DeploySettingsLayout";
3436
importOptionsTablefrom"../OptionsTable";
3537

@@ -107,47 +109,52 @@ export const NotificationsPage: FC = () => {
107109
consttab=searchParams.get("tab")||"events";
108110

109111
return(
110-
<Section
111-
title="Notifications"
112-
description="Control delivery methods for notifications. Settings applied to this deployment."
113-
layout="fluid"
114-
>
115-
<Tabsactive={tab}>
116-
<TabsList>
117-
<TabLinkto="?tab=events"value="events">
118-
Events
119-
</TabLink>
120-
<TabLinkto="?tab=settings"value="settings">
121-
Settings
122-
</TabLink>
123-
</TabsList>
124-
</Tabs>
112+
<>
113+
<Helmet>
114+
<title>{pageTitle("Notifications Settings")}</title>
115+
</Helmet>
116+
<Section
117+
title="Notifications"
118+
description="Control delivery methods for notifications. Settings applied to this deployment."
119+
layout="fluid"
120+
>
121+
<Tabsactive={tab}>
122+
<TabsList>
123+
<TabLinkto="?tab=events"value="events">
124+
Events
125+
</TabLink>
126+
<TabLinkto="?tab=settings"value="settings">
127+
Settings
128+
</TabLink>
129+
</TabsList>
130+
</Tabs>
125131

126-
<divcss={styles.content}>
127-
{ready ?(
128-
tab==="events" ?(
129-
<EventsView
130-
defaultMethod={castNotificationMethod(
131-
dispatchMethods.data.default,
132-
)}
133-
availableMethods={dispatchMethods.data.available.map(
134-
castNotificationMethod,
135-
)}
136-
notificationsConfig={deploymentValues.config.notifications}
137-
templatesByGroup={templatesByGroup.data}
138-
/>
132+
<divcss={styles.content}>
133+
{ready ?(
134+
tab==="events" ?(
135+
<EventsView
136+
defaultMethod={castNotificationMethod(
137+
dispatchMethods.data.default,
138+
)}
139+
availableMethods={dispatchMethods.data.available.map(
140+
castNotificationMethod,
141+
)}
142+
notificationsConfig={deploymentValues.config.notifications}
143+
templatesByGroup={templatesByGroup.data}
144+
/>
145+
) :(
146+
<OptionsTable
147+
options={deploymentValues?.options.filter((o)=>
148+
deploymentGroupHasParent(o.group,"Notifications"),
149+
)}
150+
/>
151+
)
139152
) :(
140-
<OptionsTable
141-
options={deploymentValues?.options.filter((o)=>
142-
deploymentGroupHasParent(o.group,"Notifications"),
143-
)}
144-
/>
145-
)
146-
) :(
147-
<Loader/>
148-
)}
149-
</div>
150-
</Section>
153+
<Loader/>
154+
)}
155+
</div>
156+
</Section>
157+
</>
151158
);
152159
};
153160

‎site/src/pages/UserSettingsPage/NotificationsPage/NotificationsPage.tsx

Lines changed: 95 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import ListItemText, { listItemTextClasses } from "@mui/material/ListItemText";
88
importSwitchfrom"@mui/material/Switch";
99
importTooltipfrom"@mui/material/Tooltip";
1010
import{Fragment,typeFC}from"react";
11+
import{Helmet}from"react-helmet-async";
1112
import{useMutation,useQueries,useQueryClient}from"react-query";
1213
import{
1314
notificationDispatchMethods,
@@ -29,6 +30,7 @@ import {
2930
methodIcons,
3031
methodLabels,
3132
}from"modules/notifications/utils";
33+
import{pageTitle}from"utils/page";
3234
import{Section}from"../Section";
3335

3436
typePreferenceSwitchProps={
@@ -90,100 +92,105 @@ export const NotificationsPage: FC = () => {
9092
disabledPreferences.data&&templatesByGroup.data&&dispatchMethods.data;
9193

9294
return(
93-
<Section
94-
title="Notifications"
95-
description="Configure notifications. Some may be disabled by the deployment administrator."
96-
layout="fluid"
97-
>
98-
{ready ?(
99-
<Stackspacing={3}>
100-
{Object.entries(templatesByGroup.data).map(([group,templates])=>{
101-
constallDisabled=templates.some((tpl)=>{
102-
returndisabledPreferences.data[tpl.id]===true;
103-
});
95+
<>
96+
<Helmet>
97+
<title>{pageTitle("Notifications Settings")}</title>
98+
</Helmet>
99+
<Section
100+
title="Notifications"
101+
description="Configure notifications. Some may be disabled by the deployment administrator."
102+
layout="fluid"
103+
>
104+
{ready ?(
105+
<Stackspacing={3}>
106+
{Object.entries(templatesByGroup.data).map(([group,templates])=>{
107+
constallDisabled=templates.some((tpl)=>{
108+
returndisabledPreferences.data[tpl.id]===true;
109+
});
104110

105-
return(
106-
<Card
107-
variant="outlined"
108-
css={{background:"transparent"}}
109-
key={group}
110-
>
111-
<List>
112-
<ListItemcss={styles.listHeader}>
113-
<ListItemIcon>
114-
<PreferenceSwitch
115-
id={group}
116-
disabled={allDisabled}
117-
onToggle={(checked)=>{
118-
constupdated={ ...disabledPreferences.data};
119-
for(consttploftemplates){
120-
updated[tpl.id]=!checked;
121-
}
122-
returnupdated;
111+
return(
112+
<Card
113+
variant="outlined"
114+
css={{background:"transparent"}}
115+
key={group}
116+
>
117+
<List>
118+
<ListItemcss={styles.listHeader}>
119+
<ListItemIcon>
120+
<PreferenceSwitch
121+
id={group}
122+
disabled={allDisabled}
123+
onToggle={(checked)=>{
124+
constupdated={ ...disabledPreferences.data};
125+
for(consttploftemplates){
126+
updated[tpl.id]=!checked;
127+
}
128+
returnupdated;
129+
}}
130+
/>
131+
</ListItemIcon>
132+
<ListItemText
133+
css={styles.listItemText}
134+
primary={group}
135+
primaryTypographyProps={{
136+
component:"label",
137+
htmlFor:group,
123138
}}
124139
/>
125-
</ListItemIcon>
126-
<ListItemText
127-
css={styles.listItemText}
128-
primary={group}
129-
primaryTypographyProps={{
130-
component:"label",
131-
htmlFor:group,
132-
}}
133-
/>
134-
</ListItem>
135-
{templates.map((tmpl)=>{
136-
constmethod=castNotificationMethod(
137-
tmpl.method||dispatchMethods.data.default,
138-
);
139-
constIcon=methodIcons[method];
140-
constlabel=methodLabels[method];
140+
</ListItem>
141+
{templates.map((tmpl)=>{
142+
constmethod=castNotificationMethod(
143+
tmpl.method||dispatchMethods.data.default,
144+
);
145+
constIcon=methodIcons[method];
146+
constlabel=methodLabels[method];
141147

142-
return(
143-
<Fragmentkey={tmpl.id}>
144-
<ListItem>
145-
<ListItemIcon>
146-
<PreferenceSwitch
147-
id={tmpl.id}
148-
disabled={disabledPreferences.data[tmpl.id]}
149-
onToggle={(checked)=>{
150-
return{
151-
...disabledPreferences.data,
152-
[tmpl.id]:!checked,
153-
};
148+
return(
149+
<Fragmentkey={tmpl.id}>
150+
<ListItem>
151+
<ListItemIcon>
152+
<PreferenceSwitch
153+
id={tmpl.id}
154+
disabled={disabledPreferences.data[tmpl.id]}
155+
onToggle={(checked)=>{
156+
return{
157+
...disabledPreferences.data,
158+
[tmpl.id]:!checked,
159+
};
160+
}}
161+
/>
162+
</ListItemIcon>
163+
<ListItemText
164+
primaryTypographyProps={{
165+
component:"label",
166+
htmlFor:tmpl.id,
154167
}}
168+
css={styles.listItemText}
169+
primary={tmpl.name}
155170
/>
156-
</ListItemIcon>
157-
<ListItemText
158-
primaryTypographyProps={{
159-
component:"label",
160-
htmlFor:tmpl.id,
161-
}}
162-
css={styles.listItemText}
163-
primary={tmpl.name}
164-
/>
165-
<ListItemIcon
166-
css={styles.listItemEndIcon}
167-
aria-label="Delivery method"
168-
>
169-
<Tooltiptitle={label}>
170-
<Iconaria-label={label}/>
171-
</Tooltip>
172-
</ListItemIcon>
173-
</ListItem>
174-
<Dividercss={styles.divider}/>
175-
</Fragment>
176-
);
177-
})}
178-
</List>
179-
</Card>
180-
);
181-
})}
182-
</Stack>
183-
) :(
184-
<Loader/>
185-
)}
186-
</Section>
171+
<ListItemIcon
172+
css={styles.listItemEndIcon}
173+
aria-label="Delivery method"
174+
>
175+
<Tooltiptitle={label}>
176+
<Iconaria-label={label}/>
177+
</Tooltip>
178+
</ListItemIcon>
179+
</ListItem>
180+
<Dividercss={styles.divider}/>
181+
</Fragment>
182+
);
183+
})}
184+
</List>
185+
</Card>
186+
);
187+
})}
188+
</Stack>
189+
) :(
190+
<Loader/>
191+
)}
192+
</Section>
193+
</>
187194
);
188195
};
189196

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp