-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allows resource related project member or admin to edit its prop…
- Loading branch information
Showing
11 changed files
with
161 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// state/config.state.ts | ||
import { Injectable } from '@angular/core'; | ||
import { DspAppConfig } from '@dasch-swiss/vre/shared/app-config'; | ||
import { State, Action, StateContext, Selector } from '@ngxs/store'; | ||
|
||
export class SetConfigAction { | ||
static readonly type = '[Config] Set'; | ||
constructor(public configStateModel: ConfigStateModel) {} | ||
} | ||
|
||
export interface ConfigStateModel { | ||
dspAppConfig: DspAppConfig; | ||
} | ||
|
||
@State<ConfigStateModel>({ | ||
name: 'config', | ||
defaults: { | ||
dspAppConfig: {} as DspAppConfig, | ||
}, | ||
}) | ||
@Injectable() | ||
export class ConfigState { | ||
@Action(SetConfigAction) | ||
setConfig(ctx: StateContext<ConfigStateModel>, action: SetConfigAction) { | ||
ctx.setState(action.configStateModel); | ||
} | ||
|
||
@Selector([ConfigState]) | ||
static getConfig(state: ConfigStateModel): DspAppConfig { | ||
return state.dspAppConfig; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
libs/vre/shared/app-state/src/lib/resource/resource.state-model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { ReadProject, ReadUser } from '@dasch-swiss/dsp-js'; | ||
import { DspResource } from '@dasch-swiss/vre/shared/app-common'; | ||
import { IKeyValuePairs } from '../model-interfaces'; | ||
|
||
export class ReourceStateModel { | ||
isLoading = false; | ||
attachedUsers: IKeyValuePairs<ReadUser> = {}; | ||
attachedProjects: IKeyValuePairs<ReadProject> = {}; | ||
resource: DspResource | null = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters