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

PartTemplate work #293

Merged
merged 7 commits into from
Nov 19, 2021
Merged

PartTemplate work #293

merged 7 commits into from
Nov 19, 2021

Conversation

RossStewart
Copy link
Contributor

PR for PartTemplate work. Initial backend submitted more submissions and tests to follow.

@RossStewart RossStewart linked an issue Nov 12, 2021 that may be closed by this pull request
@RossStewart RossStewart requested review from lewisrenfrew, richardiphillips, andrewfraser73, iaincrawf and a team and removed request for lewisrenfrew November 12, 2021 16:38
Copy link
Collaborator

@richardiphillips richardiphillips left a comment

Choose a reason for hiding this comment

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

Looks good. Needs a couple of integration tests added for put and post i think.

public class PartTemplateResponseProcessor : JsonResponseProcessor<PartTemplate>
{
public PartTemplateResponseProcessor(IResourceBuilder<PartTemplate> resourceBuilder)
: base(resourceBuilder, "linnapps-part-templates", 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be the singular. "linnapps-part-template"

[SetUp]
public void SetUp()
{
var a = new PartTemplate
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'd use a more descriptive variable name than a

resource.PartRoot.Should().Be("PARTTEMP");
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we tend to add a newline at the end of files to stop github complaining at us

var result = this.partTemplateService.Add(resource);
return this.Negotiate.WithStatusCode(HttpStatusCode.Created)
.WithModel(result)
.WithMediaRangeModel("text/html", ApplicationSettings.Get)
Copy link
Collaborator

Choose a reason for hiding this comment

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

you don't need to handle html here because it will never be requested in a PUT or a POST

@@ -0,0 +1,59 @@
namespace Linn.Stores.Service.Tests.PartsModuleSpecs
{
using System.Collections.Generic;
Copy link
Collaborator

Choose a reason for hiding this comment

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

are these usings needed for the get by id?

{
var a = new PartTemplate
{
PartRoot = "PARTTEMP"
Copy link
Collaborator

Choose a reason for hiding this comment

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

it might be nice to declare "PARTTEMP" into a string field and then you can reference it against all the tests which avoids typos and also makes it clear what's being tested

AccountingCompany = model.AccountingCompany,
ProductCode = model.ProductCode,
StockControlled = model.StockControlled,
LinnProduced = model.LinnProduced,
RmFg = model.RmFg,
BomType = model.BomType,
AssemblyTechnology = model.AssemblyTechnology,
AllowPartCreation = model.AllowPartCreation,
Copy link
Collaborator

Choose a reason for hiding this comment

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

remember you can set the "self" linkrel in GetLocation down below

@@ -35,7 +35,7 @@ public IQueryable<PartTemplate> FindAll()

Copy link
Collaborator

Choose a reason for hiding this comment

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

remember to take off AsNoTracking up above if we're amending these things now

@RossStewart
Copy link
Contributor Author

No worries, was going to add a few more tests on Monday morning so I’ll make these cha ges then too!

@@ -6,13 +6,16 @@ import partsSelectors from '../../selectors/partsSelectors';
import { getPrivileges } from '../../selectors/userSelectors';
import partTemplatesActions from '../../actions/partTemplatesActions';
import partTemplatesSelectors from '../../selectors/partTemplatesSelectors';
import partTemplateActions from '../../actions/partTemplatesActions';
import partTemplateSelectors from '../../selectors/partTemplatesSelectors';

Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need these extra action creators and selectors in the parts container?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also just realised I never got you set up witht the linter which would have complained about this most likely. Give me a shout today and I can try and remember what we need to do to get it working

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can talk about it after stand up if you're about

@RossStewart RossStewart merged commit 184491d into master Nov 19, 2021
@RossStewart RossStewart deleted the StoresPartsUIChanges branch November 19, 2021 16:25
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.

Part Templates ui
3 participants