Skip to content

Commit

Permalink
Merge branch 'develop' into feature/Highlight2
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/app/app.module.ts
#	src/app/components/verse/verse.component.html
#	src/app/services/evt-model.service.ts
#	src/app/services/evt-status.service.ts
#	src/app/services/xml-parsers/basic-parsers.ts
#	src/assets/i18n/en.json
#	src/assets/i18n/it.json
#	src/styles.scss
  • Loading branch information
PaoloRembadi committed Mar 8, 2024
2 parents 9170076 + 6d74321 commit 67de22f
Show file tree
Hide file tree
Showing 75 changed files with 3,041 additions and 488 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
-

## [1.0.0-alpha] - 2022-12-07
## [1.0.0-alpha] - 2024-02-20

### Dependency Updates
- Updated to Angular 13
Expand Down Expand Up @@ -87,6 +87,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Named entities visualisation
- Named entities extraction
- OpenSeadragon component with support for manifest file
- Analogues and sources extraction and configuration
- Analogues and sources visualization

### Changed
- Routing params keys
Expand Down
34 changes: 33 additions & 1 deletion src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { TranslateService } from '@ngx-translate/core';
import { forkJoin } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { EntitiesSelectItemGroup } from './components/entities-select/entities-select.component';
import { ViewMode, ViewModeId } from './models/evt-models';
import { AnalogueClass, SourceClass, ViewMode, ViewModeId } from './models/evt-models';
import { Attributes, EditorialConventionLayout } from './models/evt-models';
import { updateCSS } from './utils/dom-utils';

@Injectable()
export class AppConfig {
Expand All @@ -31,6 +32,7 @@ export class AppConfig {
]).pipe(
map(([ui, edition, editorialConventions]) => {
console.log(ui, edition, files);
this.updateStyleFromConfig(edition);
// Handle default values => TODO: Decide how to handle defaults!!
if (ui.defaultLocalization) {
if (ui.availableLanguages.find((l) => l.code === ui.defaultLocalization && l.enable)) {
Expand All @@ -53,7 +55,23 @@ export class AppConfig {
});
});
}

/**
* Update once general css with values from config,
* this way we don't need to inject a style property in each element
* @param edition EditionConfig
*/
updateStyleFromConfig(edition: EditionConfig) {
const rules = [];
rules['.' + AnalogueClass + ' .opened'] = `background-color: ${edition.readingColorDark}`;
rules['.' + SourceClass + ' .opened'] = `background-color: ${edition.readingColorDark}`;
rules['.' + AnalogueClass + ':hover'] = `background-color: ${edition.readingColorLight}; cursor:pointer`;
rules['.' + SourceClass + ':hover'] = `background-color: ${edition.readingColorLight}; cursor:pointer`;
Object.entries(rules).forEach(([selector,style]) => { updateCSS([[selector,style]]) });
}

}

