Skip to content

Commit

Permalink
Merge pull request #4365 from alkem-io/develop
Browse files Browse the repository at this point in the history
Release: Account, LatestContributions, Fixes
  • Loading branch information
valentinyanakiev authored Aug 6, 2024
2 parents 264924a + 47daf99 commit 4266f52
Show file tree
Hide file tree
Showing 127 changed files with 2,145 additions and 1,666 deletions.
1 change: 0 additions & 1 deletion .build/ory/kratos/kratos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ selfservice:
- hook: require_verified_address

registration:
enable_legacy_one_step: true
lifespan: 10m
ui_url: http://localhost:3000/registration
after:
Expand Down
1 change: 1 addition & 0 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SYNAPSE_SHARED_SECRET=n#P.uIl8IDOYPR-fiLzDoFw9ZPvTIlYg7*F9*~eaDZFK#;.KRg
SYNAPSE_ENABLE_REGISTRATION=true
SYNAPSE_NO_TLS=true
SYNAPSE_SERVER_URL=http://synapse:8008
[email protected]


POSTGRES_USER=synapse
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alkemio-server",
"version": "0.84.10",
"version": "0.86.0",
"description": "Alkemio server, responsible for managing the shared Alkemio platform",
"author": "Alkemio Foundation",
"private": false,
Expand Down
8 changes: 8 additions & 0 deletions quickstart-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ services:
hostname: notifications
image: alkemio/notifications:v0.19.0
platform: linux/x86_64
depends_on:
- rabbitmq
environment:
- RABBITMQ_HOST
- RABBITMQ_USER
Expand Down Expand Up @@ -236,6 +238,8 @@ services:
hostname: matrix-adapter
image: alkemio/matrix-adapter:v0.4.5
platform: linux/x86_64
depends_on:
- rabbitmq
environment:
- RABBITMQ_HOST
- RABBITMQ_USER
Expand Down Expand Up @@ -274,6 +278,8 @@ services:
hostname: whiteboard-collaboration
image: alkemio/whiteboard-collaboration-service:v0.3.1
platform: linux/x86_64
depends_on:
- rabbitmq
environment:
- RABBITMQ_HOST
- RABBITMQ_USER
Expand All @@ -292,6 +298,8 @@ services:
hostname: file-service
image: alkemio/file-service:v0.1.2
platform: linux/x86_64
depends_on:
- rabbitmq
environment:
- RABBITMQ_HOST
- RABBITMQ_USER
Expand Down
2 changes: 2 additions & 0 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import { PlatformSettingsModule } from '@platform/settings/platform.settings.mod
import { FileIntegrationModule } from '@services/file-integration';
import { AdminLicensingModule } from '@platform/admin/licensing/admin.licensing.module';
import { PlatformRoleModule } from '@platform/platfrom.role/platform.role.module';
import { LookupByNameModule } from '@services/api/lookup-by-name';

