From 45e2d93395a59ab722f64b744c7ab9440a939dac Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 14 Nov 2023 18:46:31 +0100 Subject: [PATCH] feat: revert as on main Signed-off-by: David Dal Busco --- src/declarations/satellite/satellite.did.d.ts | 2 -- .../satellite/satellite.factory.did.js | 2 -- .../satellite/satellite.factory.did.mjs | 2 -- src/frontend/src/lib/api/satellites.api.ts | 7 ++---- .../collections/CollectionEdit.svelte | 22 +------------------ src/frontend/src/lib/i18n/en.json | 3 +-- src/frontend/src/lib/i18n/it.json | 3 +-- src/frontend/src/lib/i18n/zh-cn.json | 3 +-- src/frontend/src/lib/types/i18n.d.ts | 1 - src/satellite/satellite.did | 2 -- src/satellite/src/db/store.rs | 19 +++------------- src/satellite/src/db/utils.rs | 8 +------ src/satellite/src/impls.rs | 2 -- src/satellite/src/rules/assert_stores.rs | 10 --------- src/satellite/src/rules/constants.rs | 2 -- src/satellite/src/rules/store.rs | 1 - src/satellite/src/rules/types.rs | 5 +---- src/satellite/src/storage/store.rs | 18 +++------------ src/satellite/src/storage/utils.rs | 8 +------ src/shared/src/serializers.rs | 4 ---- 20 files changed, 15 insertions(+), 109 deletions(-) diff --git a/src/declarations/satellite/satellite.did.d.ts b/src/declarations/satellite/satellite.did.d.ts index 9c1e2160b..5b6aba629 100644 --- a/src/declarations/satellite/satellite.did.d.ts +++ b/src/declarations/satellite/satellite.did.d.ts @@ -122,7 +122,6 @@ export interface Rule { memory: [] | [Memory]; updated_at: bigint; max_size: [] | [bigint]; - allow_anonymous: [] | [boolean]; read: Permission; created_at: bigint; mutable_permissions: [] | [boolean]; @@ -147,7 +146,6 @@ export interface SetRule { memory: [] | [Memory]; updated_at: [] | [bigint]; max_size: [] | [bigint]; - allow_anonymous: [] | [boolean]; read: Permission; mutable_permissions: [] | [boolean]; write: Permission; diff --git a/src/declarations/satellite/satellite.factory.did.js b/src/declarations/satellite/satellite.factory.did.js index 2729f347f..c74c5dfae 100644 --- a/src/declarations/satellite/satellite.factory.did.js +++ b/src/declarations/satellite/satellite.factory.did.js @@ -149,7 +149,6 @@ export const idlFactory = ({ IDL }) => { memory: IDL.Opt(Memory), updated_at: IDL.Nat64, max_size: IDL.Opt(IDL.Nat), - allow_anonymous: IDL.Opt(IDL.Bool), read: Permission, created_at: IDL.Nat64, mutable_permissions: IDL.Opt(IDL.Bool), @@ -173,7 +172,6 @@ export const idlFactory = ({ IDL }) => { memory: IDL.Opt(Memory), updated_at: IDL.Opt(IDL.Nat64), max_size: IDL.Opt(IDL.Nat), - allow_anonymous: IDL.Opt(IDL.Bool), read: Permission, mutable_permissions: IDL.Opt(IDL.Bool), write: Permission diff --git a/src/declarations/satellite/satellite.factory.did.mjs b/src/declarations/satellite/satellite.factory.did.mjs index 2729f347f..c74c5dfae 100644 --- a/src/declarations/satellite/satellite.factory.did.mjs +++ b/src/declarations/satellite/satellite.factory.did.mjs @@ -149,7 +149,6 @@ export const idlFactory = ({ IDL }) => { memory: IDL.Opt(Memory), updated_at: IDL.Nat64, max_size: IDL.Opt(IDL.Nat), - allow_anonymous: IDL.Opt(IDL.Bool), read: Permission, created_at: IDL.Nat64, mutable_permissions: IDL.Opt(IDL.Bool), @@ -173,7 +172,6 @@ export const idlFactory = ({ IDL }) => { memory: IDL.Opt(Memory), updated_at: IDL.Opt(IDL.Nat64), max_size: IDL.Opt(IDL.Nat), - allow_anonymous: IDL.Opt(IDL.Bool), read: Permission, mutable_permissions: IDL.Opt(IDL.Bool), write: Permission diff --git a/src/frontend/src/lib/api/satellites.api.ts b/src/frontend/src/lib/api/satellites.api.ts index 4f48fa0f9..087a2b73d 100644 --- a/src/frontend/src/lib/api/satellites.api.ts +++ b/src/frontend/src/lib/api/satellites.api.ts @@ -64,8 +64,7 @@ export const setRule = async ({ memory, rule, maxSize, - mutablePermissions, - allowAnonymous + mutablePermissions }: { satelliteId: Principal; collection: string; @@ -76,7 +75,6 @@ export const setRule = async ({ rule: Rule | undefined; maxSize: number | undefined; mutablePermissions: boolean; - allowAnonymous: boolean; }) => { const updateRule: SetRule = { read: permissionFromText(read), @@ -84,8 +82,7 @@ export const setRule = async ({ updated_at: isNullish(rule) ? [] : [rule.updated_at], max_size: toNullable(nonNullish(maxSize) && maxSize > 0 ? BigInt(maxSize) : undefined), memory: isNullish(rule) ? [memoryFromText(memory)] : [fromNullable(rule.memory) ?? MemoryHeap], - mutable_permissions: toNullable(mutablePermissions), - allow_anonymous: toNullable(allowAnonymous) + mutable_permissions: toNullable(mutablePermissions) }; const actor = await getSatelliteActor(satelliteId); diff --git a/src/frontend/src/lib/components/collections/CollectionEdit.svelte b/src/frontend/src/lib/components/collections/CollectionEdit.svelte index ea9ae3076..f4e5ec0a3 100644 --- a/src/frontend/src/lib/components/collections/CollectionEdit.svelte +++ b/src/frontend/src/lib/components/collections/CollectionEdit.svelte @@ -53,14 +53,6 @@ }; $: initMutable($store.rule?.[1] ?? undefined); - let currentAllowAnonymous: boolean; - let allowAnonymous: boolean; - const initAllowAnonymous = (initialRule: Rule | undefined) => { - currentAllowAnonymous = fromNullable(initialRule?.allow_anonymous ?? []) ?? false; - allowAnonymous = currentAllowAnonymous; - }; - $: initAllowAnonymous($store.rule?.[1] ?? undefined); - let maxSize: number | undefined; const initMaxLength = (size: [] | [bigint]) => { const tmp = fromNullable(size); @@ -86,8 +78,7 @@ type, rule, maxSize, - mutablePermissions: !immutable, - allowAnonymous + mutablePermissions: !immutable }); toasts.success( @@ -190,17 +181,6 @@ {/if} -
- -
- {#if !currentImmutable}