export interface EVTConfig {
ui: UiConfig;
edition: EditionConfig;
Expand Down Expand Up @@ -100,6 +118,20 @@ export interface EditionConfig {
verseNumberPrinter: number;
readingColorLight: string;
readingColorDark: string;
externalBibliography: Partial<{
biblAttributeToMatch: string;
elementAttributesToMatch: string[];
}>;
biblView: Partial<{
propsToShow: string[];
showAttrNames: boolean;
showEmptyValues: boolean;
inline: boolean;
commaSeparated: boolean;
showMainElemTextContent: boolean;
}>;
analogueMarkers: string[];
sourcesExcludedFromListByParent: string[];
}

export type EditionImagesSources = 'manifest' | 'graphics';
Expand Down
103 changes: 61 additions & 42 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,110 +22,119 @@ import { AppComponent } from './app.component';
import { Ng2HandySyntaxHighlighterModule } from 'ng2-handy-syntax-highlighter';
import { AppConfig } from './app.config';

import { AdditionComponent } from './components/addition/addition.component';
import { AdditionalComponent } from './components/additional/additional.component';
import { AdditionComponent } from './components/addition/addition.component';
import { AnalogueDetailComponent } from './components/analogues/analogue-detail/analogue-detail.component';
import { AnalogueEntryComponent } from './components/analogues/analogue-entry/analogue-entry.component';
import { AnaloguesComponent } from './components/analogues/analogues.component';
import { AnnotatorDirective } from './directives/annotator.directive';
import { AnnotatorService } from './services/annotator/annotator.service';
import { ApparatusEntryComponent } from './components/apparatus-entry/apparatus-entry.component';
import { ApparatusEntryDetailComponent } from './components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component';
import { ApparatusEntryReadingsComponent } from './components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component';
import { ApparatusEntryComponent } from './components/apparatus-entry/apparatus-entry.component';
import { BiblioEntryComponent } from './components/biblio/biblio.component';
import { BiblioListComponent } from './components/biblioList/biblio-list.component';
import { CharComponent } from './components/char/char.component';
import { ChoiceComponent } from './components/choice/choice.component';
import { CollationComponent } from './view-modes/collation/collation.component';
import { ContentViewerComponent } from './components/content-viewer/content-viewer.component';
import { CriticalApparatusComponent } from './components/critical-apparatus/critical-apparatus.component';
import { DamageComponent } from './components/damage/damage.component';
import { DeletionComponent } from './components/deletion/deletion.component';
import { EditionLevelSelectorComponent } from './components/edition-level-selector/edition-level-selector.component';
import { EditionStmtComponent } from './components/edition-stmt/edition-stmt.component';
import { EditorialConventionLayoutDirective } from './directives/editorial-convention-layout.directive';
import { EditorialDeclComponent } from './components/editorial-decl/editorial-decl.component';
import { EncodingDescComponent } from './components/encoding-desc/encoding-desc.component';
import { EntitiesSelectComponent } from './components/entities-select/entities-select.component';
import { EvtInfoComponent } from './evt-info/evt-info.component';
import { ExtentComponent } from './components/extent/extent.component';
import { FileDescComponent } from './components/file-desc/file-desc.component';
import { GComponent } from './components/g/g.component';
import { FilterPipe } from './pipes/filter.pipe';
import { GapComponent } from './components/gap/gap.component';
import { GComponent } from './components/g/g.component';
import { GenericElementComponent } from './components/generic-element/generic-element.component';
import { GenericParserService } from './services/xml-parsers/generic-parser.service';
import { GlobalListsComponent } from './components/global-lists/global-lists.component';
import { HandleImgErrorDirective } from './directives/handle-img-error.directive';
import { HighlightDirective } from './directives/highlight.directive';
import { HistoryComponent } from './components/history/history.component';
import { HtmlAttributesDirective } from './directives/html-attributes.directive';
import { HumanizePipe } from './pipes/humanize.pipe';
import { IdbService } from './services/idb.service';
import { IdentifierComponent } from './components/identifier/identifier.component';
import { ImageImageComponent } from './view-modes/image-image/image-image.component';
import { ImageGrpPanelComponent } from './panels/imagegrp-panel/imagegrp-panel.component';
import { ImageOnlyComponent } from './view-modes/image-only/image-only.component';
import { ImagePanelComponent } from './panels/image-panel/image-panel.component';
import { ImageTextComponent } from './view-modes/image-text/image-text.component';
import { LbComponent } from './components/lb/lb.component';
import { MainHeaderComponent } from './main-header/main-header.component';
import { MainMenuComponent } from './main-menu/main-menu.component';
import { ManuscriptThumbnailsViewerComponent } from './components/manuscript-thumbnails-viewer/manuscript-thumbnails-viewer.component';
import { MsContentsComponent } from './components/ms-contents/ms-contents.component';
import { MsDescSelectorComponent } from './components/ms-desc-selector/ms-desc-selector.component';
import { MsDescComponent } from './components/ms-desc/ms-desc.component';
import { MsDescSectionComponent } from './ui-components/ms-desc-section/ms-desc-section.component';
import { MsDescSelectorComponent } from './components/ms-desc-selector/ms-desc-selector.component';
import { MsFragComponent } from './components/ms-frag/ms-frag.component';
import { MsIdentifierComponent } from './components/ms-identifier/ms-identifier.component';
import { MsItemComponent } from './components/ms-item/ms-item.component';
import { MsPartComponent } from './components/ms-part/ms-part.component';
import { NamedEntitiesListComponent } from './components/named-entities-list/named-entities-list.component';
import { NamedEntityRefComponent } from './components/named-entity-ref/named-entity-ref.component';
import { NamedEntityRelationComponent } from './components/named-entity-relation/named-entity-relation.component';
import { NamedEntityComponent } from './components/named-entity/named-entity.component';
import { NamedEntityDetailComponent } from './components/named-entity/named-entity-detail/named-entity-detail.component';
import { NamedEntityOccurrenceComponent } from './components/named-entity/named-entity-occurrence/named-entity-occurrence.component';
import { NamedEntityComponent } from './components/named-entity/named-entity.component';
import { NamedEntityRefComponent } from './components/named-entity-ref/named-entity-ref.component';
import { NamedEntityRelationComponent } from './components/named-entity-relation/named-entity-relation.component';
import { NamespaceComponent } from './components/namespace/namespace.component';
import { NavBarComponent } from './nav-bar/nav-bar.component';
import { NoteComponent } from './components/note/note.component';
import { NotesStmtComponent } from './components/notes-stmt/notes-stmt.component';
import { OriginalEncodingViewerComponent } from './components/original-encoding-viewer/original-encoding-viewer.component';
import { OsdComponent } from './components/osd/osd.component';
import { PageSelectorComponent } from './components/page-selector/page-selector.component';
import { PageComponent } from './components/page/page.component';
import { PageSelectorComponent } from './components/page-selector/page-selector.component';
import { ParagraphComponent } from './components/paragraph/paragraph.component';
import { PhysDescComponent } from './components/phys-desc/phys-desc.component';
import { PinboardComponent } from './pinboard/pinboard.component';
import { PinboardPanelComponent } from './panels/pinboard-panel/pinboard-panel.component';
import { PinnerComponent } from './pinboard/pinner/pinner.component';
import { ProjectDescComponent } from './components/project-desc/project-desc.component';
import { ProjectInfoComponent } from './components/project-info/project-info.component';
import { PublicationStmtComponent } from './components/publication-stmt/publication-stmt.component';
import { QuoteEntryComponent } from './components/quote-entry/quote-entry.component';
import { ReadingComponent } from './components/reading/reading.component';
import { ReadingTextComponent } from './view-modes/reading-text/reading-text.component';
import { RenditionComponent } from './components/rendition/rendition.component';
import { RespStmtComponent } from './components/resp-stmt/resp-stmt.component';
import { SamplingDeclComponent } from './components/sampling-decl/sampling-decl.component';
import { SeriesStmtComponent } from './components/series-stmt/series-stmt.component';
import { ShortcutsComponent } from './shortcuts/shortcuts.component';
import { SicComponent } from './components/sic/sic.component';
import { SpaceComponent } from './components/space/space.component';
import { SourceDetailComponent } from './components/sources/source-detail/source-detail.component';
import { SourceNoteComponent } from './components/sources/source-note/source-note.component';
import { SourcesComponent } from './components/sources/sources.component';
import { SourcesPanelComponent } from './panels/sources-panel/sources-panel.component';
import { StartsWithPipe } from './pipes/starts-with.pipe';
import { SuppliedComponent } from './components/supplied/supplied.component';
import { SurplusComponent } from './components/surplus/surplus.component';
import { TagsDeclComponent } from './components/tags-decl/tags-decl.component';
import { TextComponent } from './components/text/text.component';
import { TextPanelComponent } from './panels/text-panel/text-panel.component';
import { TextSourcesComponent } from './view-modes/text-sources/text-sources.component';
import { TextTextComponent } from './view-modes/text-text/text-text.component';
import { TextVersionsComponent } from './view-modes/text-versions/text-versions.component';
import { ThemesService } from './services/themes.service';
import { TitleStmtComponent } from './components/title-stmt/title-stmt.component';
import { VerseComponent } from './components/verse/verse.component';
import { VersesGroupComponent } from './components/verses-group/verses-group.component';
import { WordComponent } from './components/word/word.component';
import { AnnotatorDirective } from './directives/annotator.directive';
import { EditorialConventionLayoutDirective } from './directives/editorial-convention-layout.directive';
import { HighlightDirective } from './directives/highlight.directive';
import { HtmlAttributesDirective } from './directives/html-attributes.directive';
import { EvtInfoComponent } from './evt-info/evt-info.component';
import { MainHeaderComponent } from './main-header/main-header.component';
import { MainMenuComponent } from './main-menu/main-menu.component';
import { NavBarComponent } from './nav-bar/nav-bar.component';
import { NavBarImageComponent } from './nav-bar-image/nav-bar-image.component';
import { ImagePanelComponent } from './panels/image-panel/image-panel.component';
import { PinboardPanelComponent } from './panels/pinboard-panel/pinboard-panel.component';
import { SourcesPanelComponent } from './panels/sources-panel/sources-panel.component';
import { TextPanelComponent } from './panels/text-panel/text-panel.component';
import { VersionPanelComponent } from './panels/version-panel/version-panel.component';
import { WitnessPanelComponent } from './panels/witness-panel/witness-panel.component';
import { PinboardComponent } from './pinboard/pinboard.component';
import { PinnerComponent } from './pinboard/pinner/pinner.component';
import { FilterPipe } from './pipes/filter.pipe';
import { HumanizePipe } from './pipes/humanize.pipe';
import { StartsWithPipe } from './pipes/starts-with.pipe';
import { XmlBeautifyPipe } from './pipes/xml-beautify.pipe';
import { AnnotatorService } from './services/annotator/annotator.service';
import { IdbService } from './services/idb.service';
import { ThemesService } from './services/themes.service';
import { GenericParserService } from './services/xml-parsers/generic-parser.service';
import { XMLParsers } from './services/xml-parsers/xml-parsers';
import { ShortcutsComponent } from './shortcuts/shortcuts.component';
import { MsDescSectionComponent } from './ui-components/ms-desc-section/ms-desc-section.component';
import { CollationComponent } from './view-modes/collation/collation.component';
import { ImageTextComponent } from './view-modes/image-text/image-text.component';
import { ReadingTextComponent } from './view-modes/reading-text/reading-text.component';
import { TextSourcesComponent } from './view-modes/text-sources/text-sources.component';
import { TextTextComponent } from './view-modes/text-text/text-text.component';
import { TextVersionsComponent } from './view-modes/text-versions/text-versions.component';
import { HandleImgErrorDirective } from './directives/handle-img-error.directive';
import { ImageOnlyComponent } from './view-modes/image-only/image-only.component';
import { ImageImageComponent } from './view-modes/image-image/image-image.component';
import { ImageGrpPanelComponent } from "./panels/imagegrp-panel/imagegrp-panel.component";


const routes: Routes = [
];
Expand All @@ -137,6 +146,7 @@ export function initializeApp(appConfig: AppConfig) {
const DynamicComponents = [
AdditionalComponent,
AdditionComponent,
AnalogueEntryComponent,
ApparatusEntryComponent,
ApparatusEntryDetailComponent,
ApparatusEntryReadingsComponent,
Expand Down Expand Up @@ -173,6 +183,7 @@ const DynamicComponents = [
PhysDescComponent,
ProjectDescComponent,
PublicationStmtComponent,
QuoteEntryComponent,
ReadingComponent,
RenditionComponent,
RespStmtComponent,
Expand All @@ -192,10 +203,15 @@ const DynamicComponents = [

@NgModule({
declarations: [
AnalogueDetailComponent,
AnaloguesComponent,
AnnotatorDirective,
AppComponent,
BiblioEntryComponent,
BiblioListComponent,
CollationComponent,
ContentViewerComponent,
CriticalApparatusComponent,
EditionLevelSelectorComponent,
EditorialConventionLayoutDirective,
EntitiesSelectComponent,
Expand Down Expand Up @@ -229,6 +245,9 @@ const DynamicComponents = [
ProjectInfoComponent,
ReadingTextComponent,
ShortcutsComponent,
SourceDetailComponent,
SourceNoteComponent,
SourcesComponent,
SourcesPanelComponent,
StartsWithPipe,
TextPanelComponent,
Expand Down
Loading

0 comments on commit 67de22f

Please sign in to comment.