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] Clean unfinished UI features #1035

Merged
merged 10 commits into from
Dec 2, 2024
23 changes: 4 additions & 19 deletions apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,11 @@ describe('dashboard (authenticated)', () => {

it('should show nothing when none are selected', () => {
cy.visit('/catalog/search')
cy.get('gn-ui-results-table')
.find('.table-row-cell')
.get('gn-ui-checkbox')
.each(($checkbox) => cy.wrap($checkbox).click())
cy.get('[data-cy=records-information]').should(
'not.have.descendants',
'[data-test=selected-count]'
)
})

it('should select all records when the "select all" checkbox is checked', () => {
cy.visit('/catalog/search')
cy.get('gn-ui-results-table')
.find('.table-row-cell')
.get('gn-ui-checkbox')
.first()
.click()
cy.get('[data-test=selected-count]').contains('15 selected')
})
})
describe('columns', () => {
beforeEach(() => {
Expand Down Expand Up @@ -225,27 +211,26 @@ describe('dashboard (authenticated)', () => {
})
describe('my records', () => {
it('should only display records I own', () => {
cy.get('md-editor-dashboard-menu').find('a').eq(5).click()
cy.get('md-editor-dashboard-menu').find('a').eq(3).click()
cy.get('gn-ui-results-table')
.find('[data-cy="table-row"]')
.find('ng-icon')
.next()
.should('contain', 'admin admin')
})
it('should display the correct amount of records', () => {
cy.get('md-editor-dashboard-menu').find('a').eq(5).click()
cy.get('md-editor-dashboard-menu').find('a').eq(3).click()
cy.get('gn-ui-results-table')
.find('[data-cy="table-row"]')
.should('have.length', '10')
})
it('should sort the records by title', () => {
cy.get('md-editor-dashboard-menu').find('a').eq(5).click()
cy.get('md-editor-dashboard-menu').find('a').eq(3).click()
cy.get('gn-ui-results-table')
.find('[data-cy="table-row"]')
.first()
.invoke('text')
.then((firstRecord) => {
console.log(firstRecord)
cy.get('gn-ui-results-table')
.find('.table-header-cell')
.eq(1)
Expand Down Expand Up @@ -288,7 +273,7 @@ describe('dashboard (authenticated)', () => {
cy.get('gn-ui-autocomplete').should('have.value', '')
})
it('should hide the search input when navigating to my drafts', () => {
cy.get('md-editor-dashboard-menu').find('a').eq(6).click()
cy.get('md-editor-dashboard-menu').find('a').eq(4).click()
cy.get('gn-ui-autocomplete').should('not.exist')
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ng-icon name="iconoirJournal"></ng-icon>
<span class="text-sm" translate="">dashboard.catalog.allRecords</span>
</a>
<a
<!-- <a
class="menu-item btn-inactive"
[routerLink]="activeLink ? '/catalog/discussion' : null"
routerLinkActive="btn-active"
Expand All @@ -29,7 +29,7 @@
>
<ng-icon name="iconoirCalendar"></ng-icon>
<span class="text-sm" translate="">dashboard.catalog.calendar</span>
</a>
</a> -->
<a
class="menu-item btn-inactive"
[routerLink]="activeLink ? '/catalog/contacts' : null"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="flex flex-row items-center w-full border-b-[1px]">
<gn-ui-button
<!-- <gn-ui-button
type="light"
disabled="true"
[title]="'editor.temporary.disabled' | translate"
Expand All @@ -19,7 +19,7 @@
[title]="'editor.temporary.disabled' | translate"
>
<ng-icon name="iconoirDownload"></ng-icon>
</gn-ui-button>
</gn-ui-button> -->
<ng-container *ngrxLet="saveStatus$ as saveStatus">
<gn-ui-button
type="light"
Expand Down Expand Up @@ -55,7 +55,7 @@
<span translate>editor.record.saveStatus.draftWithChangesPending</span>
</ng-container>
</div>
<gn-ui-button
<!-- <gn-ui-button
type="light"
disabled="true"
[title]="'editor.temporary.disabled' | translate"
Expand All @@ -68,6 +68,6 @@
[title]="'editor.temporary.disabled' | translate"
>
<ng-icon name="iconoirBadgeCheck"></ng-icon>
</gn-ui-button>
</gn-ui-button> -->
<md-editor-publish-button></md-editor-publish-button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ <h1 class="text-[16px] text-main font-bold" translate>
<div
class="flex flex-row items-center mx-[32px] my-[16px] py-[8px] gap-[16px]"
>
<div>
<span
class="uppercase text-slate-300 text-xs"
[title]="'editor.temporary.disabled' | translate"
translate
>dashboard.results.listMetadata</span
>
</div>
<div>
<span
class="uppercase text-slate-300 text-xs"
[title]="'editor.temporary.disabled' | translate"
translate
>dashboard.results.listResources</span
>
</div>
<div class="grow"></div>
<gn-ui-button
cdkOverlayOrigin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ <h1 class="text-[16px] text-main font-title font-bold" translate>
<div
class="flex flex-row items-center mx-[32px] my-[16px] py-[8px] gap-[16px]"
>
<div>
<span
class="uppercase text-slate-300 text-xs"
[title]="'editor.temporary.disabled' | translate"
translate
>dashboard.myRecords.publishedMetadatas</span
>
</div>
<div>
<span
class="uppercase text-slate-300 text-xs"
[title]="'editor.temporary.disabled' | translate"
translate
>dashboard.myRecords.currentlyEdited</span
>
</div>
<div class="grow"></div>
<gn-ui-button
cdkOverlayOrigin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ export class ImportRecordComponent {
@Output() closeImportMenu = new EventEmitter<void>()

importMenuItems: ImportMenuItems[] = [
{
label: this.translateService.instant('dashboard.importRecord.useModel'),
icon: 'iconoirLightBulbOn',
action: () => null,
dataTest: 'useAModelButton',
disabled: true,
},
// {
// label: this.translateService.instant('dashboard.importRecord.useModel'),
// icon: 'iconoirLightBulbOn',
// action: () => null,
// dataTest: 'useAModelButton',
// disabled: true,
// },
{
label: this.translateService.instant(
'dashboard.importRecord.importExternal'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
>edit</span
>
<span
*ngIf="config.hintKey"
class="material-symbols-outlined gn-ui-icon-small m-2"
[matTooltip]="config.hintKey! | translate"
matTooltipPosition="above"
Expand Down
10 changes: 0 additions & 10 deletions libs/ui/search/src/lib/results-table/results-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@
>
<!-- SELECTED COLUMN -->
<gn-ui-interactive-table-column [width]="'3rem'">
<ng-template #header>
<gn-ui-checkbox
[checked]="isAllSelected()"
[indeterminate]="isSomeSelected()"
(changed)="toggleSelectAll()"
type="default"
class="-m-2 mr-3"
>
</gn-ui-checkbox>
</ng-template>
<ng-template #cell let-item>
<gn-ui-checkbox
[checked]="isChecked(item)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,32 +106,6 @@ describe('ResultsTableComponent', () => {
expect(emitted).toEqual([[record], true])
})
})

describe('#isAllSelected', () => {
it('returns true if all records in the page are selected', () => {
component.selectedRecordsIdentifiers = ['1', '2', '3', '4', '5']
expect(component.isAllSelected()).toBe(true)
})
it('returns false otherwise', () => {
component.selectedRecordsIdentifiers = ['1']
expect(component.isAllSelected()).toBe(false)
})
})

describe('#isSomeSelected', () => {
it('returns false if all records in the page are selected', () => {
component.selectedRecordsIdentifiers = ['1', '2', '3', '4', '5']
expect(component.isSomeSelected()).toBe(false)
})
it('returns true if one or more records in the page is selected', () => {
component.selectedRecordsIdentifiers = ['2', '3']
expect(component.isSomeSelected()).toBe(true)
})
it('returns false if no record in the page is selected', () => {
component.selectedRecordsIdentifiers = ['4', '5']
expect(component.isSomeSelected()).toBe(false)
})
})
})

describe('clicking on a dataset', () => {
Expand Down
20 changes: 0 additions & 20 deletions libs/ui/search/src/lib/results-table/results-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,4 @@ export class ResultsTableComponent {
handleRecordSelectedChange(selected: boolean, record: CatalogRecord) {
this.recordsSelectedChange.emit([[record], selected])
}

async toggleSelectAll() {
this.recordsSelectedChange.emit([this.records, !this.isAllSelected()])
}

isAllSelected(): boolean {
return this.records.every((record) =>
this.selectedRecordsIdentifiers.includes(record.uniqueIdentifier)
)
}

isSomeSelected(): boolean {
const allSelected = this.records.every((record) =>
this.selectedRecordsIdentifiers.includes(record.uniqueIdentifier)
)
const someSelected = this.records.some((record) =>
this.selectedRecordsIdentifiers.includes(record.uniqueIdentifier)
)
return !allSelected && someSelected
}
}
6 changes: 0 additions & 6 deletions translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"chart.type.lineSmooth": "Geglättes Liniendiagramm",
"chart.type.pie": "Kreisdiagramm",
"dashboard.catalog.allRecords": "Metadatenkatalog",
"dashboard.catalog.calendar": "Kalender",
"dashboard.catalog.contacts": "Kontakte",
"dashboard.catalog.discussion": "Diskussion",
"dashboard.catalog.thesaurus": "Thesaurus",
"dashboard.createRecord": "Neuer Eintrag",
"dashboard.importRecord": "",
Expand All @@ -31,8 +29,6 @@
"dashboard.importRecord.useModel": "",
"dashboard.labels.catalog": "Katalog",
"dashboard.labels.mySpace": "Mein Bereich",
"dashboard.myRecords.currentlyEdited": "",
"dashboard.myRecords.publishedMetadatas": "",
"dashboard.records.all": "Metadatenkatalog",
"dashboard.records.hasDraft": "",
"dashboard.records.myDraft": "Meine Entwürfe",
Expand All @@ -43,8 +39,6 @@
"dashboard.records.userEmail": "E-Mail",
"dashboard.records.username": "Benutzername",
"dashboard.records.users": "{count, plural, =1{Benutzer} other{Benutzer}}",
"dashboard.results.listMetadata": "Metadaten anzeigen",
"dashboard.results.listResources": "Ressourcen anzeigen",
"datafeeder.analysisProgressBar.illustration.fileFormatDetection": "Dateiformat-Erkennung",
"datafeeder.analysisProgressBar.illustration.gatheringDatasetInformation": "Sammeln von Datensatzinformationen",
"datafeeder.analysisProgressBar.illustration.samplingData": "Datenauswahl",
Expand Down
6 changes: 0 additions & 6 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"chart.type.lineSmooth": "smooth line chart",
"chart.type.pie": "pie chart",
"dashboard.catalog.allRecords": "Metadata records",
"dashboard.catalog.calendar": "Calendar",
"dashboard.catalog.contacts": "Contacts",
"dashboard.catalog.discussion": "Discussion",
"dashboard.catalog.thesaurus": "Thesaurus",
"dashboard.createRecord": "New record",
"dashboard.importRecord": "Import",
Expand All @@ -31,8 +29,6 @@
"dashboard.importRecord.useModel": "Use a model",
"dashboard.labels.catalog": "Catalog",
"dashboard.labels.mySpace": "My space",
"dashboard.myRecords.currentlyEdited": "Currently edited",
"dashboard.myRecords.publishedMetadatas": "Published metadatas",
"dashboard.records.all": "Metadata records",
"dashboard.records.hasDraft": "draft",
"dashboard.records.myDraft": "My drafts",
Expand All @@ -43,8 +39,6 @@
"dashboard.records.userEmail": "Email",
"dashboard.records.username": "Username",
"dashboard.records.users": "{count, plural, =1{user} other{users}}",
"dashboard.results.listMetadata": "Show metadata",
"dashboard.results.listResources": "Show resources",
"datafeeder.analysisProgressBar.illustration.fileFormatDetection": "File format \n detection",
"datafeeder.analysisProgressBar.illustration.gatheringDatasetInformation": "Gathering dataset \n information",
"datafeeder.analysisProgressBar.illustration.samplingData": "Sampling \n data",
Expand Down
6 changes: 0 additions & 6 deletions translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"chart.type.lineSmooth": "gráfico de líneas suave",
"chart.type.pie": "gráfico circular",
"dashboard.catalog.allRecords": "",
"dashboard.catalog.calendar": "",
"dashboard.catalog.contacts": "",
"dashboard.catalog.discussion": "",
"dashboard.catalog.thesaurus": "",
"dashboard.createRecord": "",
"dashboard.importRecord": "",
Expand All @@ -31,8 +29,6 @@
"dashboard.importRecord.useModel": "",
"dashboard.labels.catalog": "Catálogo",
"dashboard.labels.mySpace": "Mi espacio",
"dashboard.myRecords.currentlyEdited": "",
"dashboard.myRecords.publishedMetadatas": "",
"dashboard.records.all": "Catálogo",
"dashboard.records.hasDraft": "",
"dashboard.records.myDraft": "Mis borradores",
Expand All @@ -43,8 +39,6 @@
"dashboard.records.userEmail": "",
"dashboard.records.username": "",
"dashboard.records.users": "",
"dashboard.results.listMetadata": "",
"dashboard.results.listResources": "",
"datafeeder.analysisProgressBar.illustration.fileFormatDetection": "",
"datafeeder.analysisProgressBar.illustration.gatheringDatasetInformation": "",
"datafeeder.analysisProgressBar.illustration.samplingData": "",
Expand Down
6 changes: 0 additions & 6 deletions translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"chart.type.lineSmooth": "ligne lisse",
"chart.type.pie": "camembert",
"dashboard.catalog.allRecords": "Fiches de métadonnées",
"dashboard.catalog.calendar": "Calendrier",
"dashboard.catalog.contacts": "Annuaire",
"dashboard.catalog.discussion": "Discussions",
"dashboard.catalog.thesaurus": "Thesaurus",
"dashboard.createRecord": "Nouvel enregistrement",
"dashboard.importRecord": "Importer",
Expand All @@ -31,8 +29,6 @@
"dashboard.importRecord.useModel": "Utiliser un modèle",
"dashboard.labels.catalog": "Catalogue",
"dashboard.labels.mySpace": "Mon espace",
"dashboard.myRecords.currentlyEdited": "En cours d'édition",
"dashboard.myRecords.publishedMetadatas": "Fiches publiées",
"dashboard.records.all": "Fiches de métadonnées",
"dashboard.records.hasDraft": "brouillon",
"dashboard.records.myDraft": "Mes brouillons",
Expand All @@ -43,8 +39,6 @@
"dashboard.records.userEmail": "Email",
"dashboard.records.username": "Nom d'utilisateur",
"dashboard.records.users": "{count, plural, =1{utilisateur} other{utilisateurs}}",
"dashboard.results.listMetadata": "Afficher les métadonnées",
"dashboard.results.listResources": "Afficher les ressources",
"datafeeder.analysisProgressBar.illustration.fileFormatDetection": "Détection du \n format de fichier",
"datafeeder.analysisProgressBar.illustration.gatheringDatasetInformation": "Récupération des informations \n sur le jeu de données",
"datafeeder.analysisProgressBar.illustration.samplingData": "Échantillonnage \n des données",
Expand Down
Loading
Loading