-
Notifications
You must be signed in to change notification settings - Fork 0
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
PartTemplate work #293
Changes from all commits
4d2436d
106b9d8
1c2f3ad
6d3a43e
010d7e2
f9fb20d
d6438ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ public PartTemplate FindById(string key) | |
{ | ||
return this.serviceDbContext | ||
.PartTemplates | ||
.AsNoTracking() | ||
.Where(p => p.PartRoot == key) | ||
.ToList() | ||
.FirstOrDefault(); | ||
|
@@ -35,7 +34,7 @@ public IQueryable<PartTemplate> FindAll() | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
public void Add(PartTemplate entity) | ||
{ | ||
throw new NotImplementedException(); | ||
this.serviceDbContext.PartTemplates.Add(entity); | ||
} | ||
|
||
public void Remove(PartTemplate entity) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { UpdateApiActions } from '@linn-it/linn-form-components-library'; | ||
import { partTemplateActionTypes as actionTypes } from './index'; | ||
import * as itemTypes from '../itemTypes'; | ||
import config from '../config'; | ||
|
||
export default new UpdateApiActions( | ||
itemTypes.partTemplate.item, | ||
itemTypes.partTemplate.actionType, | ||
itemTypes.partTemplate.uri, | ||
actionTypes, | ||
config.appRoot | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,15 @@ import partsSelectors from '../../selectors/partsSelectors'; | |
import { getPrivileges } from '../../selectors/userSelectors'; | ||
import partTemplatesActions from '../../actions/partTemplatesActions'; | ||
import partTemplatesSelectors from '../../selectors/partTemplatesSelectors'; | ||
import partTemplateSelectors from '../../selectors/partTemplateSelectors'; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can talk about it after stand up if you're about |
||
const mapStateToProps = (state, { match }) => ({ | ||
linkToSources: match?.url?.endsWith('/sources'), | ||
items: partsSelectors.getSearchItems(state), | ||
loading: partsSelectors.getSearchLoading(state), | ||
privileges: getPrivileges(state), | ||
partTemplates: partTemplatesSelectors.getItems(state) | ||
partTemplates: partTemplatesSelectors.getItems(state), | ||
partTemplate: partTemplateSelectors.getItem(state) | ||
}); | ||
|
||
const initialise = () => dispatch => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { collectionStoreFactory } from '@linn-it/linn-form-components-library'; | ||
import { partTemplateActionTypes as actionTypes } from '../../actions'; | ||
import * as itemTypes from '../../itemTypes'; | ||
|
||
const defaultState = { | ||
loading: false, | ||
items: [] | ||
}; | ||
|
||
export default collectionStoreFactory( | ||
itemTypes.partTemplate.actionType, | ||
actionTypes, | ||
defaultState | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { ItemSelectors } from '@linn-it/linn-form-components-library'; | ||
import * as itemTypes from '../itemTypes'; | ||
|
||
export default new ItemSelectors(itemTypes.partTemplate.item); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Linn.Stores.Service.ResponseProcessors | ||
{ | ||
using System.Collections.Generic; | ||
using Linn.Common.Facade; | ||
using Linn.Common.Nancy.Facade; | ||
using Linn.Stores.Domain.LinnApps.Parts; | ||
|
||
public class PartTemplateResponseProcessor : JsonResponseProcessor<PartTemplate> | ||
{ | ||
public PartTemplateResponseProcessor(IResourceBuilder<PartTemplate> resourceBuilder) | ||
: base(resourceBuilder, "linnapps-part-template", 1) | ||
{ | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
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