-
Notifications
You must be signed in to change notification settings - Fork 18
Feat/color schemes rework #3878
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
Draft
ErikPre
wants to merge
8
commits into
CactuseSecurity:importer-rework
Choose a base branch
from
Laennart:feat/color-schemes-rework
base: importer-rework
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+113
−40
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a453a51
feat: Color into Rework branch
ErikPre 9a31171
Merge branch 'importer-rework' into feat/color-schemes-rework
ErikPre fa0dafe
feat: rename update sql to newest version
ErikPre 4b71211
fix: unused reference
ErikPre 378b4d1
fix: Color Schmeme Naming
ErikPre f7864d6
fix: duplicates
ErikPre d72220b
feat: removed unused ColorScheme Service
ErikPre d7824cc
fix: removed update sql
ErikPre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,44 @@ | ||
| using System.Text.Json.Serialization; | ||
| using Newtonsoft.Json; | ||
|
|
||
| namespace FWO.Config.Api.Data | ||
| { | ||
| /// <summary> | ||
| /// a list of all available ColorSchemes | ||
| /// </summary> | ||
| public class ColorScheme | ||
| { | ||
| [JsonProperty("name"), JsonPropertyName("name")] | ||
| public string Name { get; set; } = ""; | ||
|
|
||
| [JsonProperty("isDefault"), JsonPropertyName("isDefault")] | ||
| public bool IsDefault { get; set; } = false; | ||
|
|
||
| [JsonProperty("hex"), JsonPropertyName("hex")] | ||
| public string Hex { get; set; } = ""; | ||
|
|
||
| [JsonProperty("hex2"), JsonPropertyName("hex2")] | ||
| public string Hex2 { get; set; } = ""; | ||
|
|
||
| [JsonProperty("textHex"), JsonPropertyName("textHex")] | ||
| public string TextHex { get; set; } = ""; | ||
|
|
||
|
|
||
| public static List<ColorScheme> AvailableSchemes { get; } = new List<ColorScheme> | ||
| { | ||
| new ColorScheme { Name = "color_scheme_blue", IsDefault = true, Hex = "#054B8C", Hex2 = "#03335E", TextHex = "#2FA5ED" }, | ||
| new ColorScheme { Name = "color_scheme_green", Hex = "#1c8c05ff" , Hex2 = "#155e03ff", TextHex = "#b4ed2fff" }, | ||
| new ColorScheme { Name = "color_scheme_red", Hex = "#8c0505ff", Hex2 = "#5e0303ff", TextHex = "#ed2f2fff" }, | ||
| new ColorScheme { Name = "color_scheme_purple", Hex = "#5b058cff", Hex2 = "#3a035eff", TextHex = "#a12fedff" } | ||
| // Add more schemes as needed | ||
| }; | ||
|
|
||
| public static ColorScheme GetSchemeByName(string name) | ||
| { | ||
| return AvailableSchemes.FirstOrDefault(s => s.Name == name) ?? AvailableSchemes.First(s => s.IsDefault); | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
|
||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Calling
StateHasChanged()in the middle of theSave()method is unnecessary and could cause premature re-rendering before the save operation completes. If a state refresh is needed, it should be called after all data modifications are complete, or removed entirely if the framework handles it automatically after the async operation completes.