Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Personas with no name show as null on visualisations (LLC-57) #293

Merged
merged 5 commits into from
Apr 3, 2020

Conversation

PrinceWaune
Copy link
Contributor

Copy link
Member

@ryasmi ryasmi left a comment

Choose a reason for hiding this comment

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

One little comment on code duplication @PrinceWaune but this is good 👍 No need to change in this PR.

@@ -18,4 +19,16 @@ describe('createPersona', () => {
assert.equal(actualPersona.name, 'Dave');
assert.equal(actualPersona.organisation, TEST_ORGANISATION);
});

it('Should create a persona with personaId instead name, if name not exists.', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Great work testing this 👍

name: opts.name,
organisation: new ObjectID(opts.organisation),
};
const personaId = new ObjectID();
Copy link
Member

Choose a reason for hiding this comment

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

Generating this ahead of time and using it as the name is a smart solution, nicely done 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

@ryansmith94 I'm not sure it's a good idea to drop the id into the name field on the db. I feel a name field should hold the name, and the change should be just done in the ui?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I totally agree, If I remember correctly we had discussed that as the preferred option but I think it was difficult to implement as it would require changes to the pipelines when personas were chosen.

Copy link
Member

Choose a reason for hiding this comment

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


// Formats the persona to be returned.
const persona: Persona = {
id: opResult.insertedId.toString(),
name: opts.name,
name: Boolean(opts.name) ? opts.name : personaId.toString(),
Copy link
Member

Choose a reason for hiding this comment

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

In future, we should try to use a variable instead to avoid code duplication (line 24 and line 17).

@@ -1,7 +1,7 @@
// tslint:disable-next-line:no-unused
import PersonaModel from '../../models/Persona';
import service from '../../tester';
import { TEST_ORGANISATION } from '../utils/values';
import { TEST_ORGANISATION } from './values';
Copy link
Member

Choose a reason for hiding this comment

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

Nice thanks for the correction 👍

@ryasmi ryasmi merged commit 178726d into master Apr 3, 2020
@ryasmi ryasmi deleted the LLC-57-personas-with-no-name branch April 3, 2020 13:39
@HT2Bot
Copy link
Member

HT2Bot commented Apr 3, 2020

🎉 This PR is included in version 1.7.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ryasmi
Copy link
Member

ryasmi commented Apr 3, 2020

@PrinceWaune assuming automatic releases still work as expected here, this will now create a release and Semantic Release will comment on this issue when that is done with the version number. Please use that version to update the package.json and yarn.lock in your Enterprise PR 👍

@HT2Bot HT2Bot added the released label Apr 3, 2020
@PrinceWaune
Copy link
Contributor Author

Great! Thanks for the release!

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

Successfully merging this pull request may close these issues.

5 participants