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

[Editor]: Hide open data toggle #1033

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
45 changes: 23 additions & 22 deletions apps/metadata-editor-e2e/src/e2e/edit.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable cypress/no-unnecessary-waiting */

describe('editor form', () => {
let recordUuid: any

Check warning on line 4 in apps/metadata-editor-e2e/src/e2e/edit.cy.ts

View workflow job for this annotation

GitHub Actions / Format check, lint, unit tests

Unexpected any. Specify a different type
before(() => {
cy.login('admin', 'admin', false)
cy.viewport(1920, 2400)
Expand Down Expand Up @@ -691,28 +691,29 @@
})
})
describe('Access and constraints', () => {
describe('Open data switch', () => {
beforeEach(() => {
cy.get('@accessContactPageBtn').click()
})
describe('When the open data switch is unchecked', () => {
it('should display the licence form field', () => {
cy.get('gn-ui-form-field-license').should('be.visible')
cy.get('gn-ui-form-field-license')
.find('button')
.children('div')
.first()
.invoke('text')
.should('eq', ' Creative Commons CC-BY ')
})
})
describe('When the open data switch is checked', () => {
it('should not display the licence form field', () => {
cy.get('[data-cy="openDataToggle"]').click()
cy.get('gn-ui-form-field-license').should('not.exist')
})
})
})
// TEMPORARY - to be removed when the open data switch is back
// describe('Open data switch', () => {
// beforeEach(() => {
// cy.get('@accessContactPageBtn').click()
// })
// describe('When the open data switch is unchecked', () => {
// it('should display the licence form field', () => {
// cy.get('gn-ui-form-field-license').should('be.visible')
// cy.get('gn-ui-form-field-license')
// .find('button')
// .children('div')
// .first()
// .invoke('text')
// .should('eq', ' Creative Commons CC-BY ')
// })
// })
// describe('When the open data switch is checked', () => {
// it('should not display the licence form field', () => {
// cy.get('[data-cy="openDataToggle"]').click()
// cy.get('gn-ui-form-field-license').should('not.exist')
// })
// })
// })
describe('licenses', () => {
beforeEach(() => {
cy.get('@accessContactPageBtn').click()
Expand Down
1 change: 1 addition & 0 deletions apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('record-actions', () => {
}).as('insertRecord')
cy.get('md-editor-publish-button').click()
cy.wait('@insertRecord')
cy.get('@abstractField').focus()
cy.get('@abstractField').type('draft abstract')
// Assert that the draft exists in the local storage
cy.editor_readFormUniqueIdentifier().then((uniqueIdentifier) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<ng-container *ngIf="model === 'licenses'">
<!-- TEMPORARY - disabling the open data switch -->
<!-- <ng-container *ngIf="model === 'licenses'">
<gn-ui-form-field-open-data
[value]="valueAsConstraints"
(valueChange)="valueChange.emit($event)"
(openDataChange)="isHidden = $event"
></gn-ui-form-field-open-data>
</ng-container>
</ng-container> -->
<div class="flex flex-col h-full" *ngIf="!isHidden">
<ng-container *ngIf="withoutWrapper; else withGenericWrapper">
cmoinier marked this conversation as resolved.
Show resolved Hide resolved
<ng-container *ngTemplateOutlet="fieldContent"></ng-container>
Expand Down
Loading