I am doing RIA application with QooXDoo, I want to use Dialog like windows to prompt & notify the user.
I have used dialog contrib from qooxdoo. But i got following error when i am trying to run
dialog.Dialog.warning( "I warned you!" );
Error in property decorator of class dialog.Alert in method setDecorator with incoming value 'shadow-popup': Is invalid!
I did added Dialog contrib in "config.json" file as follows.
"libraries" :
{
"library" :
[
{
"manifest" : "../qx-contrib-Dialog-master/Manifest.json"
}
]
}
Can any one guess what is the problem?
Thanks in advance.
Can you give some context?
Which version of qooxdoo and qx-contrib-Dialog are you using?
Which type of application are you developing (contribution|desktop|inline|mobile|native|server|website)?
Do you get an error message when running ./generate.py source?
I'm not sure what your problem is but when starting from scratch everything works for me (using qooxdoo-2.1, creating a desktop app and using the current head of the master branch from qx-contrib-Dialog):
$ cd workspace
$ wget/unzip => qooxdoo-2.1-sdk/ // I've already done that before...
$ ./qooxdoo-2.1-sdk/create-application.py -n stackoverflow
$ git clone https://github.com/cboulanger/qx-contrib-Dialog.git
file system at this moment:
workspace/
|-- qooxdoo-2.1-sdk/
| |-- application/
| |-- component/
| |-- create-application.py
| `-- ...
|-- qx-contrib-Dialog/
| |-- Manifest.json
| |-- README.md
| |-- demo/
| |-- qooxdoo/
| `-- source/
|-- stackoverflow/
| |-- Manifest.json
| |-- config.json
| |-- generate.py
| |-- readme.txt
| `-- source/
$ cd stackoverflow
$ vim config.json
config.json
.-----------
| ...
| "libraries" :
| {
| "library" :
| [
| {
| "manifest" : "../qx-contrib-Dialog/Manifest.json"
| }
| ]
| }
| ...
$ ./generate.py source
$ vim source/class/stackoverflow/Application.js
Application.js (adapted with reference to the demo on github [1])
.-----------
| ...
| // Add an event listener
| button1.addListener("execute", function(e) {
| // alert("Hello World!");
| dialog.Dialog.warning( "I warned you!" );
| });
| ...
|
$ ./generate.py source (cause the dialog classes aren't known yet)
Open app in your browser! :)
[1] https://github.com/cboulanger/qx-contrib-Dialog
Finally i got the solution for this error.
I just removed the following line from Dialog.js file, after that all are working fine.
'decorator' : "shadow-popup"
But shadow effect is missing.
So i did wrote a decorator named "shadow-popup" in theme file.
Thank you.
Related
I have Installed npm install pdfjs-dist i want to load PDF on the browser on mobile phones. However I am getting the below error. How can i resolve this?
Failed to compile.
./node_modules/pdfjs-dist/build/pdf.js
SyntaxError: C:\node\node_modules\pdfjs-dist\build\pdf.js: Missing class properties transform.
3520 |
3521 | class PixelsPerInch {
> 3522 | static CSS = 96.0;
| ^^^^^^^^^^^^^^^^^^
3523 | static PDF = 72.0;
3524 | static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
3525 | }
I am working to migrate a React app to the latest v17.x version (from 16.13.0).
However I am getting parsing errors on the typescript files when I upgrade React (the app uses javascript mostly, but some files were later added in typescript).
e.g.
src\components\data\Assets\FYAsset.ts
Line 2:11: Parsing error: Unexpected token
1 | export class FYAsset {
> 2 | private apiData: Object | undefined; // the res data, as received from the API
| ^
3 |
4 | private id: number | undefined;
5 | private providerId: number | undefined;
src\components\data\Users\FYUser.ts
Line 5:19: Parsing error: Unexpected token
3 |
4 | export class FYUserConstants {
> 5 | static readonly USERGROUPID_ADMIN = 1;
| ^
6 | static readonly USERGROUPLABEL_ADMIN = "ADMIN";
7 | //
8 | static readonly USERGROUPID_EXPERT = 2;
The old app uses the following versions (which work fine):
react-scripts v3.4.0
react/react-dom v16.13.0
typescript v3.8.3
For the migration, the errors appear when I move over to react-scripts v4.0.1 and react v17.0.1. I tried upgrading typescript to v4.1.3 but that didn't change anything.
Again, everything works fine in the previous branch. Could you suspect what causes the issues?
Thanks
The problem was solved by deleting the .eslintcache file that was carried over from the legacy project.
I have a nginx hosted on a VM with an authentication service that expose a simple login page and some other services hosted onto a secondary VM (create-react-app builds served through serve -s build).
If the user tries to access a protected resource gets promped the login page.
The architecture is as follow:
+-------------------------------+
| Other VM |
| |
| +-----------------------+ |
| |serve -s build -l 8000 | |
+--------------------> localhost:8000 | |
| /resource1 | | | |
| | +-----------------------+ |
| | |
+----------+ | | |
| | | | +-----------------------+ |
/static? | Linux | | | |serve -s build -l 7000 | |
+---------->+ nginx +-----+--------------------> localhost:7000 | |
| Auth sys | /resource2 | | | |
| | | +-----------------------+ |
+----------+ | |
| ● |
| ● |
| ● |
| |
| |
+-------------------------------+
I have correctly configured nginx to reverse proxy all the resources.
resource1, resource2, resourcen and auth system access to a /static folder to take css, js, etc...
I have done a "workaround" to retrieve the correct static folder that is as follow:
location /static {
try_files $uri $uri/ =404;
if ($http_referer ~ ^http://linuxhostname/resource1) {
proxy_pass http://otherVMhostname:8000;
}
if ($http_referer ~ ^http://linuxhostname/resource2) {
proxy_pass http://otherVMhostname:7000;
}
}
Seemed to work fine until I faced this situation:
trying to access /resource1 without authentication:
The user is requesting /resource1 but the login page is prompted, nginx is proxying static files onto the other vm while they are on its file system, this results in a 404 error.
To mitigate this issue I thought to change the static folder name into something specific (e.g. for resource1, put static_r1) but I found that is not straightforward (see this link).
Do you have any ideas on how this can be approached nginx side or application side?
Thanks
After some experience and the updates made to the create-react-app I learned that you can use an environment variable when you build your package that is PUBLIC_URL=basepath.
This will make the index.html (the entrypoint of the React SPA) look for static files inside /basepath/static, hence by setting this variable the job is done.
The only thing you need to be aware of is the actual path on the websever, for example: if you use the nginx directive try_files $uri it will actually look inside $root_dir/basepath since the $uri will contain the base path.
I'm getting a strange error to which I can't find the cause.
I have 2 npm packages using typescript:
ione/common
react-auth (requires common)
When building react-auth (tsc -p tsconfig.json), I'm getting:
[I] ➜ yarn build
yarn run v1.6.0
$ tsc -p tsconfig.json
node_modules/#ione/common/dist/components/router/IoneLink.d.ts:5:144 - error TS2344: Type '"media" | "hidden" | "dir" | "slot" | "style" | "title" | "color" | "children" | "replace" | "dow...' does not satisfy the constraint '"media" | "hidden" | "dir" | "slot" | "style" | "title" | "color" | "children" | "location" | "re...'.
Type '"css"' is not assignable to type '"media" | "hidden" | "dir" | "slot" | "style" | "title" | "color" | "children" | "location" | "re...'.
Yet, react-auth is not using IoneLink component which is inside ione/common package.
I checked the dependency versions of both packages, and their #types requirements, they're both the same.
The props interface for this IoneLink component is this:
import { Link, LinkProps } from 'react-router-dom';
import { RouteComponentProps, withRouter } from 'react-router';
declare type Props < P > =
LinkProps &
RouteComponentProps<P> &
React.AnchorHTMLAttributes<HTMLAnchorElement>;
Which is indeed large, but does not contain a css attribute.
Thank you!
I managed to pinpoint the issue to the emotion npm package.
After adding emotion in the types key of the tsconfig file, it built correctly without errors.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I finished creating the tree, just need help on how to move sample_dir1 (which is a sub directory of the home directory) into sample_dir using relative pathname. Viewing the tree below will make the question much easier to understand:
$
ULI101 Assignment 2.3: Practice Specifying Path Names Page 3/15
--------------------------------------------------------------------------------
sample_dir1
`-- sample_dir
|-- admin
|-- cambridge
| |-- cafeteria
| |-- library
| `-- security
| |-- annex
| |-- building
| `-- parking
|-- faculty
|-- history.exe
|-- markham
| |-- annex
| |-- building1
| `-- parking
|-- oxford
| |-- outline.doc
| |-- programming
| | `-- report.pdf
| `-- security
`-- stenton
|-- gen_ed
`-- lib_arts
|-- english.txt
`-- match.doc
sample_dir1 is a subdirectory of your current (home) directory. Move to
sample_dir using a relative pathname:
sudo mv sample_dir1/ sample_dir/
Replace the sample_dir1/ with the actual location then replace sample_dir/ with the new location.
try it in local example directory , if you are existing in sample_dir
then : mv ../sample_dir1 ../sample_dir/
if did not work i am pretty sure i am not understanding your question or the path names are not clear enough to me