Skip to content

Commit d1dc453

Browse files
AndyButlandnielslyngsoeiOvergaardleekelleher
authored
Resolves issues related to the setting of a schedule for content publishing (#17868)
* Render scheduled publish and unpublish on content info workspace view. * Populate previously saved schedule on set schedule dialog. * Hide workspace button actions that require a saved document when the document is new. * Convert between local and server time when saving and displaying schedule. * Fix issues with clearing of previously set schedule. * Updated OpenApi.json to align with APi amends. * Added missing constant. * Fixes following merge. * Fixed schedule mapping for invariant content. * Fixed display of publishing/pending changes on info workspace view. * Removed debug code. * fix: adds missing localization keys fixes #18297 * chore: eslint * fix: render only the selectAll checkbox when more than one language is present * feat: adds last edited date * feat: adds 'last published' date * fix: format input datetimes to datetime-local * fix: converts the datetime string to an ISO format before sending to the server this way we ensure the datetime contains the offset * chore: adds more types to ensure type safety * chore: use initialized boolean * fix: makes schedule modal options-based to isolate the `selection` to the actual values * docs: fix comment * docs: adds comment * fix: use helper function to update selection * revert commit to prevent breaking change * chore: eslint * Whitespace tidy-up * fix: stores a copy of the prevalues to be able to update that internally before finally setting the value from the updated internal values upon submit * chore: removes unused function * fix: unifies any pickable filters into one function --------- Co-authored-by: Niels Lyngsø <[email protected]> Co-authored-by: Jacob Overgaard <[email protected]> Co-authored-by: leekelleher <[email protected]>
1 parent 3b7a768 commit d1dc453

File tree

24 files changed

+227
-87
lines changed

24 files changed

+227
-87
lines changed

src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Asp.Versioning;
1+
using Asp.Versioning;
22
using Microsoft.AspNetCore.Authorization;
33
using Microsoft.AspNetCore.Http;
44
using Microsoft.AspNetCore.Mvc;

src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyPublishedDocumentController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Asp.Versioning;
1+
using Asp.Versioning;
22
using Microsoft.AspNetCore.Authorization;
33
using Microsoft.AspNetCore.Http;
44
using Microsoft.AspNetCore.Mvc;
@@ -53,6 +53,7 @@ public async Task<IActionResult> ByKeyPublished(CancellationToken cancellationTo
5353
}
5454

5555
PublishedDocumentResponseModel model = await _documentPresentationFactory.CreatePublishedResponseModelAsync(content);
56+
5657
return Ok(model);
5758
}
5859
}

src/Umbraco.Cms.Api.Management/Factories/DocumentPresentationFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Umbraco.Cms.Api.Management.Mapping.Content;
1+
using Umbraco.Cms.Api.Management.Mapping.Content;
22
using Umbraco.Cms.Api.Management.ViewModels;
33
using Umbraco.Cms.Api.Management.ViewModels.Document;
44
using Umbraco.Cms.Api.Management.ViewModels.Document.Item;

src/Umbraco.Cms.Api.Management/Factories/IDocumentPresentationFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Extensions.DependencyInjection;
1+
using Microsoft.Extensions.DependencyInjection;
22
using Umbraco.Cms.Api.Management.ViewModels.Document;
33
using Umbraco.Cms.Api.Management.ViewModels.Document.Item;
44
using Umbraco.Cms.Api.Management.ViewModels.DocumentBlueprint.Item;

