-
Notifications
You must be signed in to change notification settings - Fork 8
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
Cs 7762 create and implement subclass in activity edit and embedded mode #2032
base: main
Are you sure you want to change the base?
Cs 7762 create and implement subclass in activity edit and embedded mode #2032
Conversation
<Pill | ||
style={{htmlSafe | ||
(concat | ||
'background-color: ' | ||
@model.status.colorScheme.backgroundColor | ||
'; border-color: transparent; font-weight: 600; font-size: 11px;' | ||
) | ||
}} | ||
>{{@model.status.label}}</Pill> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ease down on these style injections. You can use @pillBackgroundColor
property here. For the rest use a class name and write the css.
{ | ||
index: 0, | ||
icon: Phone, | ||
label: 'Customer Call', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should just be 'Call' or 'Phone Call'. If the contact has customer label, we can determine that it's a customer call.
this.args.model.email = freshEmail; | ||
this.args.model.meeting = freshMeeting; | ||
break; | ||
case 'Email': | ||
this.args.model.call = freshCall; | ||
this.args.model.meeting = freshMeeting; | ||
break; | ||
case 'Meeting': | ||
this.args.model.call = freshCall; | ||
this.args.model.email = freshEmail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't these just be set to undefined
or null
?
@field callTime = contains(DatetimeField); | ||
@field callDuration = contains(StringField); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use the date-range field here?
@field title = contains(StringField, { | ||
computeVia: function (this: Call) { | ||
const phoneStr = | ||
`${this.phoneNumber.countryCode}-${this.phoneNumber.number}` ?? ''; | ||
const timeStr = this.callTime?.toLocaleString() ?? ''; | ||
const durationStr = this.callDuration ?? ''; | ||
return `${phoneStr} - ${timeStr} - ${durationStr}`; | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we let the user decide on the title for each of the activity types? The empty strings or nulls look strange.
@field emailContent = contains(StringField); | ||
@field sentTime = contains(DatetimeField); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't sentTime be the timestamp? If it's meant to be for scheduling, maybe a clearer field name would be better. Is this the actual content of the email? If it is necessary, maybe it should be a markdown field.
@field startTime = contains(DatetimeField); | ||
@field endTime = contains(DatetimeField); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about the date range field here?
import { Email } from './activity-type/email'; | ||
import { Meeting } from './activity-type/meeting'; | ||
import type IconComponent from '@cardstack/boxel-icons/captions'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we organize all these imports above better?
{{#if this.activity}} | ||
<FieldContainer @vertical={{true}} class='activity-details'> | ||
{{#if (eq this.activity.label 'Customer Call')}} | ||
<@fields.call @format='edit' /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will probably be edit fields by default since this is an edit template
linear: https://linear.app/cardstack/issue/CS-7762/create-and-implement-subclass-in-activity-edit-and-embedded-mode
Result:
Screen.Recording.2025-01-13.at.13.24.36.mov