Skip to content

Commit

Permalink
chore: housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
maximizeIT committed Jun 27, 2024
1 parent e6d7b44 commit 0101058
Show file tree
Hide file tree
Showing 43 changed files with 3,765 additions and 4,582 deletions.
2 changes: 1 addition & 1 deletion samples/weather-forecast/dev/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/dev/config.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/dev/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/dev/utils/DataUtil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
5 changes: 4 additions & 1 deletion samples/weather-forecast/dev/widget-api-mock/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -19,11 +19,14 @@ import {
getUserInformationByExternalId,
} from "./user";

import getIntegration from "./integrations"

const apiMock: WidgetApi = {
getLegacyAppTheme,
getUserInformation,
getUserList,
getUserInformationByExternalId,
getIntegration
};

export default apiMock;
32 changes: 32 additions & 0 deletions samples/weather-forecast/dev/widget-api-mock/integrations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*!
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://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.
*/

import {IntegrationInformation, IntegrationStates, IntegrationType} from '@staffbase/widget-sdk'

export default async (_type: IntegrationType): Promise<IntegrationInformation> => {
const date = new Date();
const expireDate = new Date();

expireDate.setDate(date.getDate() + 1);

return {
status: IntegrationStates.AVAILABLE,
enabledFeatures: ['foo'],
supportedFeatures: ['foo'],
token: {
accessToken: "fooToken",
accessTokenExpiresAt: expireDate
},
signIn: () => { console.log('Sign in') }
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
13 changes: 11 additions & 2 deletions samples/weather-forecast/dev/widget-api-mock/user.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -18,8 +18,17 @@ import {
} from "@staffbase/widget-sdk";

const user: SBUserProfile = {
id: "5c35e4feea2d15e6ffa8251d",
externalID: "abc123",
primaryEmail: "[email protected]",
primaryUsername: "lucy.liu",
firstName: "Lucy",
lastName: "Liu",
phoneNumber: "09124456",
publicEmailAddress: "[email protected]",
location: "New York",
position: "Sales Representative",
department: "Sales",
};

export const getUserInformation = async (
Expand All @@ -33,7 +42,7 @@ export const getUserInformationByExternalId = async (
export const getUserList = async (
_query: UserListRequestQuery
): Promise<UserListResponse> => ({
data: [{ id: "5c35e4feea2d15e6ffa8251d", ...user }],
data: [user, {id: "5e43c6feca2d15e6afa8231d", firstName: "Tony", lastName: "Stark"}],
offset: 0,
limit: 1,
total: 1,
Expand Down
54 changes: 27 additions & 27 deletions samples/weather-forecast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@
"author": "",
"license": "ISC",
"dependencies": {
"@staffbase/widget-sdk": "^3.3.3",
"acorn": "^8.4.1",
"@staffbase/widget-sdk": "^3.12.8",
"acorn": "^8.11.3",
"axios": "0.21.1",
"date-fns": "^2.23.0",
"dayjs": "1.10.6",
"openweather-apis": "4.4.2",
"dayjs": "1.11.11",
"openweather-apis": "4.5.0",
"react": "^17.0.2",
"react-cool-dimensions": "^2.0.7",
"react-dom": "^17.0.2",
"react-query": "3.21.1",
"regenerator-runtime": "0.13.9"
"react-query": "3.39.3",
"regenerator-runtime": "0.14.1"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-object-rest-spread": "^7.14.7",
"@babel/core": "^7.24.7",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.15.0",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.15.0",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@rjsf/core": "^3.0.0",
"@rjsf/material-ui": "^3.0.0",
"@svgr/webpack": "6.5.1",
Expand All @@ -47,36 +47,36 @@
"@testing-library/react": "12.0.0",
"@testing-library/react-hooks": "7.0.2",
"@types/copy-webpack-plugin": "^8.0.1",
"@types/node": "16.7.10",
"@types/react": "^17.0.19",
"@types/react-dom": "^17.0.9",
"@types/webpack": "5.28.0",
"@types/node": "16.11.9",
"@types/react": "^17.0.36",
"@types/react-dom": "^17.0.11",
"@types/webpack": "5.28.5",
"@types/webpack-dev-server": "4.1.0",
"@typescript-eslint/eslint-plugin": "4.30.0",
"@typescript-eslint/parser": "4.30.0",
"@ungap/custom-elements": "1.0.0",
"@ungap/custom-elements": "1.3.0",
"babel-eslint": "10.1.0",
"babel-loader": "^8.2.2",
"copy-webpack-plugin": "^9.0.1",
"core-js": "3.17.1",
"core-js": "3.37.1",
"eslint": "7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "4.0.0",
"file-loader": "^6.2.0",
"jest": "27.1.0",
"jest-json-schema": "^5.0.0",
"js-base64": "3.6.1",
"minimal-polyfills": "2.2.1",
"js-base64": "3.7.7",
"minimal-polyfills": "2.2.3",
"prettier": "2.3.2",
"react-svg-loader": "^3.0.3",
"ts-loader": "^9.2.5",
"ts-node": "10.2.1",
"typescript": "4.4.2",
"ts-loader": "^9.5.1",
"ts-node": "10.9.2",
"typescript": "4.5.2",
"url-loader": "^4.1.1",
"webpack": "^5.51.1",
"webpack": "^5.91.0",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.1.0",
"webpack-merge": "^5.8.0"
"webpack-merge": "^5.10.0"
},
"jest": {
"setupFilesAfterEnv": [
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/api/mockData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/api/openGeoApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/api/openWeatherMapApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/api/useCity.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/api/useCity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
6 changes: 3 additions & 3 deletions samples/weather-forecast/src/api/useWeather.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down Expand Up @@ -38,7 +38,7 @@ setLogger({
});

describe("useWeather", () => {
const endpoint = "https://api.openweathermap.org/data/2.5/onecall";
const endpoint = "https://api.openweathermap.org/data/3.0/onecall";
afterEach(() => {
queryClient.clear();
});
Expand Down Expand Up @@ -104,7 +104,7 @@ describe("useWeather", () => {
});

expect(result.current.error).toEqual(
new TypeError("Cannot read property 'map' of undefined")
new TypeError("Cannot read properties of undefined (reading 'map')")
);
expect(log).toHaveBeenCalledTimes(1);
});
Expand Down
4 changes: 2 additions & 2 deletions samples/weather-forecast/src/api/useWeather.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down Expand Up @@ -89,7 +89,7 @@ type ForecastOptions = {
const getWeather = async ({
queryKey: [, options],
}: QueryFunctionContext<[string, ForecastOptions]>) => {
const endpoint = "https://api.openweathermap.org/data/2.5/onecall";
const endpoint = "https://api.openweathermap.org/data/3.0/onecall";
const {
units = "standard",
lang = options.lang ?? "en",
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/api/weatherIcon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/components/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/components/ErrorBox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/components/InfoBox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/configuration-schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion samples/weather-forecast/src/custom.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2021, Staffbase GmbH and contributors.
* Copyright 2024, Staffbase GmbH and contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Loading

0 comments on commit 0101058

Please sign in to comment.