Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure collection replay is fully reload (cache cleared) when: #2176

Merged
merged 5 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion backend/btrixcloud/storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _create_s3_storage(self, storage: dict[str, str]) -> S3Storage:
use_access_for_presign = False
else:
access_endpoint_url = storage.get("access_endpoint_url") or endpoint_url
use_access_for_presign = True
use_access_for_presign = is_bool(storage.get("use_access_for_presign"))

return S3Storage(
access_key=storage["access_key"],
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/features/collections/collection-items-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ export class CollectionItemsDialog extends BtrixElement {
let selectionMessage = msg("No changes to save");

if (hasChange) {
const messages = [];
const messages: string[] = [];
if (addCount) {
messages.push(
msg(
Expand All @@ -564,7 +564,9 @@ export class CollectionItemsDialog extends BtrixElement {
}
if (removeCount) {
messages.push(
str`Adding ${formatNumber(removeCount)} ${pluralOf("items", removeCount)}`,
msg(
str`Removing ${formatNumber(removeCount)} ${pluralOf("items", removeCount)}`,
),
);
}

Expand Down
20 changes: 19 additions & 1 deletion frontend/src/pages/org/collection-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export class CollectionDetail extends BtrixElement {
@query(".descriptionExpandBtn")
private readonly descriptionExpandBtn?: HTMLElement | null;

@query("replay-web-page")
private readonly replayEmbed?: HTMLElement | null;

// Use to cancel requests
private getArchivedItemsController: AbortController | null = null;

Expand Down Expand Up @@ -204,6 +207,7 @@ export class CollectionDetail extends BtrixElement {
?open=${this.openDialogName === "editItems"}
@sl-hide=${() => (this.openDialogName = undefined)}
@btrix-collection-saved=${() => {
this.refreshReplay();
void this.fetchCollection();
void this.fetchArchivedItems();
}}
Expand All @@ -216,14 +220,28 @@ export class CollectionDetail extends BtrixElement {
.collection=${this.collection!}
?open=${this.openDialogName === "editMetadata"}
@sl-hide=${() => (this.openDialogName = undefined)}
@btrix-collection-saved=${() => void this.fetchCollection()}
@btrix-collection-saved=${() => {
this.refreshReplay();
void this.fetchCollection();
}}
>
</btrix-collection-metadata-dialog>
`,
)}
${this.renderShareDialog()}`;
}

private refreshReplay() {
if (this.replayEmbed) {
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(this.replayEmbed as any).fullReload();
} catch (e) {
console.warn("Full reload not available in RWP");
}
}
}

private getPublicReplayURL() {
return new URL(
`/api/orgs/${this.orgId}/collections/${this.collectionId}/public/replay.json`,
Expand Down
3 changes: 3 additions & 0 deletions frontend/xliff/es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3780,6 +3780,9 @@
<x equiv-text="&lt;a class=&quot;text-neutral-500 underline hover:text-primary&quot; href=&quot;/docs/user-guide/org-settings/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;" id="0"/>org settings<x equiv-text="&lt;/a&gt;" id="1"/>
for details.</source>
</trans-unit>
<trans-unit id="s582e36ff4a424786">
<source>Removing <x equiv-text="${formatNumber(removeCount)} ${pluralOf(&quot;items&quot;, removeCount)}" id="0"/></source>
</trans-unit>
</body>
</file>
</xliff>
Loading