Skip to content

Commit ae73cef

Browse files
Melpocode4candy
authored andcommitted
fix(publish): address review nits
Signed-off-by: Melpo <melpomene@posteo.net> Assisted-by: ClaudeCode:claude-opus-5-5
1 parent 10d8c83 commit ae73cef

6 files changed

Lines changed: 25 additions & 10 deletions

File tree

‎lib/Controller/StaticSiteGeneratorController.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function health(): DataResponse {
6666
*
6767
* @param string $staticSiteId ID of the static site
6868
* @param string $status New status ("published" or "failed")
69-
* @param array{publish_url?: non-empty-string, error_message?: string} $data Status-specific result payload, `publish_url` is required for status "published": an http(s) URL of at most 255 characters, otherwise the publication is stored as failed
69+
* @param array{publish_url?: string, error_message?: string} $data Status-specific result payload, `publish_url` is required for status "published": an http(s) URL of at most 255 characters, otherwise the publication is stored as failed
7070
*
7171
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
7272
* @throws OCSBadRequestException Invalid or missing status

‎lib/Service/StaticSiteService.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class StaticSiteService {
2929
private const TITLE_MAX_LENGTH = 255;
3030
private const SLUG_MAX_LENGTH = 64;
3131
private const SLUG_PATTERN = '/^[a-z0-9]+(-[a-z0-9]+)*$/';
32+
// Length of the published_url column
3233
private const PUBLISHED_URL_MAX_LENGTH = 255;
3334
private const LARGEST_FILES_IN_MESSAGE = 3;
3435
private const ALLOWED_CALLBACK_STATUSES = [

‎openapi-full.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4567,8 +4567,7 @@
45674567
"description": "Status-specific result payload, `publish_url` is required for status \"published\": an http(s) URL of at most 255 characters, otherwise the publication is stored as failed",
45684568
"properties": {
45694569
"publish_url": {
4570-
"type": "string",
4571-
"minLength": 1
4570+
"type": "string"
45724571
},
45734572
"error_message": {
45744573
"type": "string"

‎openapi.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4567,8 +4567,7 @@
45674567
"description": "Status-specific result payload, `publish_url` is required for status \"published\": an http(s) URL of at most 255 characters, otherwise the publication is stored as failed",
45684568
"properties": {
45694569
"publish_url": {
4570-
"type": "string",
4571-
"minLength": 1
4570+
"type": "string"
45724571
},
45734572
"error_message": {
45744573
"type": "string"

‎playwright/e2e/collective-publish.spec.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ test.describe('Collective publish', () => {
481481
await expect(previouslyPublished).toContainText('Publishing failed')
482482
await expect(previouslyPublished).toContainText('The publish service is currently not available. Please try again later.')
483483
await expect(previouslyPublished).toContainText('The previous version is still online.')
484-
await expect(previouslyPublished).toContainText('Last published')
484+
// Relative time in the text, the exact time in the tooltip
485+
await expect(previouslyPublished.getByText('Last published 2 hours ago')).toHaveAttribute('title', /\d/)
485486

486487
await expect(neverPublished).toContainText('The publish service could not build the website. Please contact your administrator.')
487488
await expect(neverPublished).not.toContainText('The previous version is still online.')

‎src/components/Nav/CollectivePublishModal.vue‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
</button>
4343
<a
4444
v-if="staticSite.publishedUrl"
45+
class="modal-publish__site-url"
4546
:href="staticSite.publishedUrl"
4647
target="_blank"
4748
rel="noopener noreferrer">{{ staticSite.publishedUrl }}</a>
@@ -51,8 +52,11 @@
5152
{{ t('collectives', 'The previous version is still online.') }}
5253
</template>
5354
</p>
54-
<span v-if="staticSite.publishedAt" class="modal-publish__site-published-at">
55-
{{ t('collectives', 'Last published {date}', { date: formatTimestamp(staticSite.publishedAt) }) }}
55+
<span
56+
v-if="staticSite.publishedAt"
57+
class="modal-publish__site-published-at"
58+
:title="formatAbsoluteTime(staticSite.publishedAt)">
59+
{{ t('collectives', 'Last published {time}', { time: formatRelativeTime(staticSite.publishedAt) }) }}
5660
</span>
5761
</li>
5862
</ul>
@@ -278,7 +282,11 @@ export default {
278282
t,
279283
staticSiteErrorMessage,
280284
281-
formatTimestamp(timestamp) {
285+
formatRelativeTime(timestamp) {
286+
return moment.unix(timestamp).fromNow()
287+
},
288+
289+
formatAbsoluteTime(timestamp) {
282290
return moment.unix(timestamp).format('LLL')
283291
},
284292
@@ -483,13 +491,16 @@ export default {
483491
padding: 4px 8px;
484492
border: 2px solid var(--color-border);
485493
border-radius: var(--border-radius-large);
486-
word-break: break-all;
487494
488495
&--selected {
489496
border-color: var(--color-primary-element);
490497
}
491498
}
492499
500+
&__site-url {
501+
word-break: break-all;
502+
}
503+
493504
&__site-error {
494505
color: var(--color-error-text);
495506
}
@@ -513,6 +524,10 @@ export default {
513524
text-align: start;
514525
cursor: pointer;
515526
527+
&:disabled {
528+
cursor: default;
529+
}
530+
516531
span {
517532
color: var(--color-text-maxcontrast);
518533
}

0 commit comments

Comments
 (0)