feat(web): add public package browsing and organization redirect management
This commit is contained in:
@@ -19,6 +19,7 @@ export class SgViewOrganizations extends DeesElement {
|
||||
currentOrg: null,
|
||||
repositories: [],
|
||||
members: [],
|
||||
redirects: [],
|
||||
};
|
||||
|
||||
@state()
|
||||
@@ -72,6 +73,10 @@ export class SgViewOrganizations extends DeesElement {
|
||||
appstate.fetchMembersAction,
|
||||
{ organizationId: orgId },
|
||||
);
|
||||
await appstate.organizationsStatePart.dispatchAction(
|
||||
appstate.fetchRedirectsAction,
|
||||
{ organizationId: orgId },
|
||||
);
|
||||
}
|
||||
|
||||
public render(): TemplateResult {
|
||||
@@ -81,11 +86,13 @@ export class SgViewOrganizations extends DeesElement {
|
||||
.organization="${this.organizationsState.currentOrg}"
|
||||
.repositories="${this.organizationsState.repositories}"
|
||||
.members="${this.organizationsState.members}"
|
||||
.redirects="${this.organizationsState.redirects}"
|
||||
@back="${() => this.goBack()}"
|
||||
@select-repo="${(e: CustomEvent) => this.selectRepo(e.detail.repositoryId)}"
|
||||
@create-repo="${() => {/* TODO: create repo modal */}}"
|
||||
@edit="${(e: CustomEvent) => this.handleEditOrg(e.detail)}"
|
||||
@delete="${(e: CustomEvent) => this.handleDeleteOrg(e.detail.organizationId)}"
|
||||
@delete-redirect="${(e: CustomEvent) => this.handleDeleteRedirect(e.detail.redirectId)}"
|
||||
></sg-organization-detail-view>
|
||||
`;
|
||||
}
|
||||
@@ -116,11 +123,21 @@ export class SgViewOrganizations extends DeesElement {
|
||||
currentOrg: null,
|
||||
repositories: [],
|
||||
members: [],
|
||||
redirects: [],
|
||||
});
|
||||
}
|
||||
|
||||
private async handleDeleteRedirect(redirectId: string) {
|
||||
if (!this.detailOrgId) return;
|
||||
await appstate.organizationsStatePart.dispatchAction(
|
||||
appstate.deleteRedirectAction,
|
||||
{ redirectId, organizationId: this.detailOrgId },
|
||||
);
|
||||
}
|
||||
|
||||
private async handleEditOrg(data: {
|
||||
organizationId: string;
|
||||
name?: string;
|
||||
displayName?: string;
|
||||
description?: string;
|
||||
website?: string;
|
||||
|
||||
Reference in New Issue
Block a user