src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Umbraco.Cms.Api.Management.Mapping.Content;
1+
using Umbraco.Cms.Api.Management.Mapping.Content;
22
using Umbraco.Cms.Api.Management.ViewModels.Document;
33
using Umbraco.Cms.Api.Management.ViewModels.Document.Collection;
44
using Umbraco.Cms.Api.Management.ViewModels.DocumentBlueprint;
@@ -119,7 +119,10 @@ private void Map(ContentScheduleCollection source, DocumentResponseModel target,
119119
{
120120
foreach (ContentSchedule schedule in source.FullSchedule)
121121
{
122-
DocumentVariantResponseModel? variant = target.Variants.FirstOrDefault(v => v.Culture == schedule.Culture || (v.Culture.IsNullOrWhiteSpace() && schedule.Culture.IsNullOrWhiteSpace()));
122+
DocumentVariantResponseModel? variant = target.Variants
123+
.FirstOrDefault(v =>
124+
v.Culture == schedule.Culture ||
125+
(IsInvariant(v.Culture) && IsInvariant(schedule.Culture)));
123126
if (variant is null)
124127
{
125128
continue;
@@ -136,4 +139,6 @@ private void Map(ContentScheduleCollection source, DocumentResponseModel target,
136139
}
137140
}
138141
}
142+
143+
private static bool IsInvariant(string? culture) => culture.IsNullOrWhiteSpace() || culture == Core.Constants.System.InvariantCulture;
139144
}

src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentVariantResponseModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Umbraco.Cms.Api.Management.ViewModels.Content;
1+
using Umbraco.Cms.Api.Management.ViewModels.Content;
22

33
namespace Umbraco.Cms.Api.Management.ViewModels.Document;
44

src/Umbraco.Web.UI.Client/src/assets/lang/da-dk.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -911,21 +911,22 @@ export default {
911911
videos: 'Videoer',
912912
avatar: 'Avatar til',
913913
header: 'Overskrift',
914+
selectAll: 'Vælg alle',
914915
systemField: 'system felt',
915916
readOnly: 'Skrivebeskyttet',
916917
restore: 'Genskab',
917-
generic: 'Generic',
918+
generic: 'Generisk',
918919
media: 'Media',
919-
nodeName: 'Node Name',
920-
revert: 'Revert',
920+
nodeName: 'Node navn',
921+
revert: 'Fortryd',
921922
umbracoInfo: 'Umbraco info',
922-
shared: 'Shared',
923-
success: 'Success',
924-
typeName: 'Type Name',
925-
validate: 'Validate',
926-
lastUpdated: 'Last Updated',
927-
skipToMenu: 'Skip to menu',
928-
skipToContent: 'Skip to content',
923+
shared: 'Delt',
924+
success: 'Succes',
925+
typeName: 'Type navn',
926+
validate: 'Valider',
927+
lastUpdated: 'Sidst opdateret',
928+
skipToMenu: 'Spring til menu',
929+
skipToContent: 'Spring til indhold',
929930
newVersionAvailable: 'Ny version tilgængelig',
930931
},
931932
colors: {

src/Umbraco.Web.UI.Client/src/assets/lang/en.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export default {
234234
createDateDesc: 'Date/time this document was created',
235235
documentType: 'Document Type',
236236
editing: 'Editing',
237-
expireDate: 'Remove at',
237+
expireDate: 'Remove At',
238238
itemChanged: 'This item has been changed after publication',
239239
itemNotPublished: 'This item is not published',
240240
lastPublished: 'Last published',
@@ -269,8 +269,8 @@ export default {
269269
publishDescendantsWithVariantsHelp:
270270
'Publish variants and variants of same type underneath and thereby making their content publicly available.',
271271
noVariantsToProcess: 'There are no available variants',
272-
releaseDate: 'Publish at',
273-
unpublishDate: 'Unpublish at',
272+
releaseDate: 'Publish At',
273+
unpublishDate: 'Unpublish At',
274274
removeDate: 'Clear Date',
275275
setDate: 'Set date',
276276
sortDone: 'Sortorder is updated',
@@ -952,8 +952,10 @@ export default {
952952
header: 'Header',
953953
systemField: 'system field',
954954
lastUpdated: 'Last Updated',
955+
selectAll: 'Select all',
955956
skipToMenu: 'Skip to menu',
956957
skipToContent: 'Skip to content',
958+
readOnly: 'Read-only',
957959
restore: 'Restore',
958960
primary: 'Primary',
959961
change: 'Change',
@@ -976,7 +978,6 @@ export default {
976978
addChild: 'Add child',
977979
editDataType: 'Edit data type',
978980
navigateSections: 'Navigate sections',
979-
selectAll: 'Select all',
980981
shortcut: 'Shortcuts',
981982
showShortcuts: 'show shortcuts',
982983
toggleListView: 'Toggle list view',

src/Umbraco.Web.UI.Client/src/libs/observable-api/utils/append-to-frozen-array.function.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* @function appendToFrozenArray
3-
* @param {Array<T>} source - An Array which is frozen and should be updated.
4-
* @param data
3+
* @param {Array<T>} data - An Array which is frozen and should be updated.
54
* @param {T} entry - A new entry to append to the array.
65
* @param {(entry: T) => unknown} getUniqueMethod - Method to retrieve a value of an entry that is unique to it. This enables the method to replace existing value if it matches the unique value.
76
* @returns {Array<T>} - Returns a new array with the new entry appended.

src/Umbraco.Web.UI.Client/src/packages/core/workspace/conditions/const.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
export const UMB_WORKSPACE_HAS_COLLECTION_CONDITION_ALIAS = 'Umb.Condition.WorkspaceHasCollection';
55

66
/**
7-
* [Deperecated] Workspace has collection condition alias
7+
* [Deprecated] Workspace has collection condition alias
88
* @deprecated Use {UMB_WORKSPACE_HAS_COLLECTION_CONDITION_ALIAS} instead. This will be removed in Umbraco 16.
99
*/
1010
export const UMB_WORKSPACE_HAS_COLLECTION_CONDITION = UMB_WORKSPACE_HAS_COLLECTION_CONDITION_ALIAS;
@@ -15,7 +15,7 @@ export const UMB_WORKSPACE_HAS_COLLECTION_CONDITION = UMB_WORKSPACE_HAS_COLLECTI
1515
export const UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS = 'Umb.Condition.WorkspaceEntityIsNew';
1616

1717
/**
18-
* [Deperecated] Workspace entity is new condition alias
18+
* [Deprecated] Workspace entity is new condition alias
1919
* @deprecated Use {UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS} instead. This will be removed in Umbraco 16.
2020
*/
2121
export const UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION = UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS;

0 commit comments

Comments
 (0)