Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ public class ContentPublishInfoJson

private final Instant first;

private final Instant published;
private final Instant time;

public ContentPublishInfoJson( final ContentPublishInfo publishInfo )
{
this.from = publishInfo.from();
this.to = publishInfo.to();
this.first = publishInfo.first();
this.published = publishInfo.time();
this.time = publishInfo.time();
}

@SuppressWarnings("unused")
Expand All @@ -41,8 +41,8 @@ public Instant getFirst()
}

@SuppressWarnings("unused")
public Instant getPublished()
public Instant getTime()
{
return published;
return time;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ implements Cloneable {

private to: Date;

private time: Date;

private constructor(source?: ContentPublishInfo) {
if (source) {
this.first = source.getFirst() ? new Date(source.getFirst().getTime()) : null;
this.from = source.getFrom() ? new Date(source.getFrom().getTime()) : null;
this.to = source.getTo() ? new Date(source.getTo().getTime()) : null;
this.time = source.getTime() ? new Date(source.getTime().getTime()) : null;
}
}

Expand All @@ -32,6 +35,7 @@ implements Cloneable {
contentPublishInfo.first = contentPublishInfoJson.first ? new Date(contentPublishInfoJson.first) : null;
contentPublishInfo.from = contentPublishInfoJson.from ? new Date(contentPublishInfoJson.from) : null;
contentPublishInfo.to = contentPublishInfoJson.to ? new Date(contentPublishInfoJson.to) : null;
contentPublishInfo.time = contentPublishInfoJson.time ? new Date(contentPublishInfoJson.time) : null;

return contentPublishInfo;
}
Expand All @@ -48,6 +52,10 @@ implements Cloneable {
return this.to;
}

getTime(): Date {
return this.time;
}

setFrom(date: Date) {
return this.from = date;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export class ContentSummary {

private readonly publishToTime: Date;

private readonly publishTime: Date;

private readonly deletable: boolean;

private readonly editable: boolean;
Expand Down Expand Up @@ -109,6 +111,7 @@ export class ContentSummary {
this.publishFromTime = builder.publishFromTime;
this.publishToTime = builder.publishToTime;
this.publishFirstTime = builder.publishFirstTime;
this.publishTime = builder.publishTime;
this.deletable = builder.deletable;
this.editable = builder.editable;
this.childOrder = builder.childOrder;
Expand Down Expand Up @@ -279,6 +282,10 @@ export class ContentSummary {
return this.publishToTime;
}

getPublishTime(): Date {
return this.publishTime;
}

isDeletable(): boolean {
return this.deletable;
}
Expand Down Expand Up @@ -434,6 +441,8 @@ export class ContentSummaryBuilder {

publishToTime: Date;

publishTime: Date;

deletable: boolean;

editable: boolean;
Expand Down Expand Up @@ -483,6 +492,7 @@ export class ContentSummaryBuilder {
this.publishFromTime = source.getPublishFromTime();
this.publishToTime = source.getPublishToTime();
this.publishFirstTime = source.getPublishFirstTime();
this.publishTime = source.getPublishTime();
this.deletable = source.isDeletable();
this.editable = source.isEditable();
this.childOrder = source.getChildOrder();
Expand Down Expand Up @@ -547,6 +557,10 @@ export class ContentSummaryBuilder {
json.publish && json.publish.to
? new Date(Date.parse(json.publish.to))
: null;
this.publishTime =
json.publish && json.publish.time
? new Date(Date.parse(json.publish.time))
: null;

this.deletable = json.deletable;
this.editable = json.editable;
Expand Down Expand Up @@ -648,6 +662,11 @@ export class ContentSummaryBuilder {
return this;
}

setPublishTime(value: Date): ContentSummaryBuilder {
this.publishTime = value;
return this;
}

setWorkflow(value: Workflow): ContentSummaryBuilder {
this.workflow = value;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ export interface ContentPublishInfoJson {

to: string;

time: string;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export interface ContentPublishTimeRangeJson {
from: string;
to: string;
first: string;
time: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ export const ContentLabel = ({
const isCompact = variant === 'compact';
const showFullPath = variant === 'compact' || variant === 'detailed';

const status = hideStatus ? null : calcContentState(content.getContentSummary());
const summary = content.getContentSummary();
const statusHidden = hideStatus || !!summary.getPublishTime();
const status = statusHidden ? null : calcContentState(summary);
const Icon = (
<WorkflowContentIcon
status={status}
contentType={content.getType().toString()}
url={content.getContentSummary().getIconUrl()}
url={summary.getIconUrl()}
/>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export const MediaSelectorItemView = ({content, hideStatus = false}: MediaSelect
const contentId = content.getId();
const displayName = content.getDisplayName() || content.getType()?.getLocalName();
const subName = content.getPath() ? content.getPath().toString() : '';
const status = hideStatus ? null : calcContentState(content.getContentSummary());
const summary = content.getContentSummary();
const statusHidden = hideStatus || !!summary.getPublishTime();
const status = statusHidden ? null : calcContentState(summary);

if (isRemoved) {
return (
Expand All @@ -51,7 +53,7 @@ export const MediaSelectorItemView = ({content, hideStatus = false}: MediaSelect
<WorkflowContentIcon
status={status}
contentType={content.getType().toString()}
url={content.getContentSummary().getIconUrl()}
url={summary.getIconUrl()}
/>
</div>
<div className="min-w-0 w-full">
Expand Down
Loading