Skip to content

Commit ae83731

Browse files
fix(*): update app to work with CLI 2.0
1 parent c82e637 commit ae83731

File tree

6 files changed

+47
-37
lines changed

6 files changed

+47
-37
lines changed

package-lock.json

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
"lint": "ng lint",
1010
"e2e": "ng e2e",
1111
"build-watch": "ng build --watch",
12-
"sync": "./node_modules/.bin/watch --wait=3 \"echo Account: ${npm_config_account} && npm run ${npm_config_serverType} --account=${npm_config_account} && echo 'App is synced!'\" dist",
13-
"sas9": "rsync -avhe ssh ./dist/* --delete ${npm_config_account}@sas.domain.com:/opt/sas/sas9/config/Lev1/Web/WebServer/htdocs/${npm_config_account}/ngseed",
14-
"viya": "rsync -avhe ssh ./dist/* --delete ${npm_config_account}@sas.domain.com:/var/www/html/${npm_config_account}/ngseed"
12+
"deploy": "rsync -avhe ssh ./dist/* --delete $SSH_ACCOUNT:$DEPLOY_PATH",
13+
"sync": "./node_modules/.bin/watch --wait=3 \"echo Account: $SSH_ACCOUNT && npm run deploy && echo 'App is synced!'\" dist"
1514
},
1615
"private": true,
1716
"dependencies": {
@@ -28,7 +27,8 @@
2827
"@clr/core": "3.1.2",
2928
"@clr/icons": "4.0.8",
3029
"@clr/ui": "4.0.8",
31-
"@sasjs/adapter": "^2.0.0",
30+
"@sasjs/adapter": "^2.0.2",
31+
"@sasjs/core": "^2.2.1",
3232
"@webcomponents/webcomponentsjs": "^2.5.0",
3333
"moment": "^2.29.1",
3434
"rxjs": "~6.6.3",

sasjs/sasjsconfig.json

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"macroFolders": ["macros"],
33
"programFolders": [],
44
"serviceConfig": {
5-
"serviceFolders": [],
5+
"serviceFolders": ["services/common"],
66
"initProgram": "",
77
"termProgram": "",
88
"macroVars": {}
@@ -22,28 +22,31 @@
2222
"targets": [
2323
{
2424
"name": "viya",
25+
"serverUrl": "https://sas.analytium.co.uk",
2526
"serverType": "SASVIYA",
26-
"serverUrl": "YOURSASVIYASERVER",
2727
"appLoc": "/Public/app/angular-seed-app",
28-
"contextName": "SAS Job Execution compute context",
28+
"macroFolders": [],
29+
"programFolders": [],
30+
"authConfig": {
31+
"access_token": "",
32+
"refresh_token": "",
33+
"client": "",
34+
"secret": ""
35+
},
2936
"buildConfig": {
3037
"buildOutputFileName": "myviyadeploy.sas",
3138
"initProgram": "",
3239
"termProgram": "",
3340
"macroVars": {}
3441
},
35-
"deployConfig": {
36-
"deployServicePack": true,
37-
"deployScripts": ["sasjsbuild/myviyadeploy.sas"]
38-
},
39-
"serviceConfig": {
40-
"serviceFolders": [],
42+
"jobConfig": {
43+
"jobFolders": [],
4144
"initProgram": "",
4245
"termProgram": "",
4346
"macroVars": {}
4447
},
45-
"jobConfig": {
46-
"jobFolders": [],
48+
"serviceConfig": {
49+
"serviceFolders": [],
4750
"initProgram": "",
4851
"termProgram": "",
4952
"macroVars": {}
@@ -53,13 +56,17 @@
5356
"streamWeb": false,
5457
"streamWebFolder": "webv",
5558
"webSourcePath": "dist"
59+
},
60+
"deployConfig": {
61+
"deployServicePack": true,
62+
"deployScripts": ["sasjsbuild/myviyadeploy.sas"]
5663
}
5764
},
5865
{
5966
"name": "sas9",
6067
"serverType": "SAS9",
6168
"serverUrl": "YOURSAS9SERVER",
62-
"appLoc": "/User Folders/&sysuserid/My Folder/angular-seed-app",
69+
"appLoc": "/Public/app/angular-seed-app",
6370
"buildConfig": {
6471
"buildOutputFileName": "mysas9deploy.sas"
6572
},
@@ -79,7 +86,6 @@
7986
"termProgram": "",
8087
"macroVars": {}
8188
},
82-
8389
"serverName": "SASApp",
8490
"repositoryName": "Foundation",
8591
"streamConfig": {
@@ -90,4 +96,4 @@
9096
}
9197
}
9298
]
93-
}
99+
}

sasjs/services/common/getdata.sas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
88
**/
99

10+
%webout(FETCH)
11+
1012
proc sql;
1113
create table springs as select * from sashelp.springs
1214
where area in (select area from areas);

src/app/data/data.component.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SasService } from '../sas.service';
55
@Component({
66
selector: 'app-data',
77
templateUrl: './data.component.html',
8-
styleUrls: ['./data.component.scss']
8+
styleUrls: ['./data.component.scss'],
99
})
1010
export class DataComponent implements OnInit {
1111
public areas: any[] = [];
@@ -14,11 +14,8 @@ export class DataComponent implements OnInit {
1414
public springsLoading: boolean = false;
1515

1616
public displayedColumns: string[] = ['LATITUDE', 'LONGITUDE', 'NAME', 'AREA', 'TYPE', 'FARENHEIT', 'CELSIUS'];
17-
18-
constructor(
19-
private stateService: StateService,
20-
private sasService: SasService
21-
) { }
17+
18+
constructor(private stateService: StateService, private sasService: SasService) {}
2219

2320
ngOnInit(): void {
2421
this.stateService.startupData.subscribe((data: any) => {
@@ -28,9 +25,9 @@ export class DataComponent implements OnInit {
2825

2926
public submitData() {
3027
this.springsLoading = true;
31-
let data = {areas: [{ area: this.selectedArea }]};
28+
let data = { areas: [{ area: this.selectedArea }] };
3229

33-
this.sasService.request("common/getdata", data).then((res: any) => {
30+
this.sasService.request('services/common/getdata', data).then((res: any) => {
3431
this.springs = res['springs'];
3532
this.springsLoading = false;
3633
});

src/app/sas.service.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ import SASjs from '@sasjs/adapter';
44
import { StateService } from './state.service';
55

66
@Injectable({
7-
providedIn: 'root'
7+
providedIn: 'root',
88
})
99
export class SasService {
1010
private _sasService: any;
1111

1212
constructor(private stateService: StateService) {
1313
this._sasService = new SASjs({
1414
serverUrl: '',
15-
appLoc: '/Public/app/angular',
15+
appLoc: '/Public/app/angular-seed-app',
1616
serverType: 'SASVIYA',
1717
debug: true,
1818
useComputeApi: true,
19-
contextName: 'SAS Job Execution compute context'
19+
contextName: 'SAS Job Execution compute context',
2020
});
2121
}
2222

2323
public fetchStartupData() {
24-
this.request('common/appinit', null).then((response: any) => {
24+
this.request('services/common/appinit', null).then((response: any) => {
2525
console.log(response);
2626
this.stateService.setStartupData(response.areas);
2727
});
@@ -44,9 +44,9 @@ export class SasService {
4444
if (this.stateService.username.getValue().length < 1 && res.MF_GETUSER) {
4545
this.stateService.username.next(res.MF_GETUSER);
4646
}
47-
47+
4848
if (res.status === 404) {
49-
reject({MESSAGE: res.body || 'SAS responded with an error'})
49+
reject({ MESSAGE: res.body || 'SAS responded with an error' });
5050
}
5151

5252
resolve(res);
@@ -102,4 +102,4 @@ export class SasService {
102102
public setDebugState(state: boolean) {
103103
this._sasService.setDebugState(state);
104104
}
105-
}
105+
}

0 commit comments

Comments
 (0)