-
Rotab has quit
-
D4RK-PH0ENiX joined the channel
-
amCap1712
thanks CatQuest for the information
-
Rotab joined the channel
-
SothoTalKer has quit
-
SothoTalKer joined the channel
-
SothoTalKer has quit
-
SothoTalKer joined the channel
-
Rotab has quit
-
Rotab joined the channel
-
CallerNo6 joined the channel
-
CallerNo6 has quit
-
CallerNo6 joined the channel
-
spellew
-
Rotab has quit
-
Rotab joined the channel
-
modwizcode has quit
-
modwizcode joined the channel
-
Rotab has quit
-
Rotab joined the channel
-
Gazooo joined the channel
-
yvanzo
!m bitmap
-
BrainzBot
You're doing good work, bitmap!
-
yvanzo
reosarevok: do not hesitate to ping me as well next time, can give it a try.
-
Actually I checked beta website after updating beta, not ws, my bad.
-
djinni` has quit
-
djinni` joined the channel
-
D4RK-PH0ENiX has quit
-
D4RK-PH0ENiX joined the channel
-
ayerhart has quit
-
modwizcode has quit
-
modwizcode joined the channel
-
Cyna
reosarevok: Is there any specific place where all the macros are converted to js and save as components ?
-
Lotheric_ joined the channel
-
reosarevok
Cyna: there's a system but I'm not completely sure yet what the system is :) If in doubt I ask bitmap
-
Cyna
I was thinking if few of the macros have already been converted so I wont have to redo the work
-
Lotheric has quit
-
reosarevok
Oh
-
Usually, when they have been converted, we leave a comment
-
-
If there's no comment chances are it's not converted yet, but you can always ask :)
-
(I'm sure we've forgotten to leave comments a few times)
-
Cyna
Im reading edit_alias.tt right now
-
`edit.display_data.entity_type` dont understand from where this came
-
and there are other perl functions that aren't present in `/lib/MusicBrainz/Server/Plugin/Diff.pm`
-
for example `entity_label()`
-
reosarevok
That comes from Perl
-
-
RJ2 has quit
-
Is just a part of the edit
-
And then each edit does build_display_data as needed
-
RJ2 joined the channel
-
-
Cyna
how do I figure out the function definitions, cause if I want to convert the functions to React I must know what it does
-
reosarevok
Which functions? :)
-
In this case, the display data you'll just get from the edit, it comes with it
-
-
Cyna
like entity_label, descriptive_link
-
reosarevok
descriptive link is already converted for sure
-
Cyna
Ohh nice... I'll start converting the others
-
reosarevok
For entity_label, as you can see it's basically the same as formatEntityTypeName
-
Which we already have
-
Cyna
Is there any controller sort of thing which I should edit ?
-
reosarevok
-
In fact, it'd probably just be addColonText(formatEntityTypeName(string)), rather than having all the strings separately
-
Unless I'm missing a reason why that's not a good idea :)
-
Cyna
Great I'll use formatEntityTypeName instead
-
well we can always edit the code for minor improvements
-
reosarevok
I'd still create a function inside that file though, for ease of re-use, but just make it return the addColonText of the main function
-
Cyna
so about the controller ?
-
reosarevok
For what kind of stuff you'll need to edit: do you still have the link to the PR I sent you a while ago? It should be pretty similar work
-
Cyna
Other files had one, this too has one right ?
-
reosarevok
You'll need to at least add a sub edit_template_react to the appropriate file in Server/Edit
-
Cyna
I guess I'll ask about it after converting so i can test it and stuff
-
-
what is this doing ?
-
reosarevok
If I'm completely honest, I'm not sure.
-
I keep forgetting what " | " means :D
-
Cyna
I havent worked much with macros and In react I never did need one
-
reosarevok
Oh
-
The | character can also be used as an alias for FILTER
-
Cyna
also it can mean to be used as pipeline or 'OR'
-
reosarevok
-
Cyna
I'd say second one is most probable
-
reosarevok
So yeah, I think it's running that filter
-
Cyna
Now I understand why I'd prefer React to perl
-
reosarevok
Not sure whether we have something for that on JS, ask bitmap how to deal with that one :)
-
bitmap
Cyna: to print the locale name in JS, you can import root/static/scripts/common/constants/locales.json and lookup the code in that object
-
Cyna
I'm having trouble with bracketed.js
-
root/static/scripts/common/utility/bracketed.js
-
converting this line `bracketedWithSpace(link_entity(edit.display_data.${edit.display_data.entity_type}, 'aliases', l('view all aliases')))`
-
I found EntityLink, and guessed that bracketed is the right component 😅
-
bitmap
right, you'd just pass the EntityLink element to bracketed
-
to get a space before it in JSX, {' '}
-
Cyna
The issue is that bracketed is not a component, its a funtion
-
Ohh I forgot I can also call functions inside the code
-
what type of brackets should be used ?
-
bitmap
the default, ()
-
Cyna
Okay I'll use the default
-
bitmap
(the TT macro doesn't support any other kind, so it'll always be ())
-
Cyna
ohh
-
There were other types in the js file
-
bitmap
yeah, if it's () you don't need to configure anything
-
because of the case '()': default:
-
Cyna
Are the preview files used after submitting edit ?
-
bitmap
the files under root/edit/details are used for both previewing and for normal display (after the edit is submitted)
-
Cyna
It doesnt work in real time, only after I submit the edit. It can be previewed
-
bitmap: could you help me converting the part inside EntityLink component
-
what is the entity that I should supply to it ?
-
display[entityType] ?
-
display is `const display = edit.display_data;`
-
bitmap
Cyna: display[display.entity_type] should work in that case
-
Cyna
this is my current line <EntityLink entity={display[entityType]} title={bracketed(l('view all aliases'))} />
-
bitmap
you'll want the bracketed around EntityLink instead, like bracketed(<EntityLink entity={display[entityType]} title={l('view all aliases')} />)
-
Cyna
Entity link is a component, right ?
-
bitmap
and since it's bracketedWithSpace, also add a space before it like {' '}{bracketed(...)}
-
yup
-
Cyna
so I guess it should be part of render and I guess adding space to the title must do the job
-
bitmap
nope, adding it to the title would look like "( title)" instead of " (title)"
-
Cyna
I mean I can add it after bracketed
-
bitmap
before :) like {' '}{bracketed(...)}
-
Cyna
something like ` ${bracketed(...)}`
-
there was ` here but it got converted to markdown preview
-
bitmap
you can't put it inside `` like that because it doesn't return a string
-
it returns a react element
-
Cyna
`` doesnt return a string 🤔
-
Passes flow tests as string too
-
bitmap
no, bracketed doesn't return a string
-
Cyna
Ill do this then {' '}{bracketed(...)}
-
bitmap
that's like saying ` ${{}}` which is ' [object Object]'
-
Cyna
ohh
-
what does IF after a statement mean ?
-
-
Usually IF is used before a statement, is it intentional ?
-
bitmap
[% x IF y %] is short for [% IF y; x; END %]
-
so yeah, it's intentional shorthand
-
Cyna
well not to complain but stuff like these should be uniform throughout the code
-
Nevermind I'll continue after a break
-
bitmap
well, you can't use the postfix style everywhere, and using the long-form for everything would be obnoxious
-
though I'm not sure it was necessary in your example
-
Cyna
bitmap: in case of this `IF entity_exists(edit.display_data.${edit.display_data.entity_type}) ~%]`
-
if edit.display_data.entity_type should work right ?
-
bitmap
as in if (edit.display_data.entity_type) { ... } for that whole condition?
-
Cyna
yea
-
bitmap
that's not what it's checking
-
Cyna
-
Its checking it the entity exist, right ?
-
bitmap
it's using edit.display_data.entity_type as a key into edit.display_data
-
and entity_exists checks that the gid is defined
-
Cyna
I guess I'll have to write a component for it... Couldn't find any existing component for the same