Skip to content

Commit

Permalink
Fix missing Project related resource attributes (#533)
Browse files Browse the repository at this point in the history
* Fix Project related resources timestamp

* Add summary to RelatedResource search
  • Loading branch information
jeffdaley authored Jan 12, 2024
1 parent f645a23 commit d3bbbf2
Showing 2 changed files with 23 additions and 7 deletions.
3 changes: 3 additions & 0 deletions web/app/components/related-resources.ts
Original file line number Diff line number Diff line change
@@ -228,6 +228,9 @@ export default class RelatedResourcesComponent extends Component<RelatedResource
"docType",
"status",
"owners",
"summary",
"createdTime",
"modifiedTime",
],

// https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/in-depth/optional-filters/
27 changes: 20 additions & 7 deletions web/app/components/related-resources/add.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ import { action } from "@ember/object";
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { HermesDocument } from "hermes/types/document";
import { next } from "@ember/runloop";
import { assert } from "@ember/debug";
import { restartableTask } from "ember-concurrency";
import ConfigService from "hermes/services/config";
@@ -330,17 +329,31 @@ export default class RelatedResourcesAddComponent extends Component<RelatedResou
* Adds the clicked document to the related-documents array in the correct format.
*/
@action protected onItemClick(_item: any, attrs: any) {
const {
title,
owners,
ownerPhotos,
product,
status,
summary,
createdTime,
modifiedTime,
} = attrs;

const relatedHermesDocument = {
googleFileID: attrs.objectID,
title: attrs.title,
documentType: attrs.docType,
documentNumber: attrs.docNumber,
owners: attrs.owners,
ownerPhotos: attrs.ownerPhotos,
product: attrs.product,
status: attrs.status,
title,
summary,
owners,
ownerPhotos,
product,
status,
createdTime,
modifiedTime,
sortOrder: 1,
} as RelatedHermesDocument;
};

this.args.addResource(relatedHermesDocument);
}

0 comments on commit d3bbbf2

Please sign in to comment.