diff --git a/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleMdmPage/components/content/ApplePushCertSetup.tsx b/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleMdmPage/components/content/ApplePushCertSetup.tsx index 2f90f070f0..c7911145ac 100644 --- a/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleMdmPage/components/content/ApplePushCertSetup.tsx +++ b/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleMdmPage/components/content/ApplePushCertSetup.tsx @@ -89,6 +89,7 @@ const ApplePushCertSetup = ({ newTab />
+
If you don't have an Apple ID, select Create yours now . diff --git a/frontend/pages/admin/IntegrationsPage/cards/Sso/Sso.tsx b/frontend/pages/admin/IntegrationsPage/cards/Sso/Sso.tsx index b0334970cf..05325fe9ca 100644 --- a/frontend/pages/admin/IntegrationsPage/cards/Sso/Sso.tsx +++ b/frontend/pages/admin/IntegrationsPage/cards/Sso/Sso.tsx @@ -69,10 +69,6 @@ const validate = (formData: ISsoFormData) => { errors.entity_id = "Entity ID must be present"; } - if (typeof entityId === "string" && entityId.length < 5) { - errors.entity_id = "Entity ID must be 5 or more characters"; - } - if (!idpName) { errors.idp_name = "Identity provider name must be present"; } diff --git a/frontend/utilities/date_format/index.ts b/frontend/utilities/date_format/index.ts index 3c08393c28..4c3bb2c556 100644 --- a/frontend/utilities/date_format/index.ts +++ b/frontend/utilities/date_format/index.ts @@ -1,4 +1,5 @@ -import { format, formatDistanceToNow } from "date-fns"; +import { format, formatDistanceToNow, parseISO } from "date-fns"; +import { formatInTimeZone } from "date-fns-tz"; /** Utility to create a string from a date in this format: `Uploaded .... ago` @@ -30,5 +31,5 @@ export const dateAgo = (date: string | Date) => { * @example "January 01, 2024" */ export const monthDayYearFormat = (date: string) => { - return format(date, "MMMM d, yyyy"); + return formatInTimeZone(parseISO(date), "UTC", "MMMM d, yyyy"); }; diff --git a/server/service/appconfig.go b/server/service/appconfig.go index 6c2fe9df5f..074a4c0759 100644 --- a/server/service/appconfig.go +++ b/server/service/appconfig.go @@ -1941,8 +1941,6 @@ func validateSSOProviderSettings(incoming, existing fleet.SSOProviderSettings, i if existing.EntityID == "" { invalid.Append("entity_id", "required") } - } else if len(incoming.EntityID) < 5 { - invalid.Append("entity_id", "must be 5 or more characters") } if incoming.IDPName == "" { if existing.IDPName == "" { diff --git a/server/service/appconfig_test.go b/server/service/appconfig_test.go index 5e93bafe27..9c0b9086ba 100644 --- a/server/service/appconfig_test.go +++ b/server/service/appconfig_test.go @@ -1097,7 +1097,31 @@ func TestMDMAppleConfig(t *testing.T) { MetadataURL: "http://isser.metadata.com", IDPName: "onelogin", }}}, - expectedError: "validation failed: entity_id must be 5 or more characters", + expectedMDM: fleet.MDM{ + AppleBusinessManager: optjson.Slice[fleet.MDMAppleABMAssignmentInfo]{Set: true, Value: []fleet.MDMAppleABMAssignmentInfo{}}, + EndUserAuthentication: fleet.MDMEndUserAuthentication{SSOProviderSettings: fleet.SSOProviderSettings{ + EntityID: "f", + MetadataURL: "http://isser.metadata.com", + IDPName: "onelogin", + }}, + MacOSSetup: fleet.MacOSSetup{ + BootstrapPackage: optjson.String{Set: true}, + MacOSSetupAssistant: optjson.String{Set: true}, + EnableReleaseDeviceManually: optjson.SetBool(false), + Software: optjson.Slice[*fleet.MacOSSetupSoftware]{Set: true, Value: []*fleet.MacOSSetupSoftware{}}, + Script: optjson.String{Set: true}, + ManualAgentInstall: optjson.Bool{Set: true}, + }, + MacOSUpdates: fleet.AppleOSUpdateSettings{MinimumVersion: optjson.String{Set: true}, Deadline: optjson.String{Set: true}}, + IOSUpdates: fleet.AppleOSUpdateSettings{MinimumVersion: optjson.String{Set: true}, Deadline: optjson.String{Set: true}}, + IPadOSUpdates: fleet.AppleOSUpdateSettings{MinimumVersion: optjson.String{Set: true}, Deadline: optjson.String{Set: true}}, + VolumePurchasingProgram: optjson.Slice[fleet.MDMAppleVolumePurchasingProgramInfo]{Set: true, Value: []fleet.MDMAppleVolumePurchasingProgramInfo{}}, + WindowsUpdates: fleet.WindowsUpdates{DeadlineDays: optjson.Int{Set: true}, GracePeriodDays: optjson.Int{Set: true}}, + WindowsSettings: fleet.WindowsSettings{ + CustomSettings: optjson.Slice[fleet.MDMProfileSpec]{Set: true, Value: []fleet.MDMProfileSpec{}}, + }, + RequireBitLockerPIN: optjson.Bool{Set: true, Value: false}, + }, }, { name: "ssoMissingMetadata", licenseTier: "premium",