Skip to content
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

Rewrite channel selector to use updated message types #1345

Open
wants to merge 11 commits into
base: fdc3-for-web-impl
Choose a base branch
from

Conversation

julianna-ciq
Copy link
Contributor

No description provided.

@julianna-ciq julianna-ciq requested a review from a team as a code owner September 10, 2024 19:29
@kriswest kriswest added this to the 2.2 candidates milestone Sep 20, 2024
@julianna-ciq
Copy link
Contributor Author

@robmoffat I've finished cleaning up the aesthetics, so this PR is ready for you to review and merge.

Copy link
Contributor

@kriswest kriswest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for having a go at this @julianna-ciq. Needs a few updates for new message type names. Could also ensure typing is applied to messages sent and that you only ever reference the top-level types for the messages, rather than using the payload types directly (as their naming may be unstable.

Thanks for identifying the styling race - what do you think about ways of avoiding it without using a setTimeout

collapse();
break;
}
case "iframeChannels": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs updating to the fdc3UserInterface* messsages after we changed the name(s)

Suggested change
case "iframeChannels": {
case "fdc3UserInterfaceChannels": {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kriswest those changes aren't merged into fdc3-for-web-impl so @julianna-ciq's code is correct as it stands.

const {userChannels, selected} = data.payload as IframeChannelsPayload;
fillChannels(userChannels, selected, (channelStr) => {
myPort.postMessage({
type: "iframeChannelSelected",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs update

Suggested change
type: "iframeChannelSelected",
type: "fdc3UserInterfaceSelected",

};

parent.postMessage({
type: "iframeHello",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type: "iframeHello",
type: "fdc3UserInterfaceHello",

const expand = () => {
document.body.setAttribute("data-expanded", "true");
myPort.postMessage({
type: "iframeRestyle",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type: "iframeRestyle",
type: "fdc3UserInterfaceRestyle",


const collapse = () => {
myPort.postMessage({
type: "iframeRestyle",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type: "iframeRestyle",
type: "fdc3UserInterfaceRestyle",

break;
}
case "iframeResolve": {
myPort.postMessage({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Init and type the message as an object, then post

payload: s
});

myPort.postMessage({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Init and type message then post

});

myPort.postMessage({
type: "iframeRestyle",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type: "iframeRestyle",
type: "fdc3UserInterfaceRestyle",


};

parent.postMessage({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Init and type message then post

};

parent.postMessage({
type: "iframeHello",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type: "iframeHello",
type: "fdc3UserInterfaceHello",

Copy link
Contributor

kriswest commented Oct 3, 2024

Nah, that just means there's stuff the other end to change too :-p

I wasn't saying she got it wrong, rather just highlighting the places that it will need to change as we changed the message names.

@robmoffat
Copy link
Member

Nah, that just means there's stuff the other end to change too :-p

I wasn't saying she got it wrong, rather just highlighting the places that it will need to change as we changed the message names.

Oh right ok. Well look, I'm on holiday for the next couple of weeks, so you've got a window to get everything straightened out before I get round to merging / search and replace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants