-
Notifications
You must be signed in to change notification settings - Fork 23
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 #317 from catenax-ng/main
Reload all assets on sync
- Loading branch information
Showing
79 changed files
with
1,584 additions
and
844 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
frontend/src/app/modules/core/user/table-settings.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
export interface TableViewSettings { | ||
columnsForDialog: string[], //--> string list in order how they are sorted | ||
columnSettingsOptions: Map<string,boolean>, //--> in order of sorted Rows - also source for table -> convert to list of truth | ||
columnsForTable: string[], //--> string list that saves the column string in the order of the dialog and only if they are true | ||
filterColumnsForTable: string[], | ||
} |
61 changes: 61 additions & 0 deletions
61
frontend/src/app/modules/core/user/table-settings.service.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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
import { Injectable } from '@angular/core'; | ||
import { PartTableType } from '@shared/components/table/table.model'; | ||
import { Subject } from 'rxjs'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class TableSettingsService { | ||
private settingsKey = 'TableViewSettings'; | ||
private changeEvent = new Subject<void>(); | ||
|
||
storeTableSettings(partTableType: PartTableType, tableSettingsList: any ): void { | ||
// before setting anything, all maps in new tableSettingList should be stringified | ||
Object.keys(tableSettingsList).forEach(tableSetting => { | ||
const newMap = tableSettingsList[tableSetting].columnSettingsOptions; | ||
tableSettingsList[tableSetting].columnSettingsOptions = JSON.stringify(Array.from(newMap.entries())); | ||
}) | ||
localStorage.setItem(this.settingsKey, JSON.stringify(tableSettingsList)); | ||
} | ||
|
||
// this returns whole settings whether empty / not for part / etc. | ||
getStoredTableSettings(): any { | ||
const settingsJson = localStorage.getItem(this.settingsKey); | ||
let settingsObject = settingsJson ? JSON.parse(settingsJson) : null; | ||
if(!settingsObject) return; | ||
|
||
// iterate through all tabletypes and parse columnSettingsOption to a map | ||
Object.keys(settingsObject).forEach(tableSetting => { | ||
settingsObject[tableSetting].columnSettingsOptions = new Map(JSON.parse(settingsObject[tableSetting].columnSettingsOptions)); | ||
|
||
}); | ||
return settingsObject; | ||
} | ||
|
||
emitChangeEvent() { | ||
this.changeEvent.next(); | ||
} | ||
|
||
getEvent() { | ||
return this.changeEvent.asObservable(); | ||
} | ||
} |
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
Oops, something went wrong.