-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from appuio/default-organization
Enable users to set their default organization
- Loading branch information
Showing
56 changed files
with
1,218 additions
and
458 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
cypress/fixtures/organization-members-nxt-without-current-username.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { UserRef } from '../../src/app/types/team'; | ||
import { OrganizationMembers } from '../../src/app/types/organization-members'; | ||
|
||
export interface OrganizationMembersConfig { | ||
namespace: string; | ||
userRefs: UserRef[]; | ||
} | ||
|
||
export function createOrganizationMembers(organizationMembersConfig: OrganizationMembersConfig): OrganizationMembers { | ||
return { | ||
kind: 'OrganizationMembers', | ||
apiVersion: 'appuio.io/v1', | ||
metadata: { | ||
namespace: organizationMembersConfig.namespace, | ||
}, | ||
spec: { | ||
userRefs: organizationMembersConfig.userRefs, | ||
}, | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { Organization, OrganizationList, OrganizationSpec } from '../../src/app/types/organization'; | ||
|
||
export interface OrganizationConfig { | ||
name: string; | ||
displayName?: string; | ||
viewMembers?: boolean; | ||
editOrganization?: boolean; | ||
} | ||
|
||
export interface OrganizationListConfig { | ||
items: Organization[]; | ||
} | ||
|
||
export const organizationVshn = createOrganization({ | ||
name: 'vshn', | ||
displayName: 'VSHN - the DevOps Company', | ||
}); | ||
|
||
export const organizationListNxtVshn = createOrganizationList({ | ||
items: [ | ||
createOrganization({ | ||
name: 'nxt', | ||
displayName: 'nxt Engineering GmbH', | ||
}), | ||
createOrganization({ | ||
name: 'vshn', | ||
}), | ||
], | ||
}); | ||
|
||
export const organizationListNxtVshnWithDisplayName = createOrganizationList({ | ||
items: [ | ||
createOrganization({ | ||
name: 'nxt', | ||
displayName: 'nxt Engineering GmbH', | ||
}), | ||
createOrganization({ | ||
name: 'vshn', | ||
displayName: 'VSHN AG', | ||
}), | ||
], | ||
}); | ||
|
||
export function createOrganization(organizationConfig: OrganizationConfig): Organization { | ||
let spec: OrganizationSpec = {}; | ||
if (organizationConfig.displayName) { | ||
spec = { | ||
displayName: organizationConfig.displayName, | ||
}; | ||
} | ||
return { | ||
kind: 'Organization', | ||
apiVersion: 'organization.appuio.io/v1', | ||
metadata: { | ||
name: organizationConfig.name, | ||
}, | ||
spec, | ||
viewMembers: organizationConfig.viewMembers, | ||
editOrganization: organizationConfig.editOrganization, | ||
}; | ||
} | ||
|
||
export function createOrganizationList(organizationListConfig: OrganizationListConfig): OrganizationList { | ||
return { | ||
kind: 'OrganizationList', | ||
apiVersion: 'organization.appuio.io/v1', | ||
metadata: {}, | ||
items: organizationListConfig.items, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { Team, UserRef } from '../../src/app/types/team'; | ||
import { List } from '../../src/app/types/list'; | ||
|
||
export interface TeamConfig { | ||
name: string; | ||
namespace: string; | ||
displayName: string; | ||
userRefs: UserRef[]; | ||
} | ||
|
||
export interface TeamListConfig { | ||
items: Team[]; | ||
} | ||
|
||
export const team1 = createTeam({ | ||
name: 'team1', | ||
namespace: 'nxt', | ||
displayName: 'My Super Team 1', | ||
userRefs: [{ name: 'mig' }, { name: 'miw' }], | ||
}); | ||
|
||
export const teamListNxt = createTeamList({ | ||
items: [ | ||
createTeam({ | ||
name: 'team1', | ||
namespace: 'nxt', | ||
displayName: 'My Super Team 1', | ||
userRefs: [{ name: 'mig' }, { name: 'miw' }], | ||
}), | ||
createTeam({ | ||
name: 'team2', | ||
namespace: 'nxt', | ||
displayName: 'My Super Team 2', | ||
userRefs: [{ name: 'cma' }], | ||
}), | ||
], | ||
}); | ||
export const teamListVshn = createTeamList({ | ||
items: [ | ||
createTeam({ | ||
name: 'tarazed', | ||
namespace: 'vshn', | ||
displayName: 'Tarazed', | ||
userRefs: [{ name: 'corvus' }], | ||
}), | ||
], | ||
}); | ||
|
||
export function createTeam(teamConfig: TeamConfig): Team { | ||
return { | ||
apiVersion: 'appuio.io/v1', | ||
kind: 'Team', | ||
metadata: { | ||
name: teamConfig.name, | ||
namespace: teamConfig.namespace, | ||
}, | ||
spec: { | ||
displayName: teamConfig.displayName, | ||
userRefs: teamConfig.userRefs, | ||
}, | ||
}; | ||
} | ||
|
||
export function createTeamList(teamListConfig: TeamListConfig): List<Team> { | ||
return { | ||
apiVersion: 'v1', | ||
kind: 'List', | ||
items: teamListConfig.items, | ||
metadata: { | ||
resourceVersion: '', | ||
selfLink: '', | ||
}, | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.