Skip to content
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

global css will no longer be deleted on adapter upload/update #357

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ E.g., if it was used in a menu and the menu is red, the circle would be red.
### **WORK IN PROGRESS**
-->
## Changelog
### **WORK IN PROGRESS**
* (foxriver76) global css will no longer be deleted on adapter upload/update

### 2.9.29 (2024-02-05)
* (foxriver76) fixed multiple problems with nested groups
* (foxriver76) also made group/ungroup commands working in group view
Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ if (typeof exports !== 'undefined') {
// Create common user CSS file
let data;
try {
data = await adapter.readFileAsync(adapterName, 'css/vis-common-user.css');
data = await adapter.readFileAsync(adapter.namespace, 'vis-common-user.css');
if (typeof data === 'object') {
data = data.file;
}
Expand All @@ -244,7 +244,7 @@ if (typeof exports !== 'undefined') {
}

if (data === null || data === undefined) {
await adapter.writeFileAsync(adapterName, 'css/vis-common-user.css', '');
await adapter.writeFileAsync(adapter.namespace, 'vis-common-user.css', '');
}

return changed;
Expand Down
6 changes: 3 additions & 3 deletions src/src/Attributes/CSS.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const CSS = props => {
setTimer: setGlobalCssTimer,
value: globalCss,
setValue: setGlobalCss,
directory: props.adapterName,
file: 'css/vis-common-user.css',
directory: props.adapterId,
file: 'vis-common-user.css',
},
local: {
timer: localCssTimer,
Expand All @@ -45,7 +45,7 @@ const CSS = props => {
useEffect(() => {
const load = async () => {
try {
const commonCss = await readFile(props.socket, props.adapterId.split('.')[0], 'css/vis-common-user.css');
const commonCss = await readFile(props.socket, props.adapterId, 'vis-common-user.css');
setGlobalCss(commonCss);
} catch (e) {
if (e !== 'Not exists') {
Expand Down
2 changes: 1 addition & 1 deletion src/src/Vis/oldVis.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ class Vis {
// First of all load project/vis-user.css
// this.$('#project_css').attr('href', '/' + vis.conn.namespace + '/' + vis.projectPrefix + 'vis-user.css');
if (typeof app === 'undefined') {
const fetchCommonCss = fetch('css/vis-common-user.css')
const fetchCommonCss = fetch(`/${this.conn.namespace}/vis-common-user.css`)
.then(data => data.text())
.then(data => {
if (data && typeof app !== 'undefined' && app.replaceFilesInViewsWeb) {
Expand Down
2 changes: 1 addition & 1 deletion src/src/Vis/visEngine.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ ${this.scripts}
if (this.props.visCommonCss) {
VisEngine.applyUserStyles('vis_common_user', this.visCommonCssLoaded || '');
} else {
readFile(this.props.socket, this.props.adapterName, 'css/vis-common-user.css')
readFile(this.props.socket, this.props.adapterId, 'vis-common-user.css')
.then(file => {
this.visCommonCssLoaded = file || true;
VisEngine.applyUserStyles('vis_common_user', file || '');
Expand Down
Loading