Skip to content

Commit

Permalink
satellite/admin/ui: Add deprecation hints
Browse files Browse the repository at this point in the history
Add a deprecation hint to all those operations that must be done with
the new internal satellited admin instead of this one.

Change-Id: I663cb2ef6ff06572c9e1366b5b3df66bd599afc8
  • Loading branch information
ifraixedes authored and Storj Robot committed Mar 20, 2024
1 parent d62e81b commit bf817ec
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
11 changes: 9 additions & 2 deletions satellite/admin/ui/src/lib/Api.svelte
Expand Up @@ -49,7 +49,10 @@ wants to perform.
/>
<button on:click={confirmAuthToken}>confirm</button>
</p>

<p>
The below options prefixed with <b>"DEPRECATED:"</b> must be performed in our new internal satellite
admin
</p>
<p>
Operation:
<select
Expand All @@ -70,7 +73,11 @@ wants to perform.
<select bind:value={selectedOp}>
<option selected />
{#each selectedGroupOp as op (op)}
<option value={op}>{op.name}</option>
{#if op.deprecated}
<option value={op}>DEPRECATED: {op.name}</option>
{:else}
<option value={op}>{op.name}</option>
{/if}
{/each}
</select>
{/if}
Expand Down
42 changes: 28 additions & 14 deletions satellite/admin/ui/src/lib/api.ts
Expand Up @@ -48,7 +48,8 @@ export class Admin {
],
func: async (projectId: string, bucketName: string): Promise<Record<string, unknown>> => {
return this.fetch('GET', `projects/${projectId}/buckets/${bucketName}`);
}
},
deprecated: true
},
{
name: 'delete geofencing',
Expand All @@ -62,7 +63,8 @@ export class Admin {
'DELETE',
`projects/${projectId}/buckets/${bucketName}/geofence`
) as Promise<null>;
}
},
deprecated: true
},
{
name: 'set geofencing',
Expand Down Expand Up @@ -92,7 +94,8 @@ export class Admin {
`projects/${projectId}/buckets/${bucketName}/geofence`,
query
) as Promise<null>;
}
},
deprecated: true
}
],
oauth_clients: [
Expand Down Expand Up @@ -183,7 +186,8 @@ export class Admin {
params: [['Project ID', new InputText('text', true)]],
func: async (projectId: string): Promise<Record<string, unknown>> => {
return this.fetch('GET', `projects/${projectId}`);
}
},
deprecated: true
},
{
name: 'update',
Expand All @@ -202,7 +206,8 @@ export class Admin {
projectName,
description
}) as Promise<null>;
}
},
deprecated: true
},
{
name: 'update user agent',
Expand All @@ -215,7 +220,8 @@ export class Admin {
return this.fetch('PATCH', `projects/${projectId}/useragent`, null, {
userAgent
}) as Promise<null>;
}
},
deprecated: true
},
{
name: 'create API key',
Expand Down Expand Up @@ -266,7 +272,8 @@ export class Admin {
params: [['Project ID', new InputText('text', true)]],
func: async (projectId: string): Promise<Record<string, unknown>> => {
return this.fetch('GET', `projects/${projectId}/limit`);
}
},
deprecated: true
},
{
name: 'update project limits',
Expand Down Expand Up @@ -310,7 +317,8 @@ export class Admin {
}

return this.fetch('PUT', `projects/${projectId}/limit`, query) as Promise<null>;
}
},
deprecated: true
}
],
user: [
Expand Down Expand Up @@ -348,7 +356,8 @@ export class Admin {
params: [['email', new InputText('email', true)]],
func: async (email: string): Promise<Record<string, unknown>> => {
return this.fetch('GET', `users/${email}`);
}
},
deprecated: true
},
{
name: 'get users pending deletion',
Expand All @@ -367,7 +376,8 @@ export class Admin {
params: [['email', new InputText('email', true)]],
func: async (email: string): Promise<Record<string, unknown>> => {
return this.fetch('GET', `users/${email}/limits`);
}
},
deprecated: true
},
{
name: 'update',
Expand Down Expand Up @@ -415,7 +425,8 @@ Blank fields will not be updated.`,
projectSegmentLimit,
paidTierStr
}) as Promise<null>;
}
},
deprecated: true
},
{
name: "update user's project limits",
Expand Down Expand Up @@ -457,7 +468,8 @@ Blank fields will not be updated.`,
return this.fetch('PATCH', `users/${currentEmail}/useragent`, null, {
userAgent
}) as Promise<null>;
}
},
deprecated: true
},
{
name: 'activate account/disable bot restriction',
Expand Down Expand Up @@ -570,15 +582,17 @@ Blank fields will not be updated.`,
return this.fetch('PATCH', `users/${email}/geofence`, null, {
region
}) as Promise<null>;
}
},
deprecated: true
},
{
name: 'delete geofencing',
desc: 'Delete account level geofence for a user',
params: [['email', new InputText('email', true)]],
func: async (email: string): Promise<null> => {
return this.fetch('DELETE', `users/${email}/geofence`) as Promise<null>;
}
},
deprecated: true
},
{
name: 'update free trial expiration',
Expand Down
3 changes: 3 additions & 0 deletions satellite/admin/ui/src/lib/ui-generator.ts
Expand Up @@ -27,6 +27,9 @@ export interface Operation {
// null is used when the API operation doesn't return any payload (e.g. PUT
// operations).
func: (...p: unknown[]) => Promise<Record<string, unknown> | null>;
// deprecated indicates that this operation should be executed through our new
// internal satellite admin.
deprecated: boolean;
}

export type ParamUI = InputText | Select | Textarea;
Expand Down

0 comments on commit bf817ec

Please sign in to comment.