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

Terms of service #45

Open
wants to merge 7 commits into
base: main
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@
[baseNode]="info()" nodePath="description"
[noValueMessage]="'No description.'" (onChange)="onDescriptionChange($event)"></inline-markdown-editor>
</div>
<!-- Terms Of Service -->
<div class="section-field-label">
<validation-problem [model]="info()" property="termsOfService" [shallow]="true"></validation-problem>
<span>Terms Of Service</span>
</div>
<div class="section-field termsOfService">
<inline-markdown-editor [value]="termsOfService()"
[labelClass]="'api-termsOfService api-item-termsOfService'"
[formClass]="'api-termsOfService-editor-form'"
[inputClass]="'api-item-editor api-termsOfService-editor api-termsOfService api-item-termsOfService'"
[baseNode]="info()" nodePath="termsOfService"
[noValueMessage]="'No value.'" (onChange)="onTermsOfServiceChange($event)"></inline-markdown-editor>
</div>

<!-- Consumes and Produces (2.0 only) -->
<div *ngIf="document.is2xDocument()">
<!-- Consumes -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ export class InfoSectionComponent extends AbstractBaseComponent {
}
}

/**
* returns the termsOfService.
*/
public termsOfService(): string {
if (this.info()) {
return this.info().termsOfService;
} else {
return null;
}
}

/**
* Called when the user changes the version.
* @param newVersion
Expand All @@ -84,6 +95,16 @@ export class InfoSectionComponent extends AbstractBaseComponent {
this.commandService.emit(command);
}

/**
* Called when the user changes the description.
@param newTermsOfService
*/
public onTermsOfServiceChange(newTermsOfService: string): void {
console.info("[AsyncApiInfoSectionComponent] User changed the terms of service.");
let command: ICommand = CommandFactory.createChangePropertyCommand(this.info(), "termsOfService", newTermsOfService);
this.commandService.emit(command);
}

/**
* Called when the user changes the "consumes".
* @param newValue
Expand Down
Loading