fix: update migration script (#4065)

* fix: update migration script

fix: remove insert for new entities

* fix: correct migration name

* fix: correct name inside migration
This commit is contained in:
Brandon Cohen
2025-03-03 19:46:45 -06:00
committed by GitHub
parent 5b50a8503a
commit db06f8cf07
4 changed files with 25 additions and 39 deletions

View File

@@ -24,6 +24,7 @@ const messages = defineMessages({
browser: 'Browser',
engine: 'Engine',
deletesubscription: 'Delete Subscription',
unknown: 'Unknown',
});
const DeviceItem = ({ disablePushNotifications, device }: DeviceItemProps) => {
@@ -48,12 +49,12 @@ const DeviceItem = ({ disablePushNotifications, device }: DeviceItemProps) => {
month: 'long',
day: 'numeric',
})
: 'Unknown'}
: 'N/A'}
</div>
<div className="mr-2 min-w-0 truncate text-lg font-bold text-white hover:underline xl:text-xl">
{device.userAgent
? UAParser(device.userAgent).device.model
: 'Unknown'}
: intl.formatMessage(messages.unknown)}
</div>
</div>
</div>
@@ -63,9 +64,7 @@ const DeviceItem = ({ disablePushNotifications, device }: DeviceItemProps) => {
{intl.formatMessage(messages.operatingsystem)}
</span>
<span className="flex truncate text-sm text-gray-300">
{device.userAgent
? UAParser(device.userAgent).os.name
: 'Unknown'}
{device.userAgent ? UAParser(device.userAgent).os.name : 'N/A'}
</span>
</div>
<div className="card-field">
@@ -75,7 +74,7 @@ const DeviceItem = ({ disablePushNotifications, device }: DeviceItemProps) => {
<span className="flex truncate text-sm text-gray-300">
{device.userAgent
? UAParser(device.userAgent).browser.name
: 'Unknown'}
: 'N/A'}
</span>
</div>
<div className="card-field">
@@ -85,7 +84,7 @@ const DeviceItem = ({ disablePushNotifications, device }: DeviceItemProps) => {
<span className="flex truncate text-sm text-gray-300">
{device.userAgent
? UAParser(device.userAgent).engine.name
: 'Unknown'}
: 'N/A'}
</span>
</div>
</div>

View File

@@ -312,15 +312,21 @@ const UserWebPushSettings = () => {
</h3>
<div className="section">
{dataDevices?.length ? (
dataDevices?.map((device, index) => (
<div className="py-2" key={`device-list-${index}`}>
<DeviceItem
key={index}
disablePushNotifications={disablePushNotifications}
device={device}
/>
</div>
))
dataDevices
?.sort((a, b) => {
const dateA = a.createdAt ? new Date(a.createdAt).getTime() : 0;
const dateB = b.createdAt ? new Date(b.createdAt).getTime() : 0;
return dateB - dateA;
})
.map((device, index) => (
<div className="py-2" key={`device-list-${index}`}>
<DeviceItem
key={index}
disablePushNotifications={disablePushNotifications}
device={device}
/>
</div>
))
) : (
<>
<Alert

View File

@@ -1121,6 +1121,7 @@
"components.UserProfile.UserSettings.UserNotificationSettings.UserNotificationsWebPush.subscriptiondeleted": "Subscription deleted.",
"components.UserProfile.UserSettings.UserNotificationSettings.UserNotificationsWebPush.subscriptiondeleteerror": "Something went wrong while deleting the user subscription.",
"components.UserProfile.UserSettings.UserNotificationSettings.UserNotificationsWebPush.type": "type",
"components.UserProfile.UserSettings.UserNotificationSettings.UserNotificationsWebPush.unknown": "Unknown",
"components.UserProfile.UserSettings.UserNotificationSettings.UserNotificationsWebPush.webpushhasbeendisabled": "Web push has been disabled.",
"components.UserProfile.UserSettings.UserNotificationSettings.UserNotificationsWebPush.webpushhasbeenenabled": "Web push has been enabled.",
"components.UserProfile.UserSettings.UserNotificationSettings.UserNotificationsWebPush.webpushsettingsfailed": "Web push notification settings failed to save.",