From fdd75178a23553bde76b04b8e332b00c03ec074b Mon Sep 17 00:00:00 2001 From: Jeff Daley Date: Mon, 18 Mar 2024 14:23:46 -0400 Subject: [PATCH] Update types and descriptions --- web/app/adapters/jira-issue.ts | 3 +- web/app/components/project/jira-widget.ts | 5 ++-- web/app/components/project/tile.ts | 9 ++---- web/app/models/jira-issue.ts | 29 ++++++++++--------- web/app/serializers/jira-issue.ts | 5 ++-- web/app/types/project.d.ts | 15 ++-------- .../components/project/jira-widget-test.ts | 5 ++-- 7 files changed, 31 insertions(+), 40 deletions(-) diff --git a/web/app/adapters/jira-issue.ts b/web/app/adapters/jira-issue.ts index 59b67281c..3e2caa740 100644 --- a/web/app/adapters/jira-issue.ts +++ b/web/app/adapters/jira-issue.ts @@ -2,6 +2,7 @@ import DS from "ember-data"; import ApplicationAdapter from "./application"; import RSVP from "rsvp"; import ModelRegistry from "ember-data/types/registries/model"; +import JiraIssueModel from "hermes/models/jira-issue"; export default class JiraIssueAdapter extends ApplicationAdapter { findRecord( @@ -9,7 +10,7 @@ export default class JiraIssueAdapter extends ApplicationAdapter { _type: ModelRegistry[K], id: string, _snapshot: DS.Snapshot, - ): RSVP.Promise { + ): RSVP.Promise { const issue = this.fetchSvc .fetch(`/api/${this.configSvc.config.api_version}/jira/issues/${id}`) .then((response) => response?.json()); diff --git a/web/app/components/project/jira-widget.ts b/web/app/components/project/jira-widget.ts index 62b9e8284..afc9996ba 100644 --- a/web/app/components/project/jira-widget.ts +++ b/web/app/components/project/jira-widget.ts @@ -4,16 +4,17 @@ import { tracked } from "@glimmer/tracking"; import { inject as service } from "@ember/service"; import { restartableTask } from "ember-concurrency"; import FetchService from "hermes/services/fetch"; -import { JiraIssue, JiraPickerResult } from "hermes/types/project"; +import { JiraPickerResult } from "hermes/types/project"; import ConfigService from "hermes/services/config"; import { XDropdownListAnchorAPI } from "../x/dropdown-list"; import { next } from "@ember/runloop"; import { assert } from "@ember/debug"; +import JiraIssueModel from "hermes/models/jira-issue"; interface ProjectJiraWidgetComponentSignature { Element: HTMLDivElement; Args: { - issue?: JiraPickerResult | JiraIssue; + issue?: JiraPickerResult | JiraIssueModel; onIssueSelect?: (issue: any) => void; onIssueRemove?: () => void; isDisabled?: boolean; diff --git a/web/app/components/project/tile.ts b/web/app/components/project/tile.ts index 3d4220b17..3a90c780f 100644 --- a/web/app/components/project/tile.ts +++ b/web/app/components/project/tile.ts @@ -3,14 +3,11 @@ import { inject as service } from "@ember/service"; import Component from "@glimmer/component"; import { tracked } from "@glimmer/tracking"; import { task } from "ember-concurrency"; +import JiraIssueModel from "hermes/models/jira-issue"; import ConfigService from "hermes/services/config"; import FetchService from "hermes/services/fetch"; import StoreService from "hermes/services/store"; -import { - HermesProject, - HermesProjectHit, - JiraIssue, -} from "hermes/types/project"; +import { HermesProject, HermesProjectHit } from "hermes/types/project"; export const PROJECT_TILE_MAX_PRODUCTS = 3; @@ -50,7 +47,7 @@ export default class ProjectTileComponent extends Component void; onIssueRemove: () => void;