Skip to content

Commit

Permalink
support css selector on sitemap (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrehault authored Mar 18, 2024
1 parent 1e80170 commit 2fadf21
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nuclia-sync-agent-app",
"version": "1.2.3",
"description": "\"This is a Nuclia Sync Agent App\"",
"version": "1.2.4",
"description": "This is a Nuclia Sync Agent App",
"main": "build/index.js",
"scripts": {
"copy-server-to-electron": "rm -rf electron-app/src/sync-agent && cp -r server/src electron-app/src/sync-agent",
Expand Down
4 changes: 4 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.2.4 (2024-03-18)

- Support CSS selectors in sitemap component

# 1.2.3 (2024-03-18)

- Allow to activate/deactivate a sync
Expand Down
1 change: 1 addition & 0 deletions server/src/logic/connector/domain/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum FileStatus {
export interface Link {
uri: string;
extra_headers: { [key: string]: string };
cssSelector?: string;
}

export interface ConnectorParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ class SitemapImpl implements IConnector {
}

getLink(resource: SyncItem): Observable<Link> {
const newLink: Link = { uri: resource.metadata['uri'], extra_headers: {} };
const newLink: Link = {
uri: resource.metadata['uri'],
extra_headers: {},
cssSelector: this.getParameters().cssSelector,
};
return of(newLink);
}

Expand Down
2 changes: 1 addition & 1 deletion server/src/logic/sync/domain/nuclia-cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class NucliaCloud {
payload.files = { file: { file: { uri: data.uri, filename: filename } } };
payload.icon = mimeType;
} else {
payload.links = { link: { uri: data.uri } };
payload.links = { link: { uri: data.uri, css_selector: data.cssSelector } };
payload.icon = 'application/stf-link';
}
if (metadata.labels) {
Expand Down

0 comments on commit 2fadf21

Please sign in to comment.