type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction
|
res =>{
console.log(res);
this.notify.showNotification('bottom','right','info','<b>User Profile<b>','User profile updated!');
this.notify.notificationPush.push('User profile updated!');
this.clearProfile();
}
|
RaikireHiuduo/beems-angular
|
web-app/src/app/user-profile/user-profile.component.ts
|
TypeScript
|
ArrowFunction
|
err => {
console.log(err);
this.notify.showNotification('bottom','right','danger','<b>User Profile<b>','Error has occured!');
}
|
RaikireHiuduo/beems-angular
|
web-app/src/app/user-profile/user-profile.component.ts
|
TypeScript
|
ClassDeclaration
|
@Component({
selector: 'app-user-profile',
templateUrl: './user-profile.component.html',
styleUrls: ['./user-profile.component.css']
})
export class UserProfileComponent implements OnInit {
user : userProfile = new userProfile();
constructor(private _auth:AuthService, private notify : NotificationService) { }
ngOnInit() {
//retrieve user info
this._auth.getUserInfo().subscribe(res =>{
console.log(res);
this.user = {
realm : res.realm,
email : res.email,
password : null,
cfmPassword : null
}
}, err => {
console.log(err);
})
}
//Clear user profile
clearProfile() {
this.user = {
realm : '',
email : '',
password : null,
cfmPassword : null
}
}
//Update user profile
updateProfile() {
if(this.user.password == this.user.cfmPassword) {
var body = {
realm : this.user.realm,
email : this.user.email,
password : this.user.password
}
this._auth.updateUserInfo(body).subscribe(res =>{
console.log(res);
this.notify.showNotification('bottom','right','info','<b>User Profile<b>','User profile updated!');
this.notify.notificationPush.push('User profile updated!');
this.clearProfile();
}, err => {
console.log(err);
this.notify.showNotification('bottom','right','danger','<b>User Profile<b>','Error has occured!');
})
}
}
}
|
RaikireHiuduo/beems-angular
|
web-app/src/app/user-profile/user-profile.component.ts
|
TypeScript
|
MethodDeclaration
|
ngOnInit() {
//retrieve user info
this._auth.getUserInfo().subscribe(res =>{
console.log(res);
this.user = {
realm : res.realm,
email : res.email,
password : null,
cfmPassword : null
}
}, err => {
console.log(err);
})
}
|
RaikireHiuduo/beems-angular
|
web-app/src/app/user-profile/user-profile.component.ts
|
TypeScript
|
MethodDeclaration
|
//Clear user profile
clearProfile() {
this.user = {
realm : '',
email : '',
password : null,
cfmPassword : null
}
}
|
RaikireHiuduo/beems-angular
|
web-app/src/app/user-profile/user-profile.component.ts
|
TypeScript
|
MethodDeclaration
|
//Update user profile
updateProfile() {
if(this.user.password == this.user.cfmPassword) {
var body = {
realm : this.user.realm,
email : this.user.email,
password : this.user.password
}
this._auth.updateUserInfo(body).subscribe(res =>{
console.log(res);
this.notify.showNotification('bottom','right','info','<b>User Profile<b>','User profile updated!');
this.notify.notificationPush.push('User profile updated!');
this.clearProfile();
}, err => {
console.log(err);
this.notify.showNotification('bottom','right','danger','<b>User Profile<b>','Error has occured!');
})
}
}
|
RaikireHiuduo/beems-angular
|
web-app/src/app/user-profile/user-profile.component.ts
|
TypeScript
|
ArrowFunction
|
(props, context) => {
const p = { ...props, ...context.attrs };
return <AntdIcon {...p} icon={TwitterSquareFilledSvg}></AntdIcon>;
}
|
07akioni/ant-design-icons
|
packages/icons-vue/src/icons/TwitterSquareFilled.tsx
|
TypeScript
|
InterfaceDeclaration
|
export interface TwitterSquareFilledIconType extends FunctionalComponent<AntdIconProps> {
displayName: string;
}
|
07akioni/ant-design-icons
|
packages/icons-vue/src/icons/TwitterSquareFilled.tsx
|
TypeScript
|
ClassDeclaration
|
@Component({
template: `
<div class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators" *ngFor="let c of components">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active" *ngFor="let c of components">
<img class="d-block w-100" src="..." alt="First slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
`
})
export class CarouselComponent {
components = [
// GeneralRankingComponent,
// DetailViewComponent,
FlipCardComponent
];
}
|
zcy924/my-project
|
src/app/routes/screen/components/carousel.component.ts
|
TypeScript
|
InterfaceDeclaration
|
interface ProcessEnv extends ArchAngelEnv {}
|
Lioness100/archangel
|
src/lib/env/augments.d.ts
|
TypeScript
|
ClassDeclaration
|
@Component
export default class extends Vue {
get accountState() {
return this.$store.state.account as AccountState;
}
render(h: CreateElement) {
const dialog = this.accountState.dialog;
const DialogComponent = dialog == null ? null : dialogComponents[dialog];
return DialogComponent == null ? null : h(DialogComponent);
}
created(this: Vue) {
const matchedRoute = this.$route.matched[0] as any;
const dialog = matchedRoute ? matchedRoute.dialogType : null;
if (dialog) {
this.$store.commit('account/showDialog', { dialog, dialogCloseRedirect: '/' });
}
}
}
|
alexander-rakhlin/coloc
|
RankColoc/webapp/src/modules/Account/components/DialogController.ts
|
TypeScript
|
MethodDeclaration
|
render(h: CreateElement) {
const dialog = this.accountState.dialog;
const DialogComponent = dialog == null ? null : dialogComponents[dialog];
return DialogComponent == null ? null : h(DialogComponent);
}
|
alexander-rakhlin/coloc
|
RankColoc/webapp/src/modules/Account/components/DialogController.ts
|
TypeScript
|
MethodDeclaration
|
created(this: Vue) {
const matchedRoute = this.$route.matched[0] as any;
const dialog = matchedRoute ? matchedRoute.dialogType : null;
if (dialog) {
this.$store.commit('account/showDialog', { dialog, dialogCloseRedirect: '/' });
}
}
|
alexander-rakhlin/coloc
|
RankColoc/webapp/src/modules/Account/components/DialogController.ts
|
TypeScript
|
ClassDeclaration
|
/**
* AutoScroll simply hooks up mouse events given a parent element, and scrolls the container
* up/down depending on how close the mouse is to the top/bottom of the container.
*
* Once you don't want autoscroll any more, just dispose the helper and it will unhook events.
*
* @public
* {@docCategory AutoScroll}
*/
export declare class AutoScroll {
private _events;
private _scrollableParent;
private _scrollRect;
private _scrollVelocity;
private _timeoutId;
constructor(element: HTMLElement);
dispose(): void;
private _onMouseMove;
private _onTouchMove;
private _computeScrollVelocity;
private _startScroll;
private _incrementScroll;
private _stopScroll;
}
|
GhostMachineSoftware/SPFx_GetListItems
|
node_modules/@microsoft/sp-loader/node_modules/@uifabric/utilities/lib-amd/AutoScroll.d.ts
|
TypeScript
|
MethodDeclaration
|
dispose(): void;
|
GhostMachineSoftware/SPFx_GetListItems
|
node_modules/@microsoft/sp-loader/node_modules/@uifabric/utilities/lib-amd/AutoScroll.d.ts
|
TypeScript
|
FunctionDeclaration
|
function sessionTypeDisplayKey(type: SessionType): string {
switch (type) {
case "IDP":
return "UserDetails.session.kind.idp";
case "OFFLINE_GRANT":
return "UserDetails.session.kind.offline-grant";
}
return "";
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (!isHidden && !isLoading) {
onConfirm();
}
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => {
if (!isHidden && !isLoading) {
onDismiss();
}
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => {
return {
title: <FormattedMessage id={titleKey} />,
subText: renderToString(messageKey),
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => {
setIsConfirmDialogHidden(true);
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => [
{
key: "displayName",
fieldName: "displayName",
name: renderToString("UserDetails.session.devices"),
className: styles.cell,
minWidth: 200,
maxWidth: 200,
},
{
key: "kind",
fieldName: "kind",
name: renderToString("UserDetails.session.kind"),
className: styles.cell,
minWidth: 100,
maxWidth: 100,
},
{
key: "ipAddress",
fieldName: "ipAddress",
name: renderToString("UserDetails.session.ip-address"),
className: styles.cell,
minWidth: 80,
maxWidth: 80,
},
{
key: "lastActivity",
fieldName: "lastActivity",
name: renderToString("UserDetails.session.last-activity"),
className: styles.cell,
minWidth: 140,
maxWidth: 140,
},
{
key: "action",
name: renderToString("UserDetails.session.action"),
minWidth: 60,
maxWidth: 60,
// eslint-disable-next-line react/no-unstable-nested-components
onRender: (item: SessionItemViewModel) => (
<ActionButton
className={styles.actionButton}
theme={themes.destructive}
onClick={item.revoke}
>
<FormattedMessage id="UserDetails.session.action.revoke" />
</ActionButton>
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
(item: SessionItemViewModel) => (
<ActionButton
className={styles.actionButton}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() =>
sessions.map(
(session): SessionItemViewModel => ({
displayName: session.displayName,
kind: renderToString(sessionTypeDisplayKey(session.type)),
ipAddress: session.lastAccessedByIP,
lastActivity: formatDatetime(locale, session.lastAccessedAt) ?? "",
revoke: () => {
setConfirmDialogProps({
titleKey: "UserDetails.session.confirm-dialog.revoke.title",
messageKey: "UserDetails.session.confirm-dialog.revoke.message",
onConfirm: () => {
revokeSession(session.id).finally(() =>
setIsConfirmDialogHidden(true)
);
},
});
setIsConfirmDialogHidden(false);
},
})
)
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
(session): SessionItemViewModel => ({
displayName: session.displayName,
kind: renderToString(sessionTypeDisplayKey(session.type)),
ipAddress: session.lastAccessedByIP,
lastActivity: formatDatetime(locale, session.lastAccessedAt) ?? "",
revoke: () => {
setConfirmDialogProps({
titleKey: "UserDetails.session.confirm-dialog.revoke.title",
messageKey: "UserDetails.session.confirm-dialog.revoke.message",
onConfirm: () => {
revokeSession(session.id).finally(() =>
setIsConfirmDialogHidden(true)
);
},
});
setIsConfirmDialogHidden(false);
},
})
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => {
setConfirmDialogProps({
titleKey: "UserDetails.session.confirm-dialog.revoke.title",
messageKey: "UserDetails.session.confirm-dialog.revoke.message",
onConfirm: () => {
revokeSession(session.id).finally(() =>
setIsConfirmDialogHidden(true)
);
},
});
setIsConfirmDialogHidden(false);
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => {
revokeSession(session.id).finally(() =>
setIsConfirmDialogHidden(true)
);
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() =>
setIsConfirmDialogHidden(true)
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => {
setConfirmDialogProps({
titleKey: "UserDetails.session.confirm-dialog.revoke-all.title",
messageKey: "UserDetails.session.confirm-dialog.revoke-all.message",
onConfirm: () => {
revokeAllSessions(userID).finally(() => setIsConfirmDialogHidden(true));
},
});
setIsConfirmDialogHidden(false);
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => {
revokeAllSessions(userID).finally(() => setIsConfirmDialogHidden(true));
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
() => setIsConfirmDialogHidden(true)
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface RevokeConfirmationDialogProps {
isHidden: boolean;
isLoading: boolean;
titleKey: string;
messageKey: string;
onConfirm: () => void;
onDismiss: () => void;
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface SessionItemViewModel {
displayName: string;
kind: string;
ipAddress: string;
lastActivity: string;
revoke: () => void;
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface Props {
sessions: Session[];
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface ConfirmDialogProps {
titleKey: string;
messageKey: string;
onConfirm: () => void;
}
|
authgear/authgear-server
|
portal/src/graphql/adminapi/UserDetailsSession.tsx
|
TypeScript
|
ArrowFunction
|
(predvolené:
|
Dracarys07/deeponion
|
src/qt/locale/bitcoin_sk.ts
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Combobox
items={iconItems}
labelText="Choose a component:"
helpText="This is the help text"
optionTemplate={(item: IconItems)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Box backgroundColor="colorBackgroundBodyInverse" padding="space60">
<Combobox
items={iconItems}
labelText="Choose a component:"
helpText="This is the help text"
optionTemplate={(item)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
const [inputItems, setInputItems] = React.useState(items);
return (
<Combobox
autocomplete
items={inputItems}
helpText="This is the help text"
labelText="Choose a component:"
onInputValueChange={({inputValue})
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(item) => item.toLowerCase().startsWith(inputValue.toLowerCase())
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return <Combobox items={items} labelText="Choose a component:" helpText="This is the help text" required />;
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Box backgroundColor="colorBackgroundBodyInverse" padding="space60">
<Combobox
items={items}
labelText="Choose a component:"
helpText="This is the help text"
required
variant="inverse"
/>
</Box>
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return <Combobox items={items} labelText="Choose a component:" helpText="This is the help text" hasError />;
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Box backgroundColor="colorBackgroundBodyInverse" padding="space60">
<Combobox
items={items}
labelText="Choose a component:"
helpText="This is the help text"
hasError
variant="inverse"
/>
</Box>
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return <Combobox items={items} labelText="Choose a component:" helpText="This is the help text" disabled />;
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Box backgroundColor="colorBackgroundBodyInverse" padding="space60">
<Combobox
items={items}
labelText="Choose a component:"
helpText="This is the help text"
disabled
variant="inverse"
/>
</Box>
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Combobox
items={items}
insertBefore={<div>$10.99</div>}
insertAfter={
<Anchor href="#" display="flex">
<InformationIcon decorative={false} size="sizeIcon20" title="Get more info" />
</Anchor>
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Box backgroundColor="colorBackgroundBodyInverse" padding="space60">
<Combobox
items={items}
insertBefore={
<Text as="span" color="colorTextInverse" lineHeight="lineHeight20">
$10.99
</Text>
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
const [inputItems, setInputItems] = React.useState(objectItems);
return (
<Combobox
autocomplete
items={inputItems}
labelText="Choose a country:"
helpText="This is the help text"
optionTemplate={(item: ObjectItem)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(item: ObjectItem) => item.label.toLowerCase().startsWith(inputValue.toLowerCase())
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
const [inputItems, setInputItems] = React.useState(items);
return (
<Box maxWidth="size40">
<Combobox
items={inputItems}
helpText="This is the help text"
labelText="Choose a component:"
initialSelectedItem={inputItems[5]}
onInputValueChange={({inputValue})
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
const [value, setValue] = React.useState('');
const [selectedItem, setSelectedItem] = React.useState({});
const [inputItems, setInputItems] = React.useState(objectItems);
return (
<>
<Combobox
autocomplete
items={inputItems}
labelText="Choose a country:"
helpText="This is the help text"
optionTemplate={(item: ObjectItem)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
const [value, setValue] = React.useState('');
const [selectedItem, setSelectedItem] = React.useState({});
const [inputItems, setInputItems] = React.useState(objectItems);
const {reset, ...state} = useCombobox({
items: inputItems,
itemToString: (item) => (item ? item.label : ''),
onSelectedItemChange: (changes) => {
// @ts-ignore
setSelectedItem(changes.selectedItem);
},
onInputValueChange: ({inputValue}) => {
if (inputValue !== undefined) {
setInputItems(
_.filter(objectItems, (item: ObjectItem) => item.label.toLowerCase().startsWith(inputValue.toLowerCase()))
);
setValue(inputValue);
}
},
inputValue: value,
});
return (
<>
<Combobox
state={state}
items={inputItems}
autocomplete
labelText="Choose a country:"
helpText="This is the help text"
optionTemplate={(item: ObjectItem)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(item) => (item ? item.label : '')
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(changes) => {
// @ts-ignore
setSelectedItem(changes.selectedItem);
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
({inputValue}) => {
if (inputValue !== undefined) {
setInputItems(
_.filter(objectItems, (item: ObjectItem) => item.label.toLowerCase().startsWith(inputValue.toLowerCase()))
);
setValue(inputValue);
}
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Combobox
items={objectItems}
labelText="Choose a country:"
initialIsOpen
optionTemplate={(item: ObjectItem)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Combobox
groupItemsBy="group"
items={groupedItems}
labelText="Choose a component:"
helpText="This is group"
optionTemplate={(item: GroupedItem)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
return (
<Combobox
groupItemsBy="group"
items={groupedItems}
labelText="Choose a component:"
helpText="This is group"
initialIsOpen
optionTemplate={(item: GroupedItem)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
const [inputItems, setInputItems] = React.useState(groupedItems);
return (
<Combobox
autocomplete
groupItemsBy="group"
items={inputItems}
labelText="Choose a component:"
helpText="This is the help text"
optionTemplate={(item: GroupedItem)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(item: GroupedItem) => item.label.toLowerCase().startsWith(inputValue.toLowerCase())
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
(): React.ReactNode => {
const [selectValue, setSelectValue] = React.useState('');
const selectID = useUID();
return (
<>
<Box marginBottom="space50">
<Combobox
items={iconItems}
labelText="Choose a component:"
helpText="This is the help text"
optionTemplate={(item: IconItems)
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface IconItems {
label: string;
iconRight?: boolean;
iconLeft?: undefined;
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface ObjectItem {
code: string;
label: string;
phone: string;
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
InterfaceDeclaration
|
interface GroupedItem {
group?: string;
label: string;
}
|
synnottd/paste
|
packages/paste-core/components/combobox/stories/index.stories.tsx
|
TypeScript
|
ArrowFunction
|
user => {
this.notLoggedIn = true;
if (user.id) {
this.purchasesService.getValidPurchases().subscribe((purchases: Purchase[]) => {
const purchasesByUser: Purchase[] = purchases.filter(p => p.user.id === user.id);
this.firstname = user.firstname;
this.lastname = user.name;
this.dateofbrith = user.dateOfBirth;
this.displayProfile = true;
// tslint:disable-next-line:max-line-length
purchasesByUser.forEach((purchase: Purchase) => this.passes.push({valid: this.formatDate(purchase.validFrom) + ' - ' + this.formatDate(purchase.validTo), qrcode: purchase.qrCode}));
});
this.notLoggedIn = false;
}
}
|
timmmmmb/B-rnH-ckt4
|
Code/web-app/src/app/components/user/user.component.ts
|
TypeScript
|
ArrowFunction
|
(purchases: Purchase[]) => {
const purchasesByUser: Purchase[] = purchases.filter(p => p.user.id === user.id);
this.firstname = user.firstname;
this.lastname = user.name;
this.dateofbrith = user.dateOfBirth;
this.displayProfile = true;
// tslint:disable-next-line:max-line-length
purchasesByUser.forEach((purchase: Purchase) => this.passes.push({valid: this.formatDate(purchase.validFrom) + ' - ' + this.formatDate(purchase.validTo), qrcode: purchase.qrCode}));
}
|
timmmmmb/B-rnH-ckt4
|
Code/web-app/src/app/components/user/user.component.ts
|
TypeScript
|
ArrowFunction
|
p => p.user.id === user.id
|
timmmmmb/B-rnH-ckt4
|
Code/web-app/src/app/components/user/user.component.ts
|
TypeScript
|
ArrowFunction
|
(purchase: Purchase) => this.passes.push({valid: this.formatDate(purchase.validFrom) + ' - ' + this.formatDate(purchase.validTo), qrcode: purchase.qrCode})
|
timmmmmb/B-rnH-ckt4
|
Code/web-app/src/app/components/user/user.component.ts
|
TypeScript
|
ClassDeclaration
|
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
styleUrls: ['./user.component.css']
})
export class UserComponent implements OnInit {
displayProfile = false;
notLoggedIn = false;
firstname: string;
lastname: string;
dateofbrith: string;
validity: string;
passes: { valid: string, qrcode: string }[] = [];
constructor(private purchasesService: PurchasesService, private store: Store<any>) { }
ngOnInit() {
this.store.select(selectUser).subscribe(user => {
this.notLoggedIn = true;
if (user.id) {
this.purchasesService.getValidPurchases().subscribe((purchases: Purchase[]) => {
const purchasesByUser: Purchase[] = purchases.filter(p => p.user.id === user.id);
this.firstname = user.firstname;
this.lastname = user.name;
this.dateofbrith = user.dateOfBirth;
this.displayProfile = true;
// tslint:disable-next-line:max-line-length
purchasesByUser.forEach((purchase: Purchase) => this.passes.push({valid: this.formatDate(purchase.validFrom) + ' - ' + this.formatDate(purchase.validTo), qrcode: purchase.qrCode}));
});
this.notLoggedIn = false;
}
});
}
formatDate(date: Date): string {
// To solve issues with different date types
date = new Date(date.toString());
let dd: string = date.getDate().toString();
let mm: string = date.getMonth().toString();
const yyyy: string = date.getFullYear().toString();
if (dd.length < 2) {
dd = '0' + dd;
}
if (mm.length < 2) {
mm = '0' + mm;
}
return `${dd}.${mm}.${yyyy}`;
}
}
|
timmmmmb/B-rnH-ckt4
|
Code/web-app/src/app/components/user/user.component.ts
|
TypeScript
|
MethodDeclaration
|
ngOnInit() {
this.store.select(selectUser).subscribe(user => {
this.notLoggedIn = true;
if (user.id) {
this.purchasesService.getValidPurchases().subscribe((purchases: Purchase[]) => {
const purchasesByUser: Purchase[] = purchases.filter(p => p.user.id === user.id);
this.firstname = user.firstname;
this.lastname = user.name;
this.dateofbrith = user.dateOfBirth;
this.displayProfile = true;
// tslint:disable-next-line:max-line-length
purchasesByUser.forEach((purchase: Purchase) => this.passes.push({valid: this.formatDate(purchase.validFrom) + ' - ' + this.formatDate(purchase.validTo), qrcode: purchase.qrCode}));
});
this.notLoggedIn = false;
}
});
}
|
timmmmmb/B-rnH-ckt4
|
Code/web-app/src/app/components/user/user.component.ts
|
TypeScript
|
MethodDeclaration
|
formatDate(date: Date): string {
// To solve issues with different date types
date = new Date(date.toString());
let dd: string = date.getDate().toString();
let mm: string = date.getMonth().toString();
const yyyy: string = date.getFullYear().toString();
if (dd.length < 2) {
dd = '0' + dd;
}
if (mm.length < 2) {
mm = '0' + mm;
}
return `${dd}.${mm}.${yyyy}`;
}
|
timmmmmb/B-rnH-ckt4
|
Code/web-app/src/app/components/user/user.component.ts
|
TypeScript
|
ClassDeclaration
|
export class CoreArgument extends Argument<DMChannel> {
public constructor(context: PieceContext) {
super(context, { name: 'dmChannel' });
}
public run(argument: string): ArgumentResult<DMChannel> {
const channel = this.client.channels.cache.get(argument);
if (!channel) {
return this.error(argument, 'ArgumentChannelMissingChannel', 'The argument did not resolve to a channel.');
}
if (channel.type !== 'dm') {
return this.error(argument, 'ArgumentDMChannelInvalidChannel', 'The argument did not resolve to a DM channel.');
}
return this.ok(channel as DMChannel);
}
}
|
Soumil07/framework
|
src/arguments/CoreDMChannel.ts
|
TypeScript
|
MethodDeclaration
|
public run(argument: string): ArgumentResult<DMChannel> {
const channel = this.client.channels.cache.get(argument);
if (!channel) {
return this.error(argument, 'ArgumentChannelMissingChannel', 'The argument did not resolve to a channel.');
}
if (channel.type !== 'dm') {
return this.error(argument, 'ArgumentDMChannelInvalidChannel', 'The argument did not resolve to a DM channel.');
}
return this.ok(channel as DMChannel);
}
|
Soumil07/framework
|
src/arguments/CoreDMChannel.ts
|
TypeScript
|
ArrowFunction
|
(alapértelmezett: 9333 or testnet: 19333)
|
digitalshekel/digitalshekel
|
src/qt/locale/bitcoin_hu.ts
|
TypeScript
|
ArrowFunction
|
(alapértelmezett: 9332 or testnet: 19332)
|
digitalshekel/digitalshekel
|
src/qt/locale/bitcoin_hu.ts
|
TypeScript
|
ArrowFunction
|
(alapértelmezett: 100)
|
digitalshekel/digitalshekel
|
src/qt/locale/bitcoin_hu.ts
|
TypeScript
|
ArrowFunction
|
(f) => this.addAssemblies(path.join(p, f))
|
NGL321/jsii-docgen
|
test/docgen/assemblies.ts
|
TypeScript
|
ClassDeclaration
|
/**
* Singelton class to expose various assemblies for test purposes.
*
* Use `Assemblies.instance` to obtain it.
*/
export class Assemblies {
private static _instance: Assemblies;
private readonly ts: reflect.TypeSystem;
public static get instance() {
if (this._instance) {
return this._instance;
}
this._instance = new Assemblies();
return this._instance;
}
private constructor() {
this.ts = new reflect.TypeSystem();
this.addAssemblies(`${__dirname}/../__fixtures__/assemblies`);
}
public get withoutSubmodules(): reflect.Assembly {
return this.ts.findAssembly('@aws-cdk/aws-ecr');
}
public get withSubmodules(): reflect.Assembly {
return this.ts.findAssembly('aws-cdk-lib');
}
private addAssemblies(p: string) {
const stat = fs.statSync(p);
if (stat.isDirectory()) {
fs.readdirSync(p).forEach((f) => this.addAssemblies(path.join(p, f)));
} else {
if (p.endsWith('.jsii')) {
const assembly = JSON.parse(fs.readFileSync(p, { encoding: 'utf8' })) as spec.Assembly;
this.ts.addAssembly(new reflect.Assembly(this.ts, assembly));
}
}
}
}
|
NGL321/jsii-docgen
|
test/docgen/assemblies.ts
|
TypeScript
|
MethodDeclaration
|
private addAssemblies(p: string) {
const stat = fs.statSync(p);
if (stat.isDirectory()) {
fs.readdirSync(p).forEach((f) => this.addAssemblies(path.join(p, f)));
} else {
if (p.endsWith('.jsii')) {
const assembly = JSON.parse(fs.readFileSync(p, { encoding: 'utf8' })) as spec.Assembly;
this.ts.addAssembly(new reflect.Assembly(this.ts, assembly));
}
}
}
|
NGL321/jsii-docgen
|
test/docgen/assemblies.ts
|
TypeScript
|
ClassDeclaration
|
export class ACLConfigurator extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
listeners(eventName?: string): Array<Listener>;
off(eventName: string, listener: Listener): this;
on(eventName: string, listener: Listener): this;
once(eventName: string, listener: Listener): this;
removeListener(eventName: string, listener: Listener): this;
removeAllListeners(eventName?: string): this;
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
interface: ACLConfiguratorInterface;
functions: {
setupFundraisingPermissions(
_acl: string,
_owner: string,
reserve: string,
presale: string,
marketMaker: string,
controller: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
};
setupFundraisingPermissions(
_acl: string,
_owner: string,
reserve: string,
presale: string,
marketMaker: string,
controller: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
callStatic: {
setupFundraisingPermissions(
_acl: string,
_owner: string,
reserve: string,
presale: string,
marketMaker: string,
controller: string,
overrides?: CallOverrides
): Promise<void>;
};
filters: {};
estimateGas: {
setupFundraisingPermissions(
_acl: string,
_owner: string,
reserve: string,
presale: string,
marketMaker: string,
controller: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<BigNumber>;
};
populateTransaction: {
setupFundraisingPermissions(
_acl: string,
_owner: string,
reserve: string,
presale: string,
marketMaker: string,
controller: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<PopulatedTransaction>;
};
}
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
InterfaceDeclaration
|
interface ACLConfiguratorInterface extends ethers.utils.Interface {
functions: {
"setupFundraisingPermissions(address,address,address,address,address,address)": FunctionFragment;
};
encodeFunctionData(
functionFragment: "setupFundraisingPermissions",
values: [string, string, string, string, string, string]
): string;
decodeFunctionResult(
functionFragment: "setupFundraisingPermissions",
data: BytesLike
): Result;
events: {};
}
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
connect(signerOrProvider: Signer | Provider | string): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
attach(addressOrName: string): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
deployed(): Promise<this>;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
listeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
): Array<TypedListener<EventArgsArray, EventArgsObject>>;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
off<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
on<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
once<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
listener: TypedListener<EventArgsArray, EventArgsObject>
): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
listeners(eventName?: string): Array<Listener>;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
off(eventName: string, listener: Listener): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
on(eventName: string, listener: Listener): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
once(eventName: string, listener: Listener): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
removeListener(eventName: string, listener: Listener): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
removeAllListeners(eventName?: string): this;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
event: TypedEventFilter<EventArgsArray, EventArgsObject>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
MethodDeclaration
|
setupFundraisingPermissions(
_acl: string,
_owner: string,
reserve: string,
presale: string,
marketMaker: string,
controller: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<ContractTransaction>;
|
swamp-thing-sovryn/bootstrap-continuous-tokens
|
typechain/ACLConfigurator.d.ts
|
TypeScript
|
ArrowFunction
|
() => {
it('test', () => {
const basePage = new BasePage();
cy.fixture('get.project.json').as('initProjectJSON');
cy.fixture('metadata.json').as('initmetadata');
cy.intercept('/api/bridgeInfo', { fixture: 'bridgeInfo.mock' });
cy.intercept('GET', 'api/v1/metadata', { fixture: 'metadata.json' }).as('metadataCmpl');
cy.intercept('GET', 'api/controlPlane/v1/project?disableUpstreamSync=true&pageSize=50', {
fixture: 'get.project.json',
}).as('initProjects');
cy.intercept('GET', 'api/controlPlane/v1/sequence/dynatrace?pageSize=5', { fixture: 'project.sequences.json' });
cy.intercept('GET', 'api/project/dynatrace?approval=true&remediation=true', {
statusCode: 200,
});
cy.intercept('DELETE', '/api/controlPlane/v1/project/dynatrace', {
statusCode: 200,
});
cy.intercept('POST', 'api/hasUnreadUniformRegistrationLogs', {
statusCode: 200,
});
cy.visit('/');
cy.wait('@metadataCmpl');
basePage.clickProjectTile('dynatrace');
basePage.gotoSettingsPage().clickDeleteProjectButton().typeProjectNameToDelete('dynatrace').submitDelete();
});
}
|
bhamail/keptn
|
bridge/cypress/integration/project-delete.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
const basePage = new BasePage();
cy.fixture('get.project.json').as('initProjectJSON');
cy.fixture('metadata.json').as('initmetadata');
cy.intercept('/api/bridgeInfo', { fixture: 'bridgeInfo.mock' });
cy.intercept('GET', 'api/v1/metadata', { fixture: 'metadata.json' }).as('metadataCmpl');
cy.intercept('GET', 'api/controlPlane/v1/project?disableUpstreamSync=true&pageSize=50', {
fixture: 'get.project.json',
}).as('initProjects');
cy.intercept('GET', 'api/controlPlane/v1/sequence/dynatrace?pageSize=5', { fixture: 'project.sequences.json' });
cy.intercept('GET', 'api/project/dynatrace?approval=true&remediation=true', {
statusCode: 200,
});
cy.intercept('DELETE', '/api/controlPlane/v1/project/dynatrace', {
statusCode: 200,
});
cy.intercept('POST', 'api/hasUnreadUniformRegistrationLogs', {
statusCode: 200,
});
cy.visit('/');
cy.wait('@metadataCmpl');
basePage.clickProjectTile('dynatrace');
basePage.gotoSettingsPage().clickDeleteProjectButton().typeProjectNameToDelete('dynatrace').submitDelete();
}
|
bhamail/keptn
|
bridge/cypress/integration/project-delete.spec.ts
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.