mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Adding timezone label on UI and Updated @tryghost/timezone-data for Admin-X Settings (#18702)
Ref. https://www.notion.so/ghost/Kyiv-Kiev-timezone-issue-https-ghost-slack-com-archives-C0568LN2CGJ-p1697467598549909-cc0a8b6388df45018f48e0a917490bf4
This commit is contained in:
parent
caae0edf19
commit
4bf3c6c98c
4 changed files with 6 additions and 9 deletions
|
@ -48,7 +48,7 @@
|
||||||
"@tryghost/color-utils": "0.1.24",
|
"@tryghost/color-utils": "0.1.24",
|
||||||
"@tryghost/limit-service": "^1.2.10",
|
"@tryghost/limit-service": "^1.2.10",
|
||||||
"@tryghost/nql": "0.11.0",
|
"@tryghost/nql": "0.11.0",
|
||||||
"@tryghost/timezone-data": "0.3.0",
|
"@tryghost/timezone-data": "0.3.8",
|
||||||
"@uiw/react-codemirror": "^4.21.9",
|
"@uiw/react-codemirror": "^4.21.9",
|
||||||
"clsx": "2.0.0",
|
"clsx": "2.0.0",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
|
|
@ -56,6 +56,8 @@ const TimeZone: React.FC<{ keywords: string[] }> = ({keywords}) => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const publicationTimezoneData = timezoneOptions.find(option => option.value === publicationTimezone);
|
||||||
|
|
||||||
const handleTimezoneChange = (value?: string) => {
|
const handleTimezoneChange = (value?: string) => {
|
||||||
updateSetting('timezone', value || null);
|
updateSetting('timezone', value || null);
|
||||||
};
|
};
|
||||||
|
@ -65,7 +67,7 @@ const TimeZone: React.FC<{ keywords: string[] }> = ({keywords}) => {
|
||||||
{
|
{
|
||||||
key: 'site-timezone',
|
key: 'site-timezone',
|
||||||
value: <div className='flex flex-col'>
|
value: <div className='flex flex-col'>
|
||||||
{publicationTimezone}
|
{publicationTimezoneData?.label || publicationTimezone}
|
||||||
<span className='text-sm'><Hint timezone={publicationTimezone} /></span>
|
<span className='text-sm'><Hint timezone={publicationTimezone} /></span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ test.describe('Time zone settings', async () => {
|
||||||
|
|
||||||
const section = page.getByTestId('timezone');
|
const section = page.getByTestId('timezone');
|
||||||
|
|
||||||
await expect(section.getByText('Etc/UTC')).toHaveCount(1);
|
await expect(section.getByText('(GMT) UTC')).toHaveCount(1);
|
||||||
|
|
||||||
await section.getByRole('button', {name: 'Edit'}).click();
|
await section.getByRole('button', {name: 'Edit'}).click();
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ test.describe('Time zone settings', async () => {
|
||||||
|
|
||||||
await expect(section.getByTestId('timezone-select')).toHaveCount(0);
|
await expect(section.getByTestId('timezone-select')).toHaveCount(0);
|
||||||
|
|
||||||
await expect(section.getByText('America/Anchorage')).toHaveCount(1);
|
await expect(section.getByText('(GMT -9:00) Alaska')).toHaveCount(1);
|
||||||
|
|
||||||
expect(lastApiRequests.editSettings?.body).toEqual({
|
expect(lastApiRequests.editSettings?.body).toEqual({
|
||||||
settings: [
|
settings: [
|
||||||
|
|
|
@ -8086,11 +8086,6 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
unidecode "^0.1.8"
|
unidecode "^0.1.8"
|
||||||
|
|
||||||
"@tryghost/timezone-data@0.3.0":
|
|
||||||
version "0.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tryghost/timezone-data/-/timezone-data-0.3.0.tgz#5b0940a370a22a0fa3bdf506850dabbc6af574fa"
|
|
||||||
integrity sha512-3vdaEugCY7cTOlo8TuEYTXnXJa1CeNKJ34EU9uJPxWfUsd0BwaSN0hNcXLHhKxnPQnnJkSjradkXSvTfUsYZiA==
|
|
||||||
|
|
||||||
"@tryghost/timezone-data@0.3.8":
|
"@tryghost/timezone-data@0.3.8":
|
||||||
version "0.3.8"
|
version "0.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/@tryghost/timezone-data/-/timezone-data-0.3.8.tgz#413f8c7efa972bbdb186d95f4eab8d2799704010"
|
resolved "https://registry.yarnpkg.com/@tryghost/timezone-data/-/timezone-data-0.3.8.tgz#413f8c7efa972bbdb186d95f4eab8d2799704010"
|
||||||
|
|
Loading…
Add table
Reference in a new issue