Merge pull request #113 from 67P/feature/gitea_site
Add Gitea site/username to serializer and seeds
This commit is contained in:
commit
b64a7ca299
@ -1,7 +1,36 @@
|
||||
const contractCalls = [
|
||||
['Contributor', 'add', [{ account: '0x7e8f313c56f809188313aa274fa67ee58c31515d', name: 'bumi', kind: 'person', url: '', github_username: 'bumi', github_uid: 318, wiki_username: 'Bumi' }, { gasLimit: 200000 }]],
|
||||
['Contributor', 'add', [{ account: '0x49575f3DD9a0d60aE661BC992f72D837A77f05Bc', name: 'raucao', kind: 'person', url: '', github_username: 'skddc', github_uid: 842, wiki_username: 'Basti' }, { gasLimit: 200000 }]],
|
||||
['Contributor', 'add', [{ account: '0xF722709ECC3B05c19d02E82a2a4A4021B8F48C62', name: 'Manuel', kind: 'person', url: '', github_username: 'fsmanuel', github_uid: 54812, wiki_username: 'Manuel' }, { gasLimit: 200000 }]],
|
||||
['Contributor', 'add', [{
|
||||
account: '0x7e8f313c56f809188313aa274fa67ee58c31515d',
|
||||
name: 'bumi',
|
||||
kind: 'person',
|
||||
url: '',
|
||||
github_username: 'bumi',
|
||||
github_uid: 318,
|
||||
gitea_username: 'bumi',
|
||||
wiki_username: 'Bumi'
|
||||
}, { gasLimit: 200000 }]],
|
||||
|
||||
['Contributor', 'add', [{
|
||||
account: '0x49575f3DD9a0d60aE661BC992f72D837A77f05Bc',
|
||||
name: 'raucao',
|
||||
kind: 'person',
|
||||
url: '',
|
||||
github_username: 'skddc',
|
||||
github_uid: 842,
|
||||
gitea_username: 'raucao',
|
||||
wiki_username: 'Basti'
|
||||
}, { gasLimit: 200000 }]],
|
||||
|
||||
['Contributor', 'add', [{
|
||||
account: '0xF722709ECC3B05c19d02E82a2a4A4021B8F48C62',
|
||||
name: 'Manuel',
|
||||
kind: 'person',
|
||||
url: '',
|
||||
github_username: 'fsmanuel',
|
||||
github_uid: 54812,
|
||||
wiki_username: 'Manuel'
|
||||
}, { gasLimit: 200000 }]],
|
||||
|
||||
['Proposal', 'addProposal', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-09', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]],
|
||||
['Proposal', 'addProposal', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-10', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]],
|
||||
['Proposal', 'addProposal', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Hacked on kredits', url: '' }, { gasLimit: 350000 }]],
|
||||
|
@ -26,6 +26,7 @@ class Contributor {
|
||||
url,
|
||||
github_uid,
|
||||
github_username,
|
||||
gitea_username,
|
||||
wiki_username,
|
||||
} = this;
|
||||
|
||||
@ -50,6 +51,14 @@ class Contributor {
|
||||
});
|
||||
}
|
||||
|
||||
if (gitea_username) {
|
||||
data.accounts.push({
|
||||
"site": "gitea.kosmos.org",
|
||||
"username": gitea_username,
|
||||
"url": `https://gitea.kosmos.org/${gitea_username}`
|
||||
});
|
||||
}
|
||||
|
||||
if (wiki_username) {
|
||||
data.accounts.push({
|
||||
"site": "wiki.kosmos.org",
|
||||
@ -87,13 +96,17 @@ class Contributor {
|
||||
accounts,
|
||||
} = JSON.parse(serialized.toString('utf8'));
|
||||
|
||||
let github_username, github_uid, wiki_username;
|
||||
let github = accounts.find((a) => a.site === 'github.com');
|
||||
let wiki = accounts.find((a) => a.site === 'wiki.kosmos.org');
|
||||
let github_username, github_uid, gitea_username, wiki_username;
|
||||
let github = accounts.find(a => a.site === 'github.com');
|
||||
let gitea = accounts.find(a => a.site === 'gitea.kosmos.org');
|
||||
let wiki = accounts.find(a => a.site === 'wiki.kosmos.org');
|
||||
|
||||
if (github) {
|
||||
(({ username: github_username, uid: github_uid} = github));
|
||||
}
|
||||
if (gitea) {
|
||||
(({ username: gitea_username } = gitea));
|
||||
}
|
||||
if (wiki) {
|
||||
(({ username: wiki_username } = wiki));
|
||||
}
|
||||
@ -105,6 +118,7 @@ class Contributor {
|
||||
accounts,
|
||||
github_uid,
|
||||
github_username,
|
||||
gitea_username,
|
||||
wiki_username,
|
||||
ipfsData: serialized,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user