Add method to query deployer by LRN
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 5m0s
All checks were successful
Lint / lint (20.x) (pull_request) Successful in 5m0s
This commit is contained in:
parent
9595f08800
commit
043bcac3be
@ -592,4 +592,11 @@ export class Database {
|
|||||||
const deployers = await deployerRepository.find();
|
const deployers = await deployerRepository.find();
|
||||||
return deployers;
|
return deployers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getDeployerByLRN(deployerLrn: string): Promise<Deployer | null> {
|
||||||
|
const deployerRepository = this.dataSource.getRepository(Deployer);
|
||||||
|
const deployer = await deployerRepository.findOne({ where: { deployerLrn } });
|
||||||
|
|
||||||
|
return deployer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -623,7 +623,7 @@ export class Service {
|
|||||||
|
|
||||||
let deployer;
|
let deployer;
|
||||||
if (deployerLrn) {
|
if (deployerLrn) {
|
||||||
deployer = await this.createDeployerFromLRN(deployerLrn);
|
deployer = await this.db.getDeployerByLRN(deployerLrn);
|
||||||
} else {
|
} else {
|
||||||
deployer = data.deployer;
|
deployer = data.deployer;
|
||||||
}
|
}
|
||||||
@ -772,19 +772,6 @@ export class Service {
|
|||||||
return newDeployment;
|
return newDeployment;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createDeployerFromLRN(deployerLrn: string): Promise<Deployer | null> {
|
|
||||||
const records = await this.laconicRegistry.getRecordsByName(deployerLrn);
|
|
||||||
|
|
||||||
if (records.length === 0) {
|
|
||||||
log('No records found for deployer LRN:', deployerLrn);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const deployer = await this.saveDeployersByDeployerRecords(records);
|
|
||||||
|
|
||||||
return deployer[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
async updateProjectWithDeployer(
|
async updateProjectWithDeployer(
|
||||||
projectId: string,
|
projectId: string,
|
||||||
deployer: Deployer
|
deployer: Deployer
|
||||||
|
@ -241,7 +241,6 @@ const Configure = () => {
|
|||||||
onChange={(event) => onChange(event.target.value)}
|
onChange={(event) => onChange(event.target.value)}
|
||||||
displayEmpty
|
displayEmpty
|
||||||
size='small'
|
size='small'
|
||||||
|
|
||||||
>
|
>
|
||||||
{deployers.map((deployer) => (
|
{deployers.map((deployer) => (
|
||||||
<MenuItem key={deployer.deployerLrn} value={deployer.deployerLrn}>
|
<MenuItem key={deployer.deployerLrn} value={deployer.deployerLrn}>
|
||||||
|
@ -125,6 +125,17 @@ export const AuctionCard = ({ project }: { project: Project }) => {
|
|||||||
{'\u2022'} {deployer.deployerLrn}
|
{'\u2022'} {deployer.deployerLrn}
|
||||||
</p>
|
</p>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
<div className="flex justify-between items-center mt-1">
|
||||||
|
<span className="text-elements-high-em text-sm font-medium tracking-tight">
|
||||||
|
Deployer Funds Status
|
||||||
|
</span>
|
||||||
|
<div className="ml-2">
|
||||||
|
<Tag size="xs" type={fundsStatus ? 'positive' : 'emphasized'}>
|
||||||
|
{fundsStatus ? 'RELEASED' : 'LOCKED'}
|
||||||
|
</Tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="mt-3">
|
<div className="mt-3">
|
||||||
@ -133,20 +144,8 @@ export const AuctionCard = ({ project }: { project: Project }) => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex justify-between items-center mt-1">
|
|
||||||
<span className="text-elements-high-em text-sm font-medium tracking-tight">
|
|
||||||
Deployer Funds Status
|
|
||||||
</span>
|
|
||||||
<div className="ml-2">
|
|
||||||
<Tag size="xs" type={fundsStatus ? 'positive' : 'emphasized'}>
|
|
||||||
{fundsStatus ? 'RELEASED' : 'LOCKED'}
|
|
||||||
</Tag>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
|
Loading…
Reference in New Issue
Block a user