-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69677f4
commit 3fe0e15
Showing
7 changed files
with
118 additions
and
35 deletions.
There are no files selected for viewing
Empty file.
9 changes: 9 additions & 0 deletions
9
...ib/components/record-form/form-field/form-field-license/form-field-license.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<p>form-field-license works!</p> | ||
<gn-ui-dropdown-selector | ||
title="license" | ||
[showTitle]="false" | ||
[choices]="choices" | ||
[selected]="control.value" | ||
(selectValue)="control.setValue($event)" | ||
> | ||
</gn-ui-dropdown-selector> |
22 changes: 22 additions & 0 deletions
22
...components/record-form/form-field/form-field-license/form-field-license.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing' | ||
|
||
import { FormFieldLicenseComponent } from './form-field-license.component' | ||
|
||
describe('FormFieldLicenseComponent', () => { | ||
let component: FormFieldLicenseComponent | ||
let fixture: ComponentFixture<FormFieldLicenseComponent> | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [FormFieldLicenseComponent], | ||
}).compileComponents() | ||
|
||
fixture = TestBed.createComponent(FormFieldLicenseComponent) | ||
component = fixture.componentInstance | ||
fixture.detectChanges() | ||
}) | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy() | ||
}) | ||
}) |
31 changes: 31 additions & 0 deletions
31
.../lib/components/record-form/form-field/form-field-license/form-field-license.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core' | ||
import { FormControl } from '@angular/forms' | ||
import { marker } from '@biesbjerg/ngx-translate-extract-marker' | ||
import { DropdownSelectorComponent } from '@geonetwork-ui/ui/inputs' | ||
|
||
@Component({ | ||
selector: 'gn-ui-form-field-license', | ||
templateUrl: './form-field-license.component.html', | ||
styleUrls: ['./form-field-license.component.css'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [DropdownSelectorComponent], | ||
}) | ||
export class FormFieldLicenseComponent { | ||
@Input() control!: FormControl | ||
|
||
choices = [ | ||
{ value: 'cc-by', label: marker('editor.record.form.license.cc-by') }, | ||
{ value: 'cc-by-sa', label: marker('editor.record.form.license.cc-by-sa') }, | ||
{ value: 'cc-zero', label: marker('editor.record.form.license.cc-zero') }, | ||
{ value: 'etalab', label: marker('editor.record.form.license.etalab') }, | ||
{ | ||
value: 'etalab-v2', | ||
label: marker('editor.record.form.license.etalab-v2'), | ||
}, | ||
{ value: 'odbl', label: marker('editor.record.form.license.odbl') }, | ||
{ value: 'odc-by', label: marker('editor.record.form.license.odc-by') }, | ||
{ value: 'pddl', label: marker('editor.record.form.license.pddl') }, | ||
{ value: 'unknown', label: marker('editor.record.form.license.unknown') }, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters