Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bugtracker, donation, vcs-browser URL types #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/app/addon.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,48 @@ <h1 class="title">
</div>
</div>

<div class="field">
<label class="label">Bugtracker of the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptBugtracker" type="text" placeholder="The bugtracker where to file bugs for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptBugtracker.invalid && (cptBugtracker.dirty || cptBugtracker.touched)">
<p *ngIf="cptBugtracker.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Donation for the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptDonation" type="text" placeholder="The website where one can perform a donation for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptDonation.invalid && (cptDonation.dirty || cptDonation.touched)">
<p *ngIf="cptDonation.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Code browser of the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptCode" type="text" placeholder="The website where one can browse source code for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptCode.invalid && (cptCode.dirty || cptCode.touched)">
<p *ngIf="cptCode.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Description</label>
<div class="control">
Expand Down
17 changes: 16 additions & 1 deletion src/app/addon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export class AddonComponent implements OnInit {
cptName: ['', Validators.required ],
cptSummary: ['', Validators.required ],
cptHomepage: ['', [ Validators.required, urlValidator() ] ],
cptBugtracker: ['', urlValidator()],
cptDonation: ['', urlValidator()],
cptCode: ['', urlValidator()],
cptDescription: ['', Validators.required ],
cptId: ['', [ Validators.required, Validators.minLength(4), componentIdValidator() ]],
extendsCptId: ['', [ Validators.required, Validators.minLength(4), componentIdValidator() ]],
Expand Down Expand Up @@ -95,6 +98,9 @@ export class AddonComponent implements OnInit {
get cptSummary() { return this.cptForm.get('cptSummary'); }

get cptHomepage() { return this.cptForm.get('cptHomepage'); }
get cptBugtracker() { return this.cptForm.get('cptBugtracker'); }
get cptDonation() { return this.cptForm.get('cptDonation'); }
get cptCode() { return this.cptForm.get('cptCode'); }

get cptDescription() { return this.cptForm.get('cptDescription'); }

Expand Down Expand Up @@ -145,6 +151,12 @@ export class AddonComponent implements OnInit {
return;
if (!this.validateField(this.cptHomepage, 'homepage'))
return;
if (!this.validateField(this.cptBugtracker, 'bugtracker', true))
return;
if (!this.validateField(this.cptDonation, 'donation', true))
return;
if (!this.validateField(this.cptCode, 'code', true))
return;
if (!this.validateField(this.cptDescription, 'long description'))
return;
if (!this.validateField(this.cptId, 'component ID'))
Expand Down Expand Up @@ -183,7 +195,10 @@ export class AddonComponent implements OnInit {
metadataLicense: this.metadataLicense.value,
projectLicense: pLicense,
description: this.cptDescription.value,
homepage: this.cptHomepage.value
homepage: this.cptHomepage.value,
bugtracker: this.cptBugtracker.value,
donation: this.cptDonation.value,
code: this.cptCode.value,
};

this.dataGenerated = true;
Expand Down
42 changes: 42 additions & 0 deletions src/app/consoleapp.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,48 @@ <h1 class="title">
</div>
</div>

<div class="field">
<label class="label">Bugtracker of the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptBugtracker" type="text" placeholder="The bugtracker where to file bugs for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptBugtracker.invalid && (cptBugtracker.dirty || cptBugtracker.touched)">
<p *ngIf="cptBugtracker.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Donation for the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptDonation" type="text" placeholder="The website where one can perform a donation for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptDonation.invalid && (cptDonation.dirty || cptDonation.touched)">
<p *ngIf="cptDonation.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Code browser of the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptCode" type="text" placeholder="The website where one can browse source code for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptCode.invalid && (cptCode.dirty || cptCode.touched)">
<p *ngIf="cptCode.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Description</label>
<div class="control">
Expand Down
17 changes: 16 additions & 1 deletion src/app/consoleapp.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export class ConsoleAppComponent implements OnInit {
appName: ['', Validators.required ],
appSummary: ['', Validators.required ],
appHomepage: ['', [ Validators.required, urlValidator() ] ],
cptBugtracker: ['', urlValidator()],
cptDonation: ['', urlValidator()],
cptCode: ['', urlValidator()],
appDescription: ['', Validators.required ],
cptId: ['', [ Validators.required, Validators.minLength(4), componentIdValidator() ]],
metadataLicense: ['', Validators.required ],
Expand Down Expand Up @@ -120,6 +123,9 @@ export class ConsoleAppComponent implements OnInit {
get appSummary() { return this.cptForm.get('appSummary'); }

get appHomepage() { return this.cptForm.get('appHomepage'); }
get cptBugtracker() { return this.cptForm.get('cptBugtracker'); }
get cptDonation() { return this.cptForm.get('cptDonation'); }
get cptCode() { return this.cptForm.get('cptCode'); }

get appDescription() { return this.cptForm.get('appDescription'); }

Expand Down Expand Up @@ -174,6 +180,12 @@ export class ConsoleAppComponent implements OnInit {
return;
if (!this.validateField(this.appHomepage, 'homepage'))
return;
if (!this.validateField(this.cptBugtracker, 'bugtracker', true))
return;
if (!this.validateField(this.cptDonation, 'donation', true))
return;
if (!this.validateField(this.cptCode, 'code', true))
return;
if (!this.validateField(this.appDescription, 'long description'))
return;
if (!this.validateField(this.cptId, 'component ID'))
Expand Down Expand Up @@ -217,7 +229,10 @@ export class ConsoleAppComponent implements OnInit {
metadataLicense: this.metadataLicense.value,
projectLicense: pLicense,
description: this.appDescription.value,
homepage: this.appHomepage.value
homepage: this.appHomepage.value,
bugtracker: this.cptBugtracker.value,
donation: this.cptDonation.value,
code: this.cptCode.value,
};

this.dataGenerated = true;
Expand Down
42 changes: 42 additions & 0 deletions src/app/guiapp.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,48 @@ <h1 class="title">
</div>
</div>

<div class="field">
<label class="label">Bugtracker of the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptBugtracker" type="text" placeholder="The bugtracker where to file bugs for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptBugtracker.invalid && (cptBugtracker.dirty || cptBugtracker.touched)">
<p *ngIf="cptBugtracker.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Donation for the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptDonation" type="text" placeholder="The website where one can perform a donation for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptDonation.invalid && (cptDonation.dirty || cptDonation.touched)">
<p *ngIf="cptDonation.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Code browser of the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptCode" type="text" placeholder="The website where one can browse source code for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptCode.invalid && (cptCode.dirty || cptCode.touched)">
<p *ngIf="cptCode.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Description</label>
<div class="control">
Expand Down
18 changes: 17 additions & 1 deletion src/app/guiapp.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export class GUIAppComponent implements OnInit {
appName: ['', Validators.required ],
appSummary: ['', Validators.required ],
appHomepage: ['', [ Validators.required, urlValidator() ] ],
cptBugtracker: ['', urlValidator()],
cptDonation: ['', urlValidator()],
cptCode: ['', urlValidator()],
appDescription: ['', Validators.required ],
cptId: ['', [ Validators.required, Validators.minLength(4), componentIdValidator() ]],
metadataLicense: ['', Validators.required ],
Expand Down Expand Up @@ -164,6 +167,10 @@ export class GUIAppComponent implements OnInit {
get appSummary() { return this.cptForm.get('appSummary'); }

get appHomepage() { return this.cptForm.get('appHomepage'); }
get cptBugtracker() { return this.cptForm.get('cptBugtracker'); }
get cptDonation() { return this.cptForm.get('cptDonation'); }
get cptCode() { return this.cptForm.get('cptCode'); }

get appDescription() { return this.cptForm.get('appDescription'); }
get cptId() { return this.cptForm.get('cptId'); }

Expand Down Expand Up @@ -234,6 +241,12 @@ export class GUIAppComponent implements OnInit {
return;
if (!this.validateField(this.appHomepage, 'homepage'))
return;
if (!this.validateField(this.cptBugtracker, 'bugtracker', true))
return;
if (!this.validateField(this.cptDonation, 'donation', true))
return;
if (!this.validateField(this.cptCode, 'code', true))
return;
if (!this.validateField(this.appDescription, 'long description'))
return;
if (!this.validateField(this.cptId, 'component ID'))
Expand Down Expand Up @@ -308,7 +321,10 @@ export class GUIAppComponent implements OnInit {
metadataLicense: this.metadataLicense.value,
projectLicense: pLicense,
description: this.appDescription.value,
homepage: this.appHomepage.value
homepage: this.appHomepage.value,
bugtracker: this.cptBugtracker.value,
donation: this.cptDonation.value,
code: this.cptCode.value,
};

arrayAddIfNotEmpty(appInfo.scrImages, this.primaryScreenshot.value);
Expand Down
11 changes: 11 additions & 0 deletions src/app/makemetainfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export interface ASBasicInfo {
projectLicense: string;
description: string;
homepage: string;
bugtracker: string;
donation: string;
code: string;
[key: string]: unknown;
}

Expand Down Expand Up @@ -121,6 +124,14 @@ function createMetainfoPreamble(binfo: ASBasicInfo, relXMLData: ASRelationXMLDat
if (binfo.homepage)
miXml = miXml + '\n\n<url type="homepage">' + xmlEscape(binfo.homepage) + '</url>';

if (binfo.bugtracker)
miXml = miXml + '\n\n<url type="bugtracker">' + xmlEscape(binfo.bugtracker) + '</url>';

if (binfo.donation)
miXml = miXml + '\n\n<url type="donation">' + xmlEscape(binfo.donation) + '</url>';

if (binfo.code)
miXml = miXml + '\n\n<url type="vcs-browser">' + xmlEscape(binfo.code) + '</url>';

return miXml;
}
Expand Down
42 changes: 42 additions & 0 deletions src/app/service.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,48 @@ <h1 class="title">
</div>
</div>

<div class="field">
<label class="label">Bugtracker of the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptBugtracker" type="text" placeholder="The bugtracker where to file bugs for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptBugtracker.invalid && (cptBugtracker.dirty || cptBugtracker.touched)">
<p *ngIf="cptBugtracker.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Donation for the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptDonation" type="text" placeholder="The website where one can perform a donation for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptDonation.invalid && (cptDonation.dirty || cptDonation.touched)">
<p *ngIf="cptDonation.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Code browser of the addon</label>
<div class="control has-icons-left">
<input class="input" formControlName="cptCode" type="text" placeholder="The website where one can browse source code for this addon.">
<span class="icon is-small is-left">
<i class="fas fa-link"></i>
</span>
</div>

<div *ngIf="cptCode.invalid && (cptCode.dirty || cptCode.touched)">
<p *ngIf="cptCode.errors.invalidUrl" class="help is-danger">This URL is not accepted</p>
</div>
</div>

<div class="field">
<label class="label">Description</label>
<div class="control">
Expand Down
Loading