-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1502 from SciCatProject/master
11-13-2024 release
- Loading branch information
Showing
9 changed files
with
85 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"generatorName": "python", | ||
"packageName": "scicat-sdk-py", | ||
"projectName": "scicat-sdk-py" | ||
"packageName": "scicat_sdk_py", | ||
"projectName": "scicat_sdk_py" | ||
} |
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,5 +1,5 @@ | ||
{ | ||
"generatorName": "python-pydantic-v1", | ||
"packageName": "scicat-sdk-pydantic", | ||
"projectName": "scicat-sdk-pydantic" | ||
"packageName": "scicat_sdk_pydantic", | ||
"projectName": "scicat_sdk_pydantic" | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,31 @@ | ||
import { Injectable } from "@nestjs/common"; | ||
import config from "../config/frontend.config.json"; | ||
import theme from "../config/frontend.theme.json"; | ||
import { ConfigService } from "@nestjs/config"; | ||
|
||
@Injectable() | ||
export class AdminService { | ||
constructor(private configService: ConfigService) {} | ||
|
||
async getConfig(): Promise<Record<string, unknown> | null> { | ||
return config; | ||
const modifiedConfig = this.applyBackendConfigAdjustments(); | ||
|
||
return modifiedConfig; | ||
} | ||
|
||
async getTheme(): Promise<Record<string, unknown> | null> { | ||
return theme; | ||
} | ||
|
||
// NOTE: Adjusts backend config values for frontend use (e.g., file upload limits). | ||
// Add future backend-dependent adjustments here as needed. | ||
private applyBackendConfigAdjustments(): Record<string, unknown> { | ||
const postEncodedMaxFileUploadSize = | ||
this.configService.get<string>("maxFileUploadSizeInMb") || "16mb"; | ||
|
||
return { | ||
...config, | ||
maxFileUploadSizeInMb: postEncodedMaxFileUploadSize, | ||
}; | ||
} | ||
} |
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