@Module({
imports: [
Expand Down Expand Up @@ -263,6 +264,7 @@ import { PlatformRoleModule } from '@platform/platfrom.role/platform.role.module
ChatGuidanceModule,
VirtualContributorModule,
LookupModule,
LookupByNameModule,
AuthResetSubscriberModule,
TaskGraphqlModule,
ActivityFeedModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,3 @@ export const CREDENTIAL_RULE_CALENDAR_EVENT_CREATED_BY =
'credentialRule-calendarEventCreatedBy';
export const CREDENTIAL_RULE_DOCUMENT_CREATED_BY =
'credentialRule-documentCreatedBy';
export const CREDENTIAL_RULE_LIBRARY_INNOVATION_PACK_PROVIDER_ADMIN =
'credentialRule-libraryInnovationPackProvider';
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ export const CREDENTIAL_RULE_TYPES_PLATFORM_ACCESS_GUIDANCE =
'credentialRuleTypes-platformAccessGuidance';
export const CREDENTIAL_RULE_TYPES_PLATFORM_ACCESS_DASHBOARD =
'credentialRuleTypes-platformAccessDashboard';
export const CREDENTIAL_RULE_TYPES_LIBRARY_FILE_UPLOAD_ANY_USER =
'credentialRuleTypes-libraryFileUploadAnyUser';
export const CREDENTIAL_RULE_TYPES_PLATFORM_FILE_UPLOAD_ANY_USER =
'credentialRuleTypes-platformFileUploadAnyUser';
export const CREDENTIAL_RULE_TYPES_UPDATE_FORUM_DISCUSSION =
Expand Down
1 change: 1 addition & 0 deletions src/common/enums/alkemio.error.status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export enum AlkemioErrorStatus {
ENTITY_NOT_FOUND = 'ENTITY_NOT_FOUND',
FORMAT_NOT_SUPPORTED = 'FORMAT_NOT_SUPPORTED',
INVALID_TOKEN = 'INVALID_TOKEN',
INVALID_UUID = 'INVALID_UUID',
ACCOUNT_NOT_FOUND = 'ACCOUNT_NOT_FOUND',
INVALID_STATE_TRANSITION = 'INVALID_STATE_TRANSITION',
UNAUTHENTICATED = 'UNAUTHENTICATED',
Expand Down
3 changes: 0 additions & 3 deletions src/common/enums/authorization.credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export enum AuthorizationCredential {

USER_GROUP_MEMBER = 'user-group-member', // Able to be a part of an user group

// Library related credentials
INNOVATION_PACK_PROVIDER = 'innovation-pack-provider',

// Roles to allow easier management of users
BETA_TESTER = 'beta-tester',
VC_CAMPAIGN = 'vc-campaign',
Expand Down
16 changes: 16 additions & 0 deletions src/common/enums/space.reserved.name.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export enum SpaceReservedName {
USER = 'user',
ORGANIZATION = 'organization',
VIRTUAL_CONTRIBUTOR = 'vc',
ADMIN = 'admin',
INNOVATION_LIBRARY = 'innovation-library',
INNOVATION_PACKS = 'innovation-packs',
CREATE_SPACE = 'create-space',
HOME = 'home',
SPACES = 'spaces',
CONTRIBUTORS = 'contributors',
FORUM = 'forum',
ABOUT = 'about',
PROFILE = 'profile',
RESTRICTED = 'restricted',
}
9 changes: 9 additions & 0 deletions src/common/exceptions/invalid.uuid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { LogContext, AlkemioErrorStatus } from '@common/enums';
import { BaseException } from './base.exception';
import { ExceptionDetails } from './exception.details';

export class InvalidUUID extends BaseException {
constructor(error: string, context: LogContext, details?: ExceptionDetails) {
super(error, context, AlkemioErrorStatus.INVALID_UUID, details);
}
}
2 changes: 1 addition & 1 deletion src/common/interceptors/innovation.hub.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class InnovationHubInterceptor implements NestInterceptor {

try {
ctx[INNOVATION_HUB_INJECT_TOKEN] =
await this.innovationHubService.getInnovationHubOrFail({
await this.innovationHubService.getInnovationHubFlexOrFail({
subdomain: subDomain,
});
} catch (e) {
Expand Down
4 changes: 3 additions & 1 deletion src/common/utils/stringify.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export function stringifyWithoutAuthorizationMetaInfo(object: any): string {
key === 'version' ||
key === 'allowedTypes' ||
key === 'storageBucket' ||
key === 'visuals'
key === 'visuals' ||
key === 'issuer' ||
key === 'expires'
) {
return undefined;
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/bootstrap/bootstrap.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,18 @@ export class BootstrapService {
this.logger.verbose?.('...No account present...', LogContext.BOOTSTRAP);
this.logger.verbose?.('........creating...', LogContext.BOOTSTRAP);
// create a default host org
const hostOrganization = await this.organizationService.getOrganization(
let hostOrganization = await this.organizationService.getOrganization(
DEFAULT_HOST_ORG_NAMEID
);
if (!hostOrganization) {
const hostOrg = await this.organizationService.createOrganization({
hostOrganization = await this.organizationService.createOrganization({
nameID: DEFAULT_HOST_ORG_NAMEID,
profileData: {
displayName: DEFAULT_HOST_ORG_DISPLAY_NAME,
},
});
await this.organizationAuthorizationService.applyAuthorizationPolicy(
hostOrg
hostOrganization
);
}

Expand All @@ -291,7 +291,7 @@ export class BootstrapService {
level: SpaceLevel.SPACE,
type: SpaceType.SPACE,
},
hostID: DEFAULT_HOST_ORG_NAMEID,
hostID: hostOrganization.id,
};

let account = await this.accountService.createAccount(spaceInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import { InjectEntityManager } from '@nestjs/typeorm';
import { Account } from '@domain/space/account/account.entity';
import { createTypedRelationDataLoader } from '../../../utils';
import { DataLoaderCreator, DataLoaderCreatorOptions } from '../../base';
import { ILicense } from '@domain/license/license/license.interface';
import { IInnovationHub } from '@domain/innovation-hub/innovation.hub.interface';

@Injectable()
export class AccountLicenseLoaderCreator
implements DataLoaderCreator<ILicense[]>
export class AccountInnovationHubsLoaderCreator
implements DataLoaderCreator<IInnovationHub[]>
{
constructor(@InjectEntityManager() private manager: EntityManager) {}

create(options?: DataLoaderCreatorOptions<ILicense[]>) {
create(options?: DataLoaderCreatorOptions<IInnovationHub[]>) {
return createTypedRelationDataLoader(
this.manager,
Account,
{ license: true },
{ innovationHubs: true },
this.constructor.name,
options
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { EntityManager } from 'typeorm';
import { Injectable } from '@nestjs/common';
import { InjectEntityManager } from '@nestjs/typeorm';
import { Account } from '@domain/space/account/account.entity';
import { createTypedRelationDataLoader } from '../../../utils';
import { DataLoaderCreator, DataLoaderCreatorOptions } from '../../base';
import { IInnovationPack } from '@library/innovation-pack/innovation.pack.interface';

@Injectable()
export class AccountInnovationPacksLoaderCreator
implements DataLoaderCreator<IInnovationPack[]>
{
constructor(@InjectEntityManager() private manager: EntityManager) {}

create(options?: DataLoaderCreatorOptions<IInnovationPack[]>) {
return createTypedRelationDataLoader(
this.manager,
Account,
{ innovationPacks: true },
this.constructor.name,
options
);
}
}
3 changes: 2 additions & 1 deletion src/core/dataloader/creators/loader.creators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export * from './visual.loader.creator';

export * from './account/account.library.loader.creator';
export * from './account/account.defaults.loader.creator';
export * from './account/account.license.loader.creator';
export * from './account/account.virtual.contributors.loader.creator';
export * from './account/account.innovation.hubs.loader.creator';
export * from './account/account.innovation.pack.loader.creator';
export * from './account/account.loader.creator';
export * from './collaboration/collaboration.timeline.loader.creator';

Expand Down
2 changes: 0 additions & 2 deletions src/core/validation/handlers/base/base.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import {
import { UpdateCalloutTemplateInput } from '@domain/template/callout-template/dto/callout.template.dto.update';
import { CreateCalloutTemplateInput } from '@domain/template/callout-template/dto/callout.template.dto.create';
import { CreateContributionOnCalloutInput } from '@domain/collaboration/callout/dto/callout.dto.create.contribution';
import { UpdateLicenseInput } from '@domain/license/license/dto/license.dto.update';
import {
CreateLinkInput,
UpdateLinkInput,
Expand Down Expand Up @@ -133,7 +132,6 @@ export class BaseHandler extends AbstractHandler {
UpdateSpaceInput,
UpdateSpaceSettingsEntityInput,
UpdateOrganizationInput,
UpdateLicenseInput,
UpdateLinkInput,
UpdateCalendarEventInput,
UpdateInnovationFlowStateInput,
Expand Down
Loading

0 comments on commit 4266f52

Please sign in to comment.