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

That’s not my name #3048

Merged
merged 10 commits into from
Jan 4, 2021
Merged

That’s not my name #3048

merged 10 commits into from
Jan 4, 2021

Conversation

mxdvl
Copy link
Contributor

@mxdvl mxdvl commented Nov 25, 2020

What does this change?

Adds the ability to edit the People in an image. Developed with @zeek01 as part of Hack Day 2020.

Some of the “prompted change” alluded to in Mistakes with identities have dismayed our readers – and prompted change.

This required to change the underlying Scala type from Map[String, String]Map[String, JsValue]. The service.js also handle the peopleInImage field differently than other.

How can success be measured?

Picture editors should be able to correct this metadata if it is wrong.

Screenshots

joe-to-john-real

Who should look at this?

@paperboyo, @akash1810, @guardian/digital-cms

Tested?

  • locally
  • on TEST

Comment on lines +12 to +13
[*.html]
indent_size = 4
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this to make my editor happy, but happy to drop this change.

Copy link
Member

Choose a reason for hiding this comment

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

You must have a wide screen 😅 .

Copy link
Contributor Author

@mxdvl mxdvl Dec 21, 2020

Choose a reason for hiding this comment

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

I'm working full screen with 1440 pixels. That 4 spaces is in line with what's currently used in the Angular html files.

@mxdvl mxdvl self-assigned this Nov 26, 2020
@mxdvl mxdvl added enhancement metadata To Review PRs that need to be reviewed labels Nov 26, 2020
@mxdvl mxdvl changed the title Guess who That’s not my name Nov 26, 2020
Copy link
Member

@akash1810 akash1810 left a comment

Choose a reason for hiding this comment

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

Looks great, let's add some tests.

@@ -20,15 +20,15 @@ describe('metadataDiff', () => {
it("finds a changed string field in the presence of an array", () => {
const initial = { field: "value", array1: ["value 2"] };
const changed = { field: "changed", array2: ["value 2"] };
const expected = { field: "changed" };
const expected = { field: "changed", array1: "", array2: ["value 2"] };
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't array1 be absent from expected here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we array1 should return an empty array. In any case, I’ve updated the tests.

value.map { case(k, v) => (k, if (v == "") null else v) }
.foreach { case(k, v) => valueMap.withString(k, v) }
value.map { case(k, v) => (k, if (v == JsNull) null else v) }
.foreach { case(k, v) => valueMap.withJSON(k, Json.stringify(v)) }
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to have some tests against this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

@akash1810 I think this is done now?

metadata-editor/app/controllers/EditsController.scala Outdated Show resolved Hide resolved
@mxdvl
Copy link
Contributor Author

mxdvl commented Dec 2, 2020

Grid CI / ScalaBuild (pull_request) failed on FileMetadataReaderTest.scala for some reason, but re-running the jobs solved it…

@mxdvl mxdvl marked this pull request as ready for review December 4, 2020 14:18
@AWare
Copy link
Contributor

AWare commented Dec 18, 2020

👍 Happy with this, have seen it on TEST and it's writing sensible things to the database. @akash1810 are you happy with the tests?

Copy link
Member

@akash1810 akash1810 left a comment

Choose a reason for hiding this comment

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

This change is great! Not least because it addresses a ~5 year issue!

Works as described on TEST; perhaps @paperboyo wants to give it a final try? We should also send some comms out via Central Production.

This is also likely to be of interest to BBC so cc @ochiengolanga and @wainaina. We can also bring it up at our next meeting.

Comment on lines +12 to +13
[*.html]
indent_size = 4
Copy link
Member

Choose a reason for hiding this comment

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

You must have a wide screen 😅 .

@paperboyo
Copy link
Contributor

@paperboyo wants to give it a final try?

Him did already. Works a treat!

We should also send some comms out via Central Production.

Defo! cc @marianadiaspereira

it addresses a ~5 year issue!

Would that be editing arrays?

also likely to be of interest to BBC

Yeah, they have this cool thing (although I can’t tell which fields are possible to add and if peopleInImage is one of them). CP comms would be even cooler if we could bring this to our fork.

@paperboyo paperboyo removed the To Review PRs that need to be reviewed label Dec 23, 2020
@paperboyo paperboyo merged commit efb577a into main Jan 4, 2021
@paperboyo paperboyo deleted the guess-who branch January 4, 2021 11:55
@prout-bot
Copy link

Seen on auth, cropper, collections, kahuna, image-loader-projection, metadata-editor, leases (created by @mxdvl and merged by @paperboyo 10 minutes and 44 seconds ago) Please check your changes!

@prout-bot
Copy link

Seen on usage, image-loader, media-api (created by @mxdvl and merged by @paperboyo 10 minutes and 49 seconds ago) Please check your changes!

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

Successfully merging this pull request may close these issues.

5 participants