Merge branch 'master' into 3185-feature-x-sendcoins-21-add-graphql-endpoints-for-starting-tx-2-phase-commit-handshake

This commit is contained in:
clauspeterhuebner 2023-09-06 01:00:08 +02:00 committed by GitHub
commit 8835287189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 4 deletions

View File

@ -294,7 +294,7 @@ describe('CommunityResolver', () => {
})
})
describe('with several community entries', () => {
describe('returns 2 filtered communities even with 3 existing entries', () => {
beforeEach(async () => {
await cleanDB()
jest.clearAllMocks()
@ -316,8 +316,8 @@ describe('CommunityResolver', () => {
foreignCom1.url = 'http://stage-2.gradido.net/api'
foreignCom1.publicKey = Buffer.from('publicKey-stage-2_Community')
foreignCom1.privateKey = Buffer.from('privateKey-stage-2_Community')
foreignCom1.communityUuid = 'Stage2-Com-UUID'
foreignCom1.authenticatedAt = new Date()
// foreignCom1.communityUuid = 'Stage2-Com-UUID'
// foreignCom1.authenticatedAt = new Date()
foreignCom1.name = 'Stage-2_Community-name'
foreignCom1.description = 'Stage-2_Community-description'
foreignCom1.creationDate = new Date()
@ -336,7 +336,7 @@ describe('CommunityResolver', () => {
await DbCommunity.insert(foreignCom2)
})
it('returns 3 community entries', async () => {
it('returns 2 community entries', async () => {
await expect(query({ query: communities })).resolves.toMatchObject({
data: {
communities: [
@ -350,6 +350,7 @@ describe('CommunityResolver', () => {
uuid: homeCom1.communityUuid,
authenticatedAt: homeCom1.authenticatedAt?.toISOString(),
},
/*
{
id: expect.any(Number),
foreign: foreignCom1.foreign,
@ -360,6 +361,7 @@ describe('CommunityResolver', () => {
uuid: foreignCom1.communityUuid,
authenticatedAt: foreignCom1.authenticatedAt?.toISOString(),
},
*/
{
id: expect.any(Number),
foreign: foreignCom2.foreign,

View File

@ -1,3 +1,4 @@
import { IsNull, Not } from '@dbTools/typeorm'
import { Community as DbCommunity } from '@entity/Community'
import { FederatedCommunity as DbFederatedCommunity } from '@entity/FederatedCommunity'
import { Resolver, Query, Authorized } from 'type-graphql'
@ -28,6 +29,7 @@ export class CommunityResolver {
@Query(() => [Community])
async communities(): Promise<Community[]> {
const dbCommunities: DbCommunity[] = await DbCommunity.find({
where: { communityUuid: Not(IsNull()) }, //, authenticatedAt: Not(IsNull()) },
order: {
name: 'ASC',
},

View File

@ -56,3 +56,23 @@ export default {
},
}
</script>
<style>
.community-switch > div,
.community-switch ul.dropdown-menu {
width: 100%;
}
.community-switch > div > button {
border-radius: 17px;
height: 50px;
text-align: left;
}
.community-switch .dropdown-toggle::after {
float: right;
top: 50%;
transform: translateY(-50%);
position: relative;
}
.community-switch ul li:first-child {
display: none;
}
